2

I notice in the hangouts app that the hint text in their TextView fields moves upward and reduces its size upon entry of the first character in the text fields.

When I specify hint text in a TextView, the hint text simply disappears upon entry in a text field.

Is the hangouts behavior using some a automatic feature of the TextView that I am not aware of, or are they just hard coding it?

Thanks, Dean EDIT: whoever labeled this as having been answered should consider the date of the answer. Those posts were back in 2014 and libraries have changed since that time.

Dean Blakely
  • 3,535
  • 11
  • 51
  • 83
  • 1
    Sounds like it's using [`TextInputLayout`](https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html). – Mike M. May 22 '16 at 23:47
  • Why don't you just put that in an answer @MikeM. before someone takes the credit. – Vucko May 22 '16 at 23:52
  • 1
    @Vucko I was looking for the duplicate I usually use for this. We really don't need this answered for the 10th time. :-) – Mike M. May 23 '16 at 00:07

1 Answers1

0

Android floating labels were introduced in android design support library to display a floating label over EditText. Initially, it acts as a hint in EditText when the field is empty. When user starts inputting the text, it starts animating by moving to floating label position.

That is a good example you can see:

http://www.androidhive.info/2015/09/android-material-design-floating-labels-for-edittext/

mohammad tofi
  • 207
  • 1
  • 3
  • 14
  • This looks like a good article although I need to use an autocomplete instead of an edittext. Thanks for the answer despite Mordac shutting off the thread! – Dean Blakely May 24 '16 at 15:27