Fixed icon that toggles password visibility
authorDavid A. Velasco <dvelasco@solidgear.es>
Thu, 8 Nov 2012 09:09:47 +0000 (10:09 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Thu, 8 Nov 2012 09:09:47 +0000 (10:09 +0100)
src/com/owncloud/android/ui/activity/AuthenticatorActivity.java

index 23ce0c8..52714b6 100644 (file)
@@ -476,8 +476,14 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             onFocusChange(findViewById(R.id.host_URL), false);\r
         } else if (v.getId() == R.id.viewPassword) {\r
             TextView view = (TextView) findViewById(R.id.account_password);\r
             onFocusChange(findViewById(R.id.host_URL), false);\r
         } else if (v.getId() == R.id.viewPassword) {\r
             TextView view = (TextView) findViewById(R.id.account_password);\r
-            int input_type = InputType.TYPE_CLASS_TEXT\r
-                    | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;\r
+            int input_type = view.getInputType();\r
+            if ((input_type & InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) {\r
+                input_type = InputType.TYPE_CLASS_TEXT\r
+                        | InputType.TYPE_TEXT_VARIATION_PASSWORD;\r
+            } else {\r
+                input_type = InputType.TYPE_CLASS_TEXT\r
+                        | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;\r
+            }\r
             view.setInputType(input_type);\r
         }\r
     }\r
             view.setInputType(input_type);\r
         }\r
     }\r