Advertisement
Guest User

Untitled

a guest
May 13th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. mAnimationFadeIn = AnimationUtils.loadAnimation(this, R.anim.fade_in);
  2. mAnimationFadeIn.setFillAfter(true);
  3. mAnimationFadeOut = AnimationUtils.loadAnimation(this, R.anim.fade_out);
  4. mAnimationFadeOut.setFillAfter(true);
  5. mAnimationScaleIn = AnimationUtils.loadAnimation(this, R.anim.slow_scale_in);
  6. mAnimationScaleIn.setFillAfter(true);
  7. mAnimationScaleIn.setFillEnabled(true);
  8. mAnimationScaleIn.setFillBefore(false);
  9. mAnimationScaleIn.setAnimationListener(new AnimationListener() {
  10.  
  11. @Override
  12. public void onAnimationStart(Animation animation) {}
  13.  
  14. @Override
  15. public void onAnimationRepeat(Animation animation) {}
  16.  
  17. @Override
  18. public void onAnimationEnd(Animation animation) {
  19. mImageView.startAnimation(mAnimationFadeOut);
  20. }
  21. });
  22.  
  23. mAnimationFadeOut.setAnimationListener(new AnimationListener() {
  24.  
  25. @Override
  26. public void onAnimationStart(Animation animation) {}
  27.  
  28. @Override
  29. public void onAnimationRepeat(Animation animation) {}
  30.  
  31. @Override
  32. public void onAnimationEnd(Animation animation) {
  33. mImageView.setImageResource(mImages[++mImageIndex > 2 ? mImageIndex=0 : mImageIndex]);
  34. mImageView.startAnimation(mAnimationFadeIn);
  35. }
  36. });
  37.  
  38. mAnimationFadeIn.setAnimationListener(new AnimationListener() {
  39.  
  40. @Override
  41. public void onAnimationStart(Animation animation) {}
  42.  
  43. @Override
  44. public void onAnimationRepeat(Animation animation) {}
  45.  
  46. @Override
  47. public void onAnimationEnd(Animation animation) {
  48. mImageView.startAnimation(mAnimationScaleIn);
  49. }
  50. });
  51.  
  52. mImageView.startAnimation(mAnimationScaleIn);
  53.  
  54. <?xml version="1.0" encoding="utf-8"?>
  55. <scale xmlns:android="http://schemas.android.com/apk/res/android"
  56. android:fillAfter="true"
  57. android:duration="9000"
  58. android:fromXScale="1.0"
  59. android:fromYScale="1.0"
  60. android:interpolator="@android:anim/linear_interpolator"
  61. android:pivotX="50.0%"
  62. android:pivotY="50.0%"
  63. android:toXScale="1.1"
  64. android:toYScale="1.1" />
  65.  
  66. <?xml version="1.0" encoding="utf-8"?>
  67. <alpha xmlns:android="http://schemas.android.com/apk/res/android"
  68. android:duration="1000"
  69. android:fromAlpha="0.0"
  70. android:interpolator="@android:anim/linear_interpolator"
  71. android:toAlpha="1.0" />
  72.  
  73. <?xml version="1.0" encoding="utf-8"?>
  74. <alpha xmlns:android="http://schemas.android.com/apk/res/android"
  75. android:duration="1000"
  76. android:fromAlpha="1.0"
  77. android:interpolator="@android:anim/linear_interpolator"
  78. android:toAlpha="0.0" />
  79.  
  80. <?xml version="1.0" encoding="UTF-8"?>
  81. <set android:shareInterpolator="false"
  82. android:fillEnabled="true"
  83. android:fillAfter="true"
  84. xmlns:android="http://schemas.android.com/apk/res/android">
  85.  
  86. <rotate
  87. xmlns:android="http://schemas.android.com/apk/res/android"
  88. android:fromDegrees="0"
  89. android:toDegrees="359"
  90. android:pivotX="50%"
  91. android:fromXScale="1.0"
  92. android:toXScale="1.4"
  93. android:fromYScale="1.0"
  94. android:toYScale="1.4"
  95. android:pivotY="50%"
  96. android:fillAfter="true"
  97. android:fillEnabled="true"
  98. android:duration="2000" />
  99.  
  100. <scale
  101. android:interpolator="@android:anim/accelerate_decelerate_interpolator"
  102. android:fromXScale="1.0"
  103. android:toXScale="1.4"
  104. android:fromYScale="1.0"
  105. android:toYScale="1.4"
  106. android:pivotX="50%"
  107. android:pivotY="50%"
  108. android:fillEnabled="true"
  109. android:fillAfter="true"
  110. android:duration="2000" />
  111.  
  112. </set>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement