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

MaterialEditText长度长时,clearbutton不可点击问题 #395

Open
hub-zjy1024 opened this issue Feb 26, 2021 · 0 comments
Open

MaterialEditText长度长时,clearbutton不可点击问题 #395

hub-zjy1024 opened this issue Feb 26, 2021 · 0 comments

Comments

@hub-zjy1024
Copy link

在MaterialEditText中,修改注释掉的几行
private boolean insideClearButton(MotionEvent event) {
float x = event.getX();
float y = event.getY();
int startX = getWidth()-(iconOuterWidth + iconPadding));
int endX= getWidth() ;
//int startX = getScrollX() + (iconLeftBitmaps == null ? 0 : (iconOuterWidth + iconPadding));
//int endX = getScrollX() + (iconRightBitmaps == null ? getWidth() : getWidth() - iconOuterWidth - iconPadding);
int buttonLeft;
if (isRTL()) {
buttonLeft = startX;
} else {
buttonLeft = endX - iconOuterWidth;
}
// int buttonTop = getScrollY() + getHeight() - getPaddingBottom() + bottomSpacing - iconOuterHeight;

int buttonTop = getHeight() - getPaddingBottom() -bottomSpacing - iconOuterHeight;
return (x >= buttonLeft && x < buttonLeft + iconOuterWidth && y >= buttonTop && y < buttonTop + iconOuterHeight);
}

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

1 participant