I have a TextInputEditText
combined with a TextInputLayout
with android:inputType="textPassword"
using app:passwordToggleEnabled="true"
to show the password toggle button in TextInputEditText
as the following image:
The problem is , when I click the password toggle button, it disappears forever.
It worked well in the com.android.support:design:24.2.0
version.
Am I missing something new? this is mistake?
Some gradle project settings:
minSdkVersion 17
targetSdkVersion 25
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
Works on two different Android 6.0 devices (Marshmallow).
XML:
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/TextLabelGray" app:passwordToggleEnabled="true"> <android.support.design.widget.TextInputEditText android:id="@+id/profile_field_password" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/perfil_field_password" android:inputType="textPassword" android:maxLines="1" android:maxLength="100" android:imeOptions="actionNext" android:imeActionLabel="@string/perfil_field_tipo_documento" android:textColor="@color/colorAccent" android:textSize="@dimen/perfil_text_view_text_size" android:paddingStart="15dp" android:paddingEnd="5dp"/> </android.support.design.widget.TextInputLayout>
If I use app:passwordToggleDrawable
with a custom user in TextInputLayout
, it does not disappear.
Related Style:
<style name="TextLabelGray" parent="TextAppearance.AppCompat"> <item name="android:textColorHint">@color/gray_text_color</item> <item name="android:textColorHighlight">@color/gray_text_color</item> <item name="android:textColorLink">@color/gray_text_color</item> <item name="colorAccent">@color/gray_text_color</item> <item name="colorControlNormal">@color/gray_text_color</item> <item name="colorControlActivated">@color/gray_text_color</item> </style> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="colorControlNormal">@color/colorControlNormal</item> <item name="searchViewStyle">@style/AppTheme.MySearchViewStyle</item> </style>
source share