From: David A. Velasco Date: Fri, 17 May 2013 12:33:31 +0000 (+0200) Subject: Visibility icon in password field is toggled according to the visibility state; bette... X-Git-Tag: oc-android-1.4.3~16^2~1^2^2~4 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/69b527c39d82546f053d7ef2b9a1f094f1b4a94e?ds=inline;hp=-c Visibility icon in password field is toggled according to the visibility state; better touch detection of visibility and refresh buttons --- 69b527c39d82546f053d7ef2b9a1f094f1b4a94e diff --git a/res/layout-land/account_setup.xml b/res/layout-land/account_setup.xml index a4b5a5e4..52f53925 100644 --- a/res/layout-land/account_setup.xml +++ b/res/layout-land/account_setup.xml @@ -122,28 +122,16 @@ android:hint="@string/auth_username" android:inputType="textNoSuggestions" /> - - - - - - + android:ems="10" + android:hint="@string/auth_password" + android:inputType="textPassword" + android:drawablePadding="5dp" + /> + - - - - - - - + + 2) { - rightDrawable = drawables[2]; - } + Drawable rightDrawable = null; + if (view instanceof TextView) { + Drawable[] drawables = ((TextView)view).getCompoundDrawables(); + if (drawables.length > 2) { + rightDrawable = drawables[2]; } - if (rightDrawable != null) { - final int x = (int) event.getX(); - final int y = (int) event.getY(); - final Rect bounds = rightDrawable.getBounds(); - if (x >= (view.getRight() - bounds.width() - fuzz) && x <= (view.getRight() - view.getPaddingRight() + fuzz) - && y >= (view.getPaddingTop() - fuzz) && y <= (view.getHeight() - view.getPaddingBottom()) + fuzz) { - - return onDrawableTouch(event); - } + } + if (rightDrawable != null) { + final int x = (int) event.getX(); + final int y = (int) event.getY(); + final Rect bounds = rightDrawable.getBounds(); + if (x >= (view.getRight() - bounds.width() - fuzz) && x <= (view.getRight() - view.getPaddingRight() + fuzz) + && y >= (view.getPaddingTop() - fuzz) && y <= (view.getHeight() - view.getPaddingBottom()) + fuzz) { + + return onDrawableTouch(event); } } return false;