Synchronized animations on multiple views

1,642 views
Skip to first unread message

Sanra

unread,
Jul 31, 2010, 8:44:40 AM7/31/10
to android-platform
Is it possible to do to animate multiple views at the same time with
each view doing some increment of tween animation? Basically I want
to apply some transformations to child views but not sequentially,
they should all do the transition frame by frame. Any suggestions on
how to achieve this ?

Thanks,
Sandy

Romain Guy

unread,
Jul 31, 2010, 2:08:22 PM7/31/10
to android-...@googlegroups.com
All animations within a single window are guaranteed to be synchronized.

> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>

--
Romain Guy
Android framework engineer
roma...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

Sanra

unread,
Aug 20, 2010, 4:14:32 AM8/20/10
to android-platform, romai...@android.com
Thanks Romain.

I'm interested in animating the resize of children views in a
ViewGroup. Basically the child views smoothly resize to new size
instead of a scale animation which does not scale the contents (for ex
images) uniformly (maintain the image's aspect ratio) in child views .
I could not find any way to do this with the animation framework so
I'm exploring the option to calculate the new bounds of the child view
and its contents to preserve the aspect ratio of its image drawables
and running an interpolator that calls requestLayout() at each
animation step and then inside onLayout() calculate where we should
lay out the children based on the animation's progress. Another option
which is a slight variation of above approach is to modify the bounds
of the child view at each step of the animation inside the drawChild()
method of the ViewGroup based on animation's progress.

Is this the only good way to do this with the current releases of
android? or is there a better solution to achieve resize animation?
If not, are there any enhancement requests in the pipeline for the
gingerbread release?

Thanks,
Sandy

On Jul 31, 1:08 pm, Romain Guy <romain...@android.com> wrote:
> All animations within a single window are guaranteed to be synchronized.
>
>
>
>
>
> On Sat, Jul 31, 2010 at 5:44 AM, Sanra <snarr...@gmail.com> wrote:
> > Is it possible to do to animate multiple views at the same time with
> > each view doing some increment of tween animation?  Basically I want
> > to apply some transformations to child views but not sequentially,
> > they should all do the transition frame by frame. Any suggestions on
> > how to achieve this ?
>
> > Thanks,
> > Sandy
>
> > --
> > You received this message because you are subscribed to the Google Groups "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/android-platform?hl=en.
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
Reply all
Reply to author
Forward
0 new messages