Search code examples
androiduser-interfaceandroid-toolbarlayout-animation

How To Make An Edit Text Float on top of toolbar and Main Layout


I want to achieve this kind of design enter image description here

As you can see the Edit text performs a nice animation to translate from the middle of the screen to the Top of the layout but i would like to know how achieve this.

I was thinking about wrapping the edit text inside a LinearLayout and when the Edit text reachs the Top the bacground just change to a gradient (white and yellow). Does that make sense??


Solution

  • I'd recommend using creating a fragment with CardView as parent and EditText as child and then animating it along with the background.

    Check this site to get a head start to animating fragments http://cyrilmottier.com/2014/05/20/custom-animations-with-fragments/