Is there a way to animate layouts? [Android]?

Here is what I want to do.

Suppose I have a parent linear layout and 3 children.

{---------------- ++++++++++++++++ --------------}

"+" / "-" are layouts. What I want to do is:

{------ ++++++++++++++++++++++++++++++ -------} // 1st step

{+++++++++++++++++++++++++++++++++++++} // The second step.

Animate the + layout using layouts. The same end result as these 3 β€œfill_parrent” height layouts with weights and Setvisibility for β€œGone” for β€œ-” layouts, but animated

+7
android layout
source share
1 answer

You should look at http://developerlife.com/tutorials/?p=343 It gives very good examples of how to do something that you want. I managed to create moving the first layout up (it uses an example from left to right). Thus, you must move the first layout up, the third to the bottom and expand the middle layout after both have been completed.

The only difficulty is getting LayoutParams correctly so that everything stays the way you want it. In the end, you should have 3 animations: one that pushes the top layout on top, one of which performs the bottom and bottom, which extends the middle (if you don't want to animate it, you can just set LayoutParams as for FILL_PARENT

+9
source share

All Articles