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:
after updating to
compile 'com.android.support:design:25.0.1'
Its not visible, Why? Is there any bug?
Please guide.
There are five XML attributes associated with the password visibility toggle. passwordToggleEnabled: This attribute has its value either true or false, so when we want the password to be toggleable, we should assign this attribute the true value. passwordToggleTint: allows giving the color the visibility toggle icon.
TextInputLayout textInputCustomEndIcon = findViewById(R. id. editText); final TextInputEditText editText = new TextInputEditText(textInputCustomEndIcon. getContext()); textInputCustomEndIcon.
Add endIconMode to Custom for adding drawable end for a textinputlayout.
<com.google.android.material.textfield.TextInputLayout
app:endIconMode="custom"
app:endIconDrawable="@drawable/ic_tick_grey"
....
</com.google.android.material.textfield.TextInputLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With