Disable change log; to remove in future
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / AuthenticatorActivity.java
index 7321f6a..d277040 100644 (file)
@@ -1,9 +1,10 @@
 /* ownCloud Android client application\r
  *   Copyright (C) 2012  Bartek Przybylski\r
+ *   Copyright (C) 2012-2013 ownCloud Inc.\r
  *\r
  *   This program is free software: you can redistribute it and/or modify\r
  *   it under the terms of the GNU General Public License as published by\r
- *   the Free Software Foundation, either version 3 of the License, or\r
+ *   the Free Software Foundation, either version 2 of the License, or\r
  *   (at your option) any later version.\r
  *\r
  *   This program is distributed in the hope that it will be useful,\r
@@ -55,6 +56,7 @@ import android.view.View.OnClickListener;
 import android.view.View.OnFocusChangeListener;\r
 import android.view.Window;\r
 import android.widget.Button;\r
+import android.widget.EditText;\r
 import android.widget.ImageView;\r
 import android.widget.TextView;\r
 import com.owncloud.android.R;\r
@@ -485,7 +487,9 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         if (v.getId() == R.id.refreshButton) {\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
+            EditText view = (EditText) findViewById(R.id.account_password);\r
+            int selectionStart = view.getSelectionStart();\r
+            int selectionEnd = view.getSelectionEnd();\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
@@ -495,6 +499,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                         | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;\r
             }\r
             view.setInputType(input_type);\r
+            view.setSelection(selectionStart, selectionEnd);\r
         }\r
     }\r
 \r