Skip to content

Commit

Permalink
Merge pull request #2 from joaortk/master
Browse files Browse the repository at this point in the history
fixed clearButton
  • Loading branch information
cleber-henriques-ilegra committed Aug 17, 2017
2 parents ee27bc7 + 39b5313 commit cefe6f2
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1329,19 +1329,17 @@ protected void onDraw(@NonNull Canvas canvas) {
} else if (!isEnabled()) { // disabled



int disabledLineColor = disabledUnderlineColor;
if (disabledUnderlineColor == -1){
if (disabledUnderlineColor == -1) {
disabledLineColor = underlineColor != -1 ? underlineColor : baseColor;
}
paint.setColor(disabledLineColor & 0x00ffffff | 0x44000000);
if (dottedBottomLinesForDisabledState){
if (dottedBottomLinesForDisabledState) {
float interval = getPixel(1);
for (float xOffset = 0; xOffset < getWidth(); xOffset += interval * 3) {
canvas.drawRect(startX + xOffset, lineStartY, startX + xOffset + interval, lineStartY + getPixel(1), paint);
}
}
else{
} else {
canvas.drawRect(startX, lineStartY, endX, lineStartY + getPixel(1), paint);
}
} else if (hasFocus()) { // focused
Expand Down Expand Up @@ -1531,15 +1529,15 @@ 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;
} else {
buttonLeft = endX - iconOuterWidth;
buttonLeft = endX - 2 * 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);
}

Expand Down

0 comments on commit cefe6f2

Please sign in to comment.