Hello everyone,
I've had trouble finding good documentation about animations in
Android, but I managed to get my animation working. What I'm worried
about the way I did it is efficiency/performance.
My goal was to have a cloud image move across the screen over and over
and repeat forever. To do this I ended up putting 2 identical
ImageViews positioned over each other and defining 2 animations:
cloud_slide_exit.xml:
<translate
android:fromYDelta="0"
android:toXDelta="-100%p"
android:duration="25000"
android:repeatCount="infinite"
android:repeatMode="restart"
/>
cloud_slide_enter.xml:
<translate
android:fromYDelta="0"
android:fromXDelta="100%p"
android:duration="25000"
android:repeatCount="infinite"
android:repeatMode="restart"
/>
I applied the first animation to "image1" and the second to "image2."
The first animation moves "image1" from right (on-screen) to left (off-
screen) while the second animation moves "image2" (which starts off
screen) from right (off-screen) to left (on-screen). The end result
when you view both animations is that the image moves across the
screen. When it reaches the left end of the screen it will start
coming from the right side of the screen. This is the only way I could
think of doing this.
Is there a more efficient way that only uses 1 ImageView? I'd like to
find a more efficient way b/c I actually have 3 clouds moving which
means that I would have 6 ImageViews total.
Thank you,
Marvin
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en