Android: how to change a low quality image to the hi quality one when the animation stops in gallery?
I want 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?
Asked by: Joyce118 | Posted: 24-01-2022
Answer 1
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);
Answered by: Joyce892 | Posted: 25-02-2022
Similar questions
Android: how to hide and then show View with animation effect?
I have similar question like this one: Update layout with the animation
Basically: I have one vertical LinearLayout View with edittext, button and then list. I'd like to hide exittext after pressing button to make more space for list (button will go up). On second press edittext should be visible again. Edittext and button ha...
java - Android Button Doesn't Respond After Animation
I have a basic animation of a button after it is pressed currently in my application. After the button finishes animating, I can no longer click on it. It doesn't even press with an orange highlight.
Any help?
Here's my code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
animation = new AnimationSet(true);
animation.setF...
android - How to avoid memory leaks in frame animation?
I've created simple test app with one activity. The activity contains frame animation. The total size of images in frame animation(riffle_forward_anim) is about 1MB. Here is the code I use to load animation:
public class MainScreen extends Activity {
/** Called when the activity is first created. */
private ImageView imgForward;
private ImageVi...
Android Frame Animation
I would like to know if it is possible to remove one of the frames I added using addFrame in Android?
Thanks
Kelvin
Android slide animation problem
I have a 3 horizontal views - an image on the left which is a thin vertical handle-type bar and an image to its right followed by a textview. What I'm trying to achieve is a sliding animation, activated with a click on the handle, so that the center image slides in and out to the left (and so disappearing when fully left) with the textview following this animation smoothly. The effect will be the handle remains in place (h...
How to do 'busy' animation in Android?
Doesn't seem to be covered in the books Ive looked at.
Showing animation to call function in android
Is it possible to show any animation when I call a function in same class in android?
In my application, I called a function "doAddition" so many times. And I want whenever I call this function, it shows some animation.
Thank you
animation - Android - Skewed button
is it possible to create a skewed shape button?
(i.e like a stripe shape from bottom left of screen to top right of screen instead of the regular square or rectangle shape button)?
Something like this image http://www.codeproject.com/KB/silverlight/SilverLightFAQPart2/9.JPG
And I need to make sure the...
listview - Android Animation for all the items in a list
i have a listView which uses a custom .xml for showing each item.
Fine, in this xml i have a CheckBox (with visibility set GONE) and a TextView with a text.
What i want is have an animation which moves the text to the right and shows the CheckBox.
I have the animation working fine for one item, but if i want to start it for all the items the problem comes.
I've tried with a loop over all th...
android - Animation resetting view state?
i am trying to do some simple animation, i have list with items, those items include also checkboxes
on a checkbox button click i want to show with animation some button from the buttom, something like this:
private int mPosition;
private CheckBox chkBox;
OnItemClickListener(CheckBox mChkBox, View v)
{
chkBox = mChkBox;
chkBox.setClickable(false);
chkBox.se...
animation - How do you drop a pin on a MapView in Android?
I can locate the pin for corresponding locations in MapView. I want to animate that pin dropping down onto the map.
How to use animation for that? Any ideas?
Still can't find your answer? Check out these communities...
Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android