Password availability for Android not working with library 25 support?

I implemented TextInputLayout with a password field in the usual way:

<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/returning_password" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/prompt_password" android:inputType="textPassword" android:maxLines="1" android:textSize="14sp" /> </android.support.design.widget.TextInputLayout> 

This worked fine when using the Android support library prior to version 24.0.2, but after switching to 25.0.1:

 compile 'com.android.support:design:25.0.1' compile 'com.android.support:support-v4:25.0.1' compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.android.support:support-vector-drawable:25.0.1' 

I no longer see the visibility of the password (aka "eye icon") in widgets. Switching to the latest version 25.1.0 does not fix this problem.

Is there something I missed and I need to change in conjunction with the support library 25, or could it be a problem with Android?

+8
source share
4 answers

Try it.

 <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:passwordToggleEnabled="true"> <EditText android:id="@+id/returning_password" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/prompt_password" android:inputType="textPassword" android:maxLines="1" android:textSize="14sp" /> </android.support.design.widget.TextInputLayout> 

This may be useful for you!

Now TextInputLayout password switching is disabled by default to avoid unnecessarily overwriting the end specifications specified by the developer. It can be manually enabled using the passwordToggleEnabled XML attribute.

Recent Support Library Versions

+28
source

You do not need to add the following data:

 app:passwordToggleEnabled="true" 

just change your dependency to:

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

This is the same error I encountered while updating dependencies.

Edit:

Now

app:passwordToggleEnabled="true"

work with

 compile 'com.android.support:design:25.3.0' 
+3
source
 <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:passwordToggleEnabled="true"> 

Application: passwordToggleEnabled = "true">

 <EditText android:id="@+id/edt_password" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Password" android:inputType="textPassword" android:maxLines="1" android:textSize="16sp" /> </android.support.design.widget.TextInputLayout> 

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

compile 'com.android.support:support-v4:25.0.1'

compile 'com.android.support:appcompat-v7:25.0.1'

compile 'com.android.support:support-vector-drawable:25.0.1'

+1
source

if you use jetpack then

add these dependencies

 implementation 'com.google.android.material:material:1.0.0' 

and add app:passwordToggleEnabled="true" in xml and one more thing, use inputType= textPassword , and if you use instead, the toggle button will not be displayed.

+1
source

Source: https://habr.com/ru/post/1262039/


All Articles