I have an AnimationSet that does 3 different animations.
After the animations end, I would like to pause the app for 3 secs, before everything snaps back to start position.
How do I do that ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you could probably achieve this effect somehow with an AnimationListener Set one to get a callback when your animation ends and add a delayed runnable that will move everything back to the proper position for you. However I think it might get somewhat convoluted to do it this way since it would require setting fillAfter to true, then manually placing your Views in their original position inside your Runnable thats gets posted with a delay.
I think a more straightforward solution to get the same effect is to simply add a 4th animation to your set that has a delay to make it start after all of the others are complete. Make this 4th animation last for 3 seconds, and make it have no visible effect (i.e. grow by 0%). That should build in a 3 second pause for you and still handle moving all of your Views back to their original position (without the need to do it manually). With this solution you’d leave fillAfter set to false, and that would cause your Views to “snap back”. By adding another animation that lasts for 3 seconds but has no visible effect it will seem like a pause to the user.