Lower TextInputEditText not displaying text while typing, only displayed after done (or) next action (or) when tapping anywhere in screen

Viewed 487

Below is my code for EditText,

<com.google.android.material.textfield.TextInputLayout
            android:id="@+id/password_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/username_layout"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="15dp"
            app:hintEnabled="false"
            app:passwordToggleEnabled="false"
            app:passwordToggleTint="@color/white">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/login_password_input"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/login_username_input"
                android:layout_weight="0.0"
                android:drawableEnd="@drawable/password"
                android:background="@drawable/round_bg"
                android:hint="@string/login_password_hint"
                android:imeActionLabel="@string/action_done"
                android:imeOptions="actionDone"
                android:inputType="textPassword"
                android:maxLines="1"
                android:nextFocusDown="@+id/submit_btn"
                android:paddingStart="10dp"
                android:paddingLeft="10dp"
                android:text=""
                android:textColor="#FFFFFF"
                android:textColorHint="#FFFFFF"
                android:textCursorDrawable="@null"
                tools:ignore="RtlSymmetry" />
        </com.google.android.material.textfield.TextInputLayout>

I am setting password eye icon programatically like below,

passwordLayout.setEndIconMode(TextInputLayout.END_ICON_PASSWORD_TOGGLE);
                passwordLayout.setEndIconDrawable(GetDrawable.getDrawable("Show/Hide Password"));
                passwordLayout.setEndIconTintList(ColorStateList.valueOf(getResources().getColor(R.color.color_white)));

This works fine in most of the devices. But getting below issue in Mi a2 Android Version 10.

I have two TextInputLayout for user name and password field There is no issue while typing username field. Next moved to password field. Now, the cursor stucked in first position and typing text is showed up in keyboard but not displayed in Edittext field. Only text is displayed after tapping somewhere else in screen

I am not sure why this happens in some devices

Found below question related to my issue. But no solution provided there.

TextInputEditText is not showing the typed text/number when typing

UPDATE

In this given a solution for my issue, Android Pie edittext does not adjustPan/resize while typing but using Hardware acceleration may lead to high memory usage. So afraid to use this solution. is there any other way to solve this?

1 Answers

I tested the code on emulator on two android devices find nothing wrong with it used com.google.android.material:material:1.3.0

  • please update your color style it has no Legiblity

her

  • pan Adjuesment related issued loged in debug check that
  • try alpha or Rc MDC for libaray version bug
  • Finally you do is open issue at MDC github here
Related