Android: how to change a low quality image to high quality when the animation stops in the gallery?

I want to make a gallery of images, for example, in iphone. I want to display images with low quality (pre-modified), and when the image is active, I want to process a large image and show the result in the gallery.

I have two questions. How to connect a listener to the animation stop in the gallery? And how to access the image after this step?

+4
source share
1 answer

You can set the AnimationListener in 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); 
0
source

Source: https://habr.com/ru/post/1299234/


All Articles