Guest User

Untitled

a guest
Aug 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. Add delay to While loop for animation to complete
  2. if(viewFlipper.getDisplayedChild()!=0 || viewFlipper.getDisplayedChild()> 0 ){
  3. do
  4. {
  5. viewFlipper.setInAnimation(slideRightIn);
  6. viewFlipper.setOutAnimation(slideRightOut);
  7. viewFlipper.showPrevious();
  8. //Delay need here to allow animation to complete
  9. } while (viewFlipper.getDisplayedChild()!=0);
  10. }
  11. //System.out.println("New Flipper "+viewFlipper.getDisplayedChild());
  12. break;
  13.  
  14. try {
  15. Thread.sleep(800);
  16. } catch (InterruptedException e) {
  17. // TODO Auto-generated catch block
  18. e.printStackTrace();
  19. }
  20.  
  21. slideRightIn.setAnimationListener(new AnimationListener() {
  22. public void onAnimationStart(Animation animation) {
  23.  
  24. }
  25.  
  26. public void onAnimationRepeat(Animation animation) {
  27.  
  28. }
  29.  
  30. public void onAnimationEnd(Animation animation) {
  31. // will be called when your animation is complete
  32. }
  33. });
Add Comment
Please, Sign In to add comment