Property Animation(属性动画)

 1     /**
 2      * 
 3      * @param view
 4      */
 5     private void getAnimations(View view) {
 6 
 7         ObjectAnimator.ofFloat(view, "aplha", 0f,
 8                 1f).setDuration(100).start();
 9         // ObjectAnimator tAnimator2 = ObjectAnimator.ofFloat(view, "scaleY",
10         // mZoomLevel);
11 
12         ObjectAnimator tAnimator3 = ObjectAnimator.ofFloat(view, "scaleX",
13                 mZoomLevel);
14         ObjectAnimator tAnimator4 = ObjectAnimator.ofFloat(view, "scaleY",
15                 mZoomLevel);
16 
17         AnimatorSet tAnimatorSet = new AnimatorSet();
18         tAnimatorSet.setDuration(1);
19 
20         tAnimatorSet.playTogether(tAnimator3, tAnimator4);
21         tAnimatorSet.start();
22     }
23 
24     /**
25      * 初始化View
26      * 
27      * @param view
28      */
29     private void initView(View view) {
30 
31         ObjectAnimator tAnimator1 = ObjectAnimator.ofFloat(view, "pivotX", 0f);
32         ObjectAnimator tAnimator2 = ObjectAnimator.ofFloat(view, "pivotY", 0f);
33 
34         ObjectAnimator tAnimator3 = ObjectAnimator.ofFloat(view, "scaleX",
35                 (float) mViewVsScrAmpMul);
36         ObjectAnimator tAnimator4 = ObjectAnimator.ofFloat(view, "scaleY",
37                 (float) mViewVsScrAmpMul);
38 
39         AnimatorSet tAnimatorSet = new AnimatorSet();
40         tAnimatorSet.setDuration(1);
41         tAnimatorSet.playTogether(tAnimator1, tAnimator2, tAnimator3,
42                 tAnimator4);
43 
44         tAnimatorSet.start();
45     }
原文地址:https://www.cnblogs.com/zx-blog/p/11835859.html