Vlad Herescu
Vlad Herescu

Reputation: 41

Android: TextInputEditText showing text only after change focus

I have a big problem with a EditText that does not show any input until i change focus from element. When I click on the input, the keyboard appears and while i type, there is nothing displayed in the edit text view. The input is shown only when i close the keyboard

It is not a problem of colours. I mention that the view are contained in a constraint layout. I can enable hardware acceleration but this will slow down the application very much and it's not an option. I can however discard the constraint layout and change it to a linear layout but this will affect the rest of the code. I am sure that I am missing something, an easy fix, but i can't put my finger on it. Thanks a lot in advance

<android.support.design.widget.TextInputLayout
        android:id="@+id/codeEditTextContainer"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginBottom="20dp"
        app:layout_constraintBottom_toTopOf="@id/verifyButton"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent">

        <android.support.design.widget.TextInputEditText
            android:id="@+id/codeEditText"
            android:layout_width="match_parent"
            android:inputType="text"
            android:layout_height="wrap_content"
            android:hint="@string/sms_code"
            android:padding="10dp"
            android:textColor="@color/white" />

    </android.support.design.widget.TextInputLayout>

!!UPDATE

Found the problem, but still i have no answer. This problem is present only on Android Pie and only when the edit text is in the lower part of the screen and has to be raised by the soft keyboard. I already tried to add softInputWindowMode to adjustResize or adjustPan but this is not doing anything. The problem itself is a duplicate to this question Android Pie edittext does not adjustPan/resize while typing which still doesn't have an answer

Upvotes: 3

Views: 950

Answers (1)

Ahmet Pekmezci
Ahmet Pekmezci

Reputation: 33

The problem man be about hardwareAccelerated. I was having the same problem and waste too much time to solve before saw this page.

Android Pie edittext does not adjustPan/resize while typing

Upvotes: 3

Related Questions