package it.integry.integrywmsnative.core.di;

import android.view.View;

import androidx.databinding.BindingAdapter;

import it.integry.integrywmsnative.core.expansion.OnMultipleClickListener;
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;

public class ViewConverters {



    @BindingAdapter("singleClick")
    public static void bindViewSingleClick(View view, final Runnable callback) {
        view.setFocusable(true);
        view.setClickable(true);
        view.setOnClickListener(new OnSingleClickListener() {
            @Override
            public void onSingleClick(View v) {
                callback.run();
            }
        });
    }

    @BindingAdapter("multipleClick")
    public static void bindViewMultipleClick(View view, final Runnable callback) {
        view.setFocusable(true);
        view.setClickable(true);
        view.setOnClickListener(new OnMultipleClickListener() {
            @Override
            public void onSingleClick(View v) {
                callback.run();
            }
        });
    }

}
