Android: how to change a low quality image to the hi quality one when the animation stops in gallery?
I want 开发者_StackOverflow中文版to do an image gallery like in iphone. I want to show low quality (pre-resized) images and when the image is active I want to process the big image and show the result in the gallery.
I have two questions. How to attach a listener on the animation stop in gallery? And how to access an image after this action?
You can set an AnimationListener on your animation, and override the onAnimationEnd method.
From http://www.roosmaa.net/animation-ended-callback/ :
ImageView viewN = ..;
Animation animN = ...;
Drawable myNewDrawable = ...;
animN.setAnimationListener(new AnimationListener() {
// ...
void onAnimationEnd(Animation anim)
{
//Do your work here.
viewN.setDrawable(myNewDrawable);
return;
}
// ...
});
viewN.startAnimation(animN);
精彩评论