Skip to content

Commit 83ca5fb

Browse files
committed
just some update
1 parent 7dc5a51 commit 83ca5fb

2 files changed

Lines changed: 18 additions & 20 deletions

File tree

‎notes/Android动画:Animation篇.md‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,17 @@ https://developer.android.com/reference/android/view/animation/AnimationSet.html
6363

6464
研究动画,如何实现,应该对其原理进行分析才对。
6565

66-
## 自定义 Animation
67-
68-
[Android之自定义Animation动画](http://www.apkbus.com/blog-104974-52806.html)
66+
跟 View 的绘制原理有关,需要了解。
6967

70-
http://www.cnblogs.com/wondertwo/p/5295976.html
68+
Android 动画框架详解:https://www.ibm.com/developerworks/cn/opensource/os-cn-android-anmt1/
7169

72-
为什么一定是重写 initialize 和 applyTransformation 两个函数?从何处得知
70+
## 自定义 Animation
7371

74-
先搞定如何继承那两个函数来实现自定义动画效果的问题
72+
http://www.cnblogs.com/wondertwo/p/5295976.html
7573

76-
再通过 加断点 和 打Log 来调试,验证整个动画的实现流程。
74+
矩阵知识,以及矩阵生成的XY轴的图如何展示(有什么工具可以画出来吗)Python http://liam0205.me/2014/09/11/matplotlib-tutorial-zh-cn/
7775

78-
矩阵知识,以及矩阵生成的XY轴的图如何展示(有什么工具可以画出来吗)
76+
这些动画效果遵循的数学公式是什么?????
7977

8078
## 关于 Matrix
8179

@@ -85,12 +83,8 @@ Matrix 是一个 3 X 3 的矩阵
8583

8684
详细介绍 Android Matrix 矩阵的文章:
8785

88-
Android Matrix理论与应用详解 http://zensheno.blog.51cto.com/2712776/513652
89-
90-
Android Matrix:http://www.cnblogs.com/qiengo/archive/2012/06/30/2570874.html
91-
86+
Android Matrix矩阵详解:http://www.maplejaw.com/2016/06/21/Android-Matrix%E7%9F%A9%E9%98%B5%E8%AF%A6%E8%A7%A3/index.html
9287

93-
http://liam0205.me/2014/09/11/matplotlib-tutorial-zh-cn/
94-
95-
http://www.cnblogs.com/rustfisher/p/5071494.html
88+
Android Matrix理论与应用详解 http://zensheno.blog.51cto.com/2712776/513652
9689

90+
Android Matrix:http://www.cnblogs.com/qiengo/archive/2012/06/30/2570874.html(透视那块,既然文档没有提,那就稍作解释然后忽略即可)

‎src/main/java/com/clock/study/animation/SimpleCustomAnimation.java‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public void initialize(int width, int height, int parentWidth, int parentHeight)
2525
super.initialize(width, height, parentWidth, parentHeight);
2626
this.mWidth = width;
2727
this.mHeight = height;
28-
setFillAfter(true);
29-
setDuration(15000);
28+
/*setFillAfter(true);
29+
setDuration(15000);*/
3030
}
3131

3232
@Override
@@ -39,10 +39,14 @@ protected void applyTransformation(float interpolatedTime, Transformation t) {
3939
//matrix.setSkew(0, interpolatedTime * 2);
4040
//matrix.setTranslate(0, (float) Math.sin(interpolatedTime * 80) * 10);
4141
//matrix.setScale(interpolatedTime * 1, interpolatedTime * 1, mWidth / 2, mHeight / 2);//线性缩放
42-
float[] data = new float[9];
42+
/*float[] data = new float[9];
4343
matrix.getValues(data);
44-
data[Matrix.MPERSP_0] = interpolatedTime * 1;
45-
matrix.setValues(data);
44+
data[Matrix.MPERSP_1] = interpolatedTime * 1;
45+
matrix.setValues(data);*/
46+
matrix.preScale(interpolatedTime, interpolatedTime, mWidth / 2, mHeight / 2);
47+
matrix.preRotate(interpolatedTime * 360, mWidth / 2, mHeight / 2);
48+
matrix.preTranslate(-mWidth / 3, -mHeight / 2);
49+
matrix.postTranslate(mWidth, mHeight);
4650
Log.i(TAG, "-------------applyTransformation-------------");
4751
Log.i(TAG, "interpolatedTime:" + interpolatedTime);//动画持续的时间,时间比例系数(0.0 到 1.0)之间
4852
Log.i(TAG, "transformation:" + t);//控制动画效果,Transformation包含两个信息,一个Alpha值,一个Matrix矩阵,这里的Matrix默认是一个单位矩阵

0 commit comments

Comments
 (0)