Animate viewgroup without animating children?

You can't directly do what you're seeking to do with the old Android animation API. You've already noticed one limitation - that scaling the group also includes the children The second limitation is that the old Android animation API only affects the visual render of the item you're animating, and only for the time the animation is active. In other words, it doesn't actually alter the size or positioning of the item in question in terms of view layout.It only temporarily renders it a different way.

So for instance, to animate a button moving from x to y across the screen, you would need to run the animation, then when the animation completes actually reposition the button using the layout APIs Probably the way to do what you're looking for is: Incorporate an extra ViewGroup widget in your layout, positioned and sized over top the widget containing the "real" items. Initially, it's invisible Make it visible, and play the animation When animation complete, hide the extra widget, then resize your real ViewGroup widget via LayoutParams and add your extra items You'll probably need to tweak this general outline to make the effect look smooth.(For instance, resize the real viewgroup in the background before you remove the fake viewgroup from the screen) Android introduced a newer, more flexible animation API in 3.0 Honeycomb, but unfortunately it's not available if you're targeting 2. X devices (i.e.

, phones). Hopefully this will be easier once the new APIs are mainstream.

You can't directly do what you're seeking to do with the old Android animation API. You've already noticed one limitation - that scaling the group also includes the children. The second limitation is that the old Android animation API only affects the visual render of the item you're animating, and only for the time the animation is active.In other words, it doesn't actually alter the size or positioning of the item in question in terms of view layout.

It only temporarily renders it a different way. So for instance, to animate a button moving from x to y across the screen, you would need to run the animation, then when the animation completes actually reposition the button using the layout APIs. Probably the way to do what you're looking for is: Incorporate an extra ViewGroup widget in your layout, positioned and sized over top the widget containing the "real" items.

Initially, it's invisible. Make it visible, and play the animation. When animation complete, hide the extra widget, then resize your real ViewGroup widget via LayoutParams and add your extra items.

You'll probably need to tweak this general outline to make the effect look smooth. (For instance, resize the real viewgroup in the background before you remove the fake viewgroup from the screen). Android introduced a newer, more flexible animation API in 3.0 Honeycomb, but unfortunately it's not available if you're targeting 2.

X devices (i.e. , phones). Hopefully this will be easier once the new APIs are mainstream.

Thanks for the informative answer, thumbs up! However, I am targeting this specific application to tablets so I can definently use the new animation framework. Would be really helpfull if you could point me into the direction of solving this problem with the honeycomb apis :) – Emil Sjölander Jun 29 at 18:17 Wish I could help you, but I'm not an expert with the new Honeycomb APIs.My app supports phones and tablets with one APK, and so I'm stuck coding to lowest common denominator.

But to get started with the Honeycomb APIs, check out these articles from the Google Android team: android-developers.blogspot. Com/2011/02/… and android-developers.blogspot.Com/2011/05/… – mportuesisf Jun 29 at 18:21 thankyou very much :) – Emil Sjölander Jun 29 at 18:22.

(For instance, resize the real viewgroup in the background before you remove the fake viewgroup from the screen). Android introduced a newer, more flexible animation API in 3.0 Honeycomb, but unfortunately it's not available if you're targeting 2. X devices (i.e.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions