Skip to content

Instantly share code, notes, and snippets.

@moyheen
Last active May 2, 2021 23:52
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moyheen/08382b71314e4bb7f55c7976ac0f144a to your computer and use it in GitHub Desktop.
Save moyheen/08382b71314e4bb7f55c7976ac0f144a to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<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"
app:passwordToggleTint="@color/colorAccent">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:inputType="textPassword"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
@moyheen
Copy link
Author

moyheen commented Aug 19, 2016

This snippet contains a very basic example for implementing the password visibility toggle feature released in Android Support Library, revision 24.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment