Android TextInputLayout Password toggle not visible in new support library

Pratik Butani picture Pratik Butani · Dec 12, 2016 · Viewed 14.7k times · Source

I have compiled with following design library and it is displaying password HIDE/SHOW button at the right of EditText

compile 'com.android.support:design:24.2.1'

<android.support.design.widget.TextInputLayout
    android:id="@+id/login_password_text_input_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/spacing_normal">

    <android.support.v7.widget.AppCompatEditText
        android:id="@+id/login_password_edit_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawablePadding="@dimen/spacing_micro"
        android:hint="@string/prompt_password"
        android:imeActionId="@+id/login"
        android:imeActionLabel="@string/action_sign_in_short"
        android:imeOptions="actionUnspecified"
        android:inputType="textPassword"
        android:maxLines="1"
        android:text="password" />

</android.support.design.widget.TextInputLayout>

like:

enter image description here

after updating to

compile 'com.android.support:design:25.0.1'

Its not visible, Why? Is there any bug?

Please guide.

Answer

pRaNaY picture pRaNaY · Dec 12, 2016

The TextInputLayout password toggle is now disabled by default to avoid unnecessarily overwriting developer-specified end drawables. It may be manually enabled via the passwordToggleEnabled XML attribute.

from https://developer.android.com/topic/libraries/support-library/revisions.html