/* 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
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
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
| InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;\r
}\r
view.setInputType(input_type);\r
+ view.setSelection(selectionStart, selectionEnd);\r
}\r
}\r
\r