Password Visibility Toggles
suggest changeWith an input password type, you can also enable an icon that can show or hide the entire text using the passwordToggleEnabled attribute.
You can also customize that default icon using these attributes:
passwordToggleDrawable: to change the default eye iconpasswordToggleTint: to apply a tint to the password visibility toggle drawable.passwordToggleTintMode: to specify the blending mode used to apply the toggle drawable's tint.
Example:
<android.support.design.widget.TextInputLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleContentDescription="@string/description"
app:passwordToggleDrawable="@drawable/another_toggle_drawable"
app:passwordToggleEnabled="true">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"/>
</android.support.design.widget.TextInputLayout>
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents