Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ - 按钮的触发 只通过ACTION_DOWN 就触发了 没有判断ACTION_UP (我是在RecyclerView中使用的) #12

Open
BlackC0 opened this issue Sep 7, 2018 · 2 comments

Comments

@BlackC0
Copy link

BlackC0 commented Sep 7, 2018

No description provided.

@MHKalantarian
Copy link

MHKalantarian commented Mar 5, 2019

Hi, have you found any solution for this? I have problem accidentally clicking it while scrolling recyclerview

@M2dL1fe
Copy link

M2dL1fe commented May 20, 2020

@OverRide
public boolean onTouchEvent(MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
return true;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
if (isReplenish) {
break;
}
//hint文字模式
if (isHintMode) {
onAddClick();
return true;
} else {
if (mAddRegion.contains((int) event.getX(), (int) event.getY())) {
onAddClick();
return true;
} else if (mDelRegion.contains((int) event.getX(), (int) event.getY())) {
onDelClick();
return true;
}
}
break;
case MotionEvent.ACTION_CANCEL:
break;
}
return super.onTouchEvent(event);
}

自己处理一下就可以了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants