- Added "Show Password" checkbox to password prompt.
This commit is contained in:
@ -15,6 +15,8 @@ import android.support.v4.content.LocalBroadcastManager
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.text.InputType
|
||||
import android.text.TextWatcher
|
||||
import android.text.method.HideReturnsTransformationMethod
|
||||
import android.text.method.PasswordTransformationMethod
|
||||
import android.widget.*
|
||||
import android.view.*
|
||||
|
||||
@ -956,6 +958,13 @@ class MainActivity : AppCompatActivity() {
|
||||
.inflate(R.layout.password_dialog, findViewById(android.R.id.content) as ViewGroup,
|
||||
false)
|
||||
val input = viewInflated.findViewById(R.id.password) as EditText
|
||||
val checkBox = viewInflated.findViewById(R.id.checkbox) as CheckBox
|
||||
checkBox.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if (isChecked)
|
||||
input.transformationMethod = HideReturnsTransformationMethod()
|
||||
else
|
||||
input.transformationMethod = PasswordTransformationMethod()
|
||||
}
|
||||
builder.setView(viewInflated)
|
||||
builder.setPositiveButton(android.R.string.ok) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
@ -986,6 +995,13 @@ class MainActivity : AppCompatActivity() {
|
||||
.inflate(R.layout.password_dialog, findViewById(android.R.id.content) as ViewGroup,
|
||||
false)
|
||||
val input = viewInflated.findViewById(R.id.password) as EditText
|
||||
val checkBox = viewInflated.findViewById(R.id.checkbox) as CheckBox
|
||||
checkBox.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if (isChecked)
|
||||
input.transformationMethod = HideReturnsTransformationMethod()
|
||||
else
|
||||
input.transformationMethod = PasswordTransformationMethod()
|
||||
}
|
||||
builder.setView(viewInflated)
|
||||
builder.setPositiveButton(android.R.string.ok) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
|
||||
@ -8,14 +8,22 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<AutoCompleteTextView
|
||||
<EditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:importantForAutofill="no"
|
||||
android:hint="@string/password"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="textPassword" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/show_password"
|
||||
android:checked="false"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
</FrameLayout>
|
||||
@ -358,4 +358,5 @@
|
||||
ilman Mikrofoni-käyttöoikeutta.
|
||||
</string>
|
||||
<string name="account_password">Tilin %1$s salasana</string>
|
||||
<string name="show_password">Näytä salasana</string>
|
||||
</resources>
|
||||
|
||||
@ -317,4 +317,5 @@
|
||||
</string>
|
||||
<string name="no_calls">You are not able to place or answer calls without Microphone permission.</string>
|
||||
<string name="account_password">Account %1$s Authentication Password</string>
|
||||
<string name="show_password">Show Password</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user