Reputation: 1697
HI alll..
Today i again came,,:-( actually i m little bit confused in animation set?? i have more than two or three animations how can i put them in animation set?
and one more thing this is very important..that my image is moving from one place to another through translate animation. but it is not showing the motion and looking like that the image was invisible there and after clicking its visible.. how can i show motion that image is moving from one place to another in translate animation.
Upvotes: 0
Views: 748
Reputation: 2496
here is the example if we have two png files
res/drawable-mdpi/usb_loading_1_2fps.png
res/drawable-mdpi/usb_loading_2_2fps.png
and then we make a animation blink_usb.xml
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/selected" android:oneshot="false">
<item android:drawable="@drawable/usb_loading_1_2fps" android:duration="300" />
<item android:drawable="@drawable/usb_loading_2_2fps" android:duration="300" />
</animation-list>
and then if we want to make an animation in notification
mBuilder = new Notification.Builder(getBaseContext());
mBuilder.setContent(mView);
mBuilder.setSmallIcon(R.drawable.blink_usb);
Upvotes: 0
Reputation: 126563
Supposing animation1 and animation2 are TranslateAnimations
AnimationSet set = new AnimationSet(true);
set.addAnimation(animation1);
set.addAnimation(animation2);
myImageView.startAnimation(set);
Upvotes: 1