Guest User

Untitled

a guest
Oct 20th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. <set xmlns:android="http://schemas.android.com/apk/res/android">
  2. <scale
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. android:fromXScale="1.0"
  5. android:toXScale="1.0"
  6. android:fromYScale="1.0"
  7. android:toYScale="2.0"
  8. android:pivotX="50%"
  9. android:pivotY="0%"
  10. android:duration="500">
  11. </scale>
  12.  
  13. <set
  14. xmlns:android="http://schemas.android.com/apk/res/android">
  15. <scale
  16. xmlns:android="http://schemas.android.com/apk/res/android"
  17. android:fromXScale="1.0"
  18. android:toXScale="2.0"
  19. android:fromYScale="1.0"
  20. android:toYScale="1.0"
  21. android:pivotX="50%"
  22. android:pivotY="50%"
  23. android:duration="500">
  24. </scale>
  25. <translate
  26. xmlns:android="http://schemas.android.com/apk/res/android"
  27. android:fromXDelta="0%p"
  28. android:toXDelta="-44.5%p"
  29. android:fromYDelta="0"
  30. android:toYDelta="0"
  31. android:duration="500">
  32. </translate>
  33.  
  34. @Override
  35. public void onClick(View v) {
  36. back = 2;
  37.  
  38. animationLay = AnimationUtils.loadAnimation(this, R.anim.toolbar_up);
  39. layoutDelete.startAnimation(animationLay);
  40.  
  41. animationImg = AnimationUtils.loadAnimation(this, R.anim.delete);
  42. imgDelete.startAnimation(animationImg);
  43.  
  44.  
  45. animationImg.setAnimationListener(new Animation.AnimationListener() {
  46. @Override
  47. public void onAnimationStart(Animation animation) {
  48. Log.i(TAG, "onAnimationStart");
  49. }
  50.  
  51. @Override
  52. public void onAnimationEnd(Animation animation) {
  53. Log.i(TAG, "onAnimationEnd");
  54.  
  55. ViewGroup.LayoutParams l = imgDelete.getLayoutParams();
  56. int w = imgDelete.getWidth();
  57. int h = imgDelete.getHeight();
  58. l.height = w + w;
  59. l.width = h + h;
  60. imgDelete.setLayoutParams(l);
  61.  
  62. layoutDelete.setGravity(Gravity.CENTER);
  63. }
  64.  
  65. @Override
  66. public void onAnimationRepeat(Animation animation) {
  67. Log.i(TAG, "onAnimationRepeat");
  68. }
  69. });
  70. }
  71.  
  72. @Override
  73. public void onAnimationEnd(Animation animation) {
  74. Log.i(TAG, "onAnimationEnd");
  75.  
  76. ViewGroup.LayoutParams l = imgDelete.getLayoutParams();
  77. int w = imgDelete.getWidth();
  78. int h = imgDelete.getHeight();
  79. l.height = w / 2;
  80. l.width = h / 2;
  81. imgDelete.setLayoutParams(l);
  82.  
  83. animation = new TranslateAnimation(0.0f, 0.0f, 0.0f, 0.0f);
  84. animation.setDuration(1);
  85. imgDelete.startAnimation(animation);
  86.  
  87. animation = new TranslateAnimation(0.0f, 0.0f, 0.0f, 0.0f);
  88. animation.setDuration(1);
  89. layoutDelete.startAnimation(animation);
  90.  
  91. layoutDelete.setGravity(Gravity.RIGHT);
  92.  
  93. }
Add Comment
Please, Sign In to add comment