From 9d685480e2e738516cedff5432c0381ae944c45f Mon Sep 17 00:00:00 2001 From: boliu Date: Mon, 1 Jun 2015 15:25:13 -0700 Subject: [PATCH] Fix clear button not work while inputted text length exceed screen --- .../com/rengwuxian/materialedittext/MaterialEditText.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/rengwuxian/materialedittext/MaterialEditText.java b/library/src/main/java/com/rengwuxian/materialedittext/MaterialEditText.java index dbad52bd..2e5b59bd 100644 --- a/library/src/main/java/com/rengwuxian/materialedittext/MaterialEditText.java +++ b/library/src/main/java/com/rengwuxian/materialedittext/MaterialEditText.java @@ -1504,8 +1504,8 @@ public boolean onTouchEvent(MotionEvent event) { private boolean insideClearButton(MotionEvent event) { float x = event.getX(); float y = event.getY(); - int startX = getScrollX() + (iconLeftBitmaps == null ? 0 : (iconOuterWidth + iconPadding)); - int endX = getScrollX() + (iconRightBitmaps == null ? getWidth() : getWidth() - iconOuterWidth - iconPadding); + int startX = iconLeftBitmaps == null ? 0 : (iconOuterWidth + iconPadding); + int endX = iconRightBitmaps == null ? getWidth() : getWidth() - iconOuterWidth - iconPadding; int buttonLeft; if (isRTL()) { buttonLeft = startX;