Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText hint visibile while transition

In my app I'm using the Android Activity Slide transition. I followed a nice tutorial and everything works as expected except for the hint of my EditText, which is contained within an InputTextLayout:

<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/activity_vertical_margin">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:hint="Your name"/>
</android.support.design.widget.TextInputLayout>

All the components are nicely animated, but the hint just pops up before the animation starts and remains in the final position. Do I have to add some extra code to tell the framework to animate the hint, too?

According to the Android developer documentation it should work (or at least it's not unsupported).

I'm using version 22.2 of the Support Design Library.

It would be great if someone could point me in the right direction.

like image 891
Morosko Avatar asked Dec 23 '15 16:12

Morosko


2 Answers

Try this solution, it works for me:

When you have >1 TextInputLayouts, put TextInputLayouts into a container

inputTextPanel : LinearLayout
  TextInputLayout
    login : EditText
  TextInputLayout
    password : EditText

and in onCreateView:

setContentView(R.layout.login_layout)
configuration(fromSdk = 21) {
    inputTextPanel.isTransitionGroup = true
}

If you have only one, you can just

myTextInputLayout.isTransitionGroup = true
like image 156
cVoronin Avatar answered Oct 23 '22 02:10

cVoronin


This is a bug. I have been looking for a fix. The workaround i have used is to set hint of edittext as empty before animation and set edittext hint after animation completes. But i dont know if thats what you would like to do.

like image 1
Ragesh Ramesh Avatar answered Oct 23 '22 03:10

Ragesh Ramesh