With 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 same default 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 background tint.Example:
<android.support.design.widget.TextInputLayout
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.support.design.widget.TextInputLayout>