package com.ysnows.base.binding;

import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;

import androidx.databinding.BindingAdapter;

public class EditTextBindingAdapter {

    @BindingAdapter("on_focused")
    public static void setFocusedListener(EditText view, View.OnFocusChangeListener listener) {
        if (listener != null) {
            view.setOnFocusChangeListener(listener);
        }
    }

    @BindingAdapter("on_action")
    public static void setOnActionSearch(EditText view, TextView.OnEditorActionListener listener) {
        view.setOnEditorActionListener(listener);
    }

}
