The added EditText is not a TextInputEditText. Instead, switch to using this class

I use EditText inside TextInputLayout , but after updating the support library to 23.2.0 I get this warning in logcat. What is the difference between regular EditText and TextInputEditText ? I can't seem to find the documentation.

+67
android android-layout android-edittext android-support-library android-textinputlayout
03 Mar. '16 at 15:13
source share
4 answers

I was also interested, Daniel Wilson collected the documentation, but for the unprepared eye, this does not mean much. Here's what it means: β€œextraction mode” refers to the type of view that is displayed when the space is too small, such as the landscape on the Phone. I am using Galaxy S4 with Google Keyboard as IME.

Landscape interface without visible IME

Based on the focus (in the description), you can see the TextInputLayout in action by clicking a hint outside the editor. Nothing special here, this is what TextInputLayout should do.

Landscape interface without visible IME

Editing landscape user interface with empty name field

By editing the name, you can see that the IME does not give you a hint that you are editing.

Editing landscape user interface with empty name field

Editing landscape user interface empty Description field

As you edit the description, you can see that the IME gives you a hint of what you are editing.

Editing landscape user interface empty Description field

Layout Layouts

The difference between the two fields is their type EditText VS TextInputEditText . The important thing is that TextInputLayout has android:hint , not wrapped EditText, this is the case when TextInputEditText several lines of Java code are of great importance.

Name field

 <android.support.design.widget.TextInputLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Item Name" > <EditText android:id="@+id/name" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </android.support.design.widget.TextInputLayout> 

Description field

 <android.support.design.widget.TextInputLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Item Description" > <android.support.design.widget.TextInputEditText android:id="@+id/description" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="textMultiLine" android:minLines="4" android:scrollbars="vertical" /> </android.support.design.widget.TextInputLayout> 
+84
Mar 28 '16 at 18:53
source share

There is no documentation for this, but the class is a regular EditText with one additional function:

Using this class allows you to display the tooltip in IME in "extract" mode.

In particular, it installs EditorInfo.hintText . You will notice that in the TextInputLayout class you can specify the tooltip and its appearance, and not as part of the EditText child widget.

If you need to do this, you should use a TextInputEditText , so it pays attention to the hint information provided in the TextInputLayout .

+26
Mar 04 '16 at 18:19
source share

They are essentially the same thing, but I think that TextInputEditText has more features and possibly attributes. I changed to TextInputEditText , and everything worked and looked like before with the standard EditText .

+4
Mar 03 '16 at 15:15
source share

This question is old, however, I had this problem and just delete this line in my XML file: android: fitsSystemWindows = "true" and the error went away.

0
Jul 05 '17 at 23:45
source share



All Articles