mirror of
https://github.com/oasisfeng/deagle.git
synced 2025-01-09 04:10:03 +08:00
REFACTOR: Rename TextViewDrawableBindingAdapter to TextViewDrawableClickBindingAdapter and its method setOnDrawableStartClick() to setOnDrawableClickListener().
This commit is contained in:
parent
da1cead1b5
commit
8dc137595a
@ -11,15 +11,15 @@ import android.widget.TextView;
|
||||
import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
|
||||
|
||||
/**
|
||||
* Binding adapter for click events on compound drawables.
|
||||
* Binding adapter for click listeners on compound drawables of {@link TextView}.
|
||||
*
|
||||
* Created by Oasis on 2016/4/21.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class TextViewDrawableBindingAdapter {
|
||||
public class TextViewDrawableClickBindingAdapter {
|
||||
|
||||
@BindingAdapter(value = {"onDrawableStartClick", "onDrawableEndClick", "onDrawableLeftClick", "onDrawableRightClick"}, requireAll = false)
|
||||
public static void setOnDrawableStartClick(final TextView view, final OnClickListener start_listener,
|
||||
public static void setOnDrawableClickListener(final TextView view, final OnClickListener start_listener,
|
||||
final OnClickListener end_listener, final OnClickListener left_listener, final OnClickListener right_listener) {
|
||||
view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(final View v, final MotionEvent event) {
|
||||
final boolean fire = event.getAction() == MotionEvent.ACTION_UP; // Non-up action should still be consumed to avoid unexpected asymmetric behaviors
|
Loading…
Reference in New Issue
Block a user