I have two animations in my project. One is a Translate animation,
which bounces a small picture up and down while an Internet resource
is loading. It is applied to two ImageViews, and they bounce up and
down together slowly. While these is happening, the Android's CPU is
completely pegged for some reason.
The Alpha animation is applied to the same 2 ImageViews, when the
pictures have been downloaded. It fades from completely transparent to
completely opaque, in half of a second. This animation apparently also
pegs the CPU, because the animation shows one half-faded frame and
then the final, opaque view.
Is there any way to make these animations faster or smoother? Am I
missing some big option somewhere, or what?
I tried an experiment, where instead of ImageViews I blitted directly
to a SurfaceView. These resulted in remarkable performance, but
terribly bad things happened if I tried to scroll the ScrollView that
my SurfaceViews are in.
Is there a better way to improve the speed of animations?

Thank you!

My loading animation:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android";
android:shareInterpolator="true">
        <translate android:interpolator="@android:anim/
accelerate_decelerate_interpolator"
                android:fromYDelta="0%p" android:toYDelta="-5%p"
                android:startOffset="0000" android:duration="2000"
                android:repeatCount="infinite" android:repeatMode="reverse" />
</set>

My fadein animation:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android";
android:shareInterpolator="true">
        <alpha
                android:fromAlpha="0" android:toAlpha="100"
                android:startOffset="0000" android:duration="500" />
</set>

The code to apply the loading animation
        Animation temp=AnimationUtils.loadAnimation
(getApplicationContext(), R.anim.loading);
        findViewById(R.id.LeftPic).setAnimation(temp);
        temp=AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.loading);
        temp.setStartOffset(200);
        findViewById(R.id.RightPic).setAnimation(temp);

The code to apply the fadein animation
                left.setAnimation(AnimationUtils.loadAnimation
(getApplicationContext(), R.anim.fadein));
                right.setAnimation(AnimationUtils.loadAnimation
(getApplicationContext(), R.anim.fadein));

-- 
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

Reply via email to