I have chosen the TextInputEditText for my password field, for using the toggle password feature.
Here is my xml code:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="@dimen/login_width"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/password_margin_top"
app:hintEnabled="false"
app:passwordToggleDrawable="@drawable/password_toggle_drawable"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/my_login_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:hint="@string/password"
android:inputType="textPassword"
android:nextFocusDown="@+id/my_login_login"
android:padding="@dimen/field_padding" />
</com.google.android.material.textfield.TextInputLayout>
I have to do some other layout changes on the toggling password. Is there any callback available for this in TextInputLayout?