Keep field hint visible when typing

2

In some applications like the ones shown below, hint is not hidden when you start typing in the field. In Gmail, it looks like the From and To fields do not use hint are a combination of layout + style. The second example is from the Organizze application that does not seem to use the Gmail approach, but hint. How to implement this feature?

Gmail:

Organize:

    
asked by anonymous 05.09.2015 / 22:17

1 answer

3

Use TextInputLayout is from Google. When the user types something, hint goes up and becomes title .

<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <EditText
        android:id="@+id/nome"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/texto_nome"
        android:inputType="text"/>
</android.support.design.widget.TextInputLayout>
    
13.12.2016 / 14:03