Imagine that I have a toolbar implemented as a horizontal LinearLayout as follows:
[___Button1____] [___Button2___] [___Button3___] [___Button4___]
When someone clicks Button2, I want the toolbar to change to:
[___Button1____] [___________Button2___________] [___Button3___]
The toolbar should transition from the first state to the second state through smooth animation. I would like to use the scale animation on Button2, and although this happens, Button3 and Button 4 should move to the right (while the animation continues). At the end of the animation (or perhaps during) I fade Button4 out.
Question: How to achieve animation of the toolbar layout in such a way that only one component (i.e. Button2) is scaled, while others do not scale - the layout is simply updated during the Button2 animation.
I looked at the LayoutAnimationController, but it doesn’t seem to allow me to: 1. specify different animations for different components, OR 2. indicate that only one component is animated and does not animate the others.
I cannot scale the entire toolbar because it distorts Button1 / 3/4, which I don't want.
Any thoughts on how to do this?
Navin source
share