开发者

Slideshow in android

开发者 https://www.devze.com 2023-01-20 18:02 出处:网络
I am seeking some pointers开发者_运维百科 on how to create a sideshow application in Android.I need to have the Android transition animation when I switch between the images.You can fade the images in

I am seeking some pointers开发者_运维百科 on how to create a sideshow application in Android. I need to have the Android transition animation when I switch between the images.


You can fade the images in and out (or probably use other transitions) using the Animation classes in Android. Here is something which I use

Animation animation = new AlphaAnimation(1.0f, 0.0f);
animation.setDuration(100);
animation.setRepeatCount(0);
animation.setFillAfter(true); 
myView.startAnimation(animation)

Then load the other image when this completes. You can use an AnimationListener to detect the animation end.

After the animation do the same thing but reverse the alpha values in AlphaAnimation.

0

精彩评论

暂无评论...
验证码 换一张
取 消