public class BCustomerLinearLayout extends LinearLayout implements View.OnTouchListener {
private static final String TAG = "CustomerLinearLayout";
public OnGestureChangeListener listener;
public interface OnGestureChangeListener {
void scrollLeft();
void scrollRight();
// void onClick();
}
public void setOnGestureChangeListener(OnGestureChangeListener listener) {
this.listener = listener;
}
public BCustomerLinearLayout(Context context) {
this(context, null);
}
public BCustomerLinearLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public BCustomerLinearLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
//setGestureListener();
//设置Touch监听
this.setOnTouchListener(this);
//允许长按
this.setLongClickable(true);
}
@Override
public boolean
【android学习】监听左右滑动的LinearLayout
最新推荐文章于 2021-05-26 01:43:29 发布