├── .idea
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── cn
│ │ └── bluemobi
│ │ └── dylan
│ │ └── animationdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── cn
│ │ │ └── bluemobi
│ │ │ └── dylan
│ │ │ └── animationdemo
│ │ │ ├── MainActivity.java
│ │ │ ├── SecondActivity.java
│ │ │ └── adapter
│ │ │ ├── CommonAdapter.java
│ │ │ └── CommonViewHolder.java
│ └── res
│ │ ├── anim
│ │ ├── alpha.xml
│ │ ├── group2.xml
│ │ ├── push_left_in.xml
│ │ ├── push_left_out.xml
│ │ ├── push_right_in.xml
│ │ ├── push_right_out.xml
│ │ ├── rotate.xml
│ │ ├── scale.xml
│ │ ├── translate.xml
│ │ ├── zoom_in.xml
│ │ └── zoom_out.xml
│ │ ├── drawable
│ │ └── ring_animation.xml
│ │ ├── layout
│ │ ├── ac_second.xml
│ │ ├── activity_main.xml
│ │ └── item.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ ├── promb_voice.png
│ │ ├── promb_voice2.png
│ │ ├── promb_voice3.png
│ │ ├── windmill_1.JPG
│ │ ├── windmill_2.JPG
│ │ ├── windmill_3.JPG
│ │ ├── windmill_4.JPG
│ │ ├── windmill_5.JPG
│ │ ├── windmill_6.JPG
│ │ └── windmill_7.JPG
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── cn
│ └── bluemobi
│ └── dylan
│ └── animationdemo
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screenshorts
├── effect.gif
└── 示例图.jpg
├── screenshots
└── effect.gif
└── settings.gradle
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | >Android中常用的动画都在这里了,包含了基本的动画【透明度动画,缩放动画,旋转动画,位移动画】;还有就是这四种动画的组合实现;
2 | 还有布局动画,就是在加载布局时的动画;还有Activity跳转的动画。
3 | 效果图如下:
4 |
5 | 
6 |
7 | #1. Android基础动画
8 |
9 | * 透明度动画
10 |
11 | ```xml
12 |
13 |
14 |
19 |
20 | ```
21 |
22 | ```java
23 | /**
24 | * 第一个参数fromAlpha为 动画开始时候透明度
25 | *第二个参数toAlpha为 动画结束时候透明度
26 | */
27 | Animation animation = new AlphaAnimation(0, 1);
28 | animation.setDuration(1000);
29 | v.startAnimation(animation);
30 | ```
31 |
32 | * 缩放动画
33 |
34 | ```xml
35 |
36 |
37 |
45 |
46 | ```
47 |
48 | ```java
49 | /**
50 | * 第一个参数fromX为动画起始时 X坐标上的伸缩尺寸
51 | * 第二个参数toX为动画结束时 X坐标上的伸缩尺寸
52 | * 第三个参数fromY为动画起始时Y坐标上的伸缩尺寸
53 | * 第四个参数toY为动画结束时Y坐标上的伸缩尺寸
54 | * 说明: 0.0表示收缩到没有;1.0表示正常无伸缩;值小于1.0表示收缩;值大于1.
55 | * 第五个参数pivotXType为动画在X轴相对于物件位置类型
56 | * 第六个参数pivotXValue为动画相对于物件的X坐标的开始位置
57 | * 第七个参数pivotXType为动画在Y轴相对于物件位置类型
58 | * 第八个参数pivotYValue为动画相对于物件的Y坐标的开始位置
59 | */
60 | Animation animation = new ScaleAnimation(0, 1
61 | animation.setDuration(1000);
62 | iv.startAnimation(animation);
63 | ```
64 |
65 | * 旋转动画
66 |
67 | ```xml
68 |
69 |
70 |
76 |
77 | ```
78 |
79 | ```java
80 | /**
81 | * 第一个参数fromDegrees为动画起始时角度
82 | * 第二个参数toDegrees为动画结束角度
83 | * 第三个参数pivotXType为动画在X轴相对于物件位置类型
84 | * 第四个参数pivotXValue为动画相对于物件的X坐标的开始位置
85 | * 第五个参数pivotXType为动画在Y轴相对于物件位置类型
86 | * 第六个参数pivotYValue为动画相对于物件的Y坐标的开始位置
87 | */
88 | Animation animation = new RotateAnima
89 | animation.setDuration(1000);
90 | iv.startAnimation(animation);
91 | ```
92 |
93 |
94 | * 位移动画
95 |
96 | ```xml
97 |
98 |
99 |
106 |
107 | ```
108 |
109 | ```java
110 | /**
111 | * 第一个参数fromDegrees为动画起始时角度
112 | * 第二个参数toDegrees为动画结束角度
113 | * 第三个参数pivotXType为动画在X轴相对于物件位置类型
114 | * 第四个参数pivotXValue为动画相对于物件的X坐标的开始位置
115 | * 第五个参数pivotXType为动画在Y轴相对于物件位置类型
116 | * 第六个参数pivotYValue为动画相对于物件的Y坐标的开始位置
117 | */
118 | Animation animation = new RotateAnima
119 | animation.setDuration(1000);
120 | iv.startAnimation(animation);
121 | /**
122 | * 第一个参数fromXDelta为动画起始时的x坐标
123 | * 第二个参数toXDelta为动画结束时的x坐标
124 | * 第三个参数fromYDelta为动画起始时的y坐标
125 | * 第四个参数toYDelta为动画结束时的y坐标
126 | */
127 | Animation animation = new Translat
128 | animation.setDuration(2000);
129 | /**设置插值器:先加速,后减速**/
130 | animation.setInterpolator(new Acce
131 | iv.startAnimation(animation);
132 | ```
133 | #2.组合动画
134 |
135 | * 先播放缩放动画,完成后播放旋转动画
136 |
137 | ```java
138 | Animation animation = AnimationUtils.loadAnimation(this, R.anim.scale);
139 | iv.startAnimation(animation);
140 | final Animation animation2 = AnimationUtils.loadAnimation(this, R.anim.rotate);
141 | animation.setAnimationListener(new Animation.AnimationListener() {
142 | @Override
143 | public void onAnimationStart(Animation animation) {
144 |
145 | }
146 |
147 | @Override
148 | public void onAnimationEnd(Animation animation) {
149 |
150 | iv.startAnimation(animation2);
151 | }
152 |
153 | @Override
154 | public void onAnimationRepeat(Animation animation) {
155 |
156 | }
157 | });
158 | ```
159 |
160 | * 先播放旋转动画,完成后播放位移动画,在xml中设置第二个动画执行的等待时间
161 |
162 | ```xml
163 |
164 |
165 |
166 |
172 |
180 |
181 | ```
182 |
183 | * 重复的透明度动画-闪烁
184 |
185 | ```java
186 | AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f);
187 | alphaAnimation.setDuration(1000);
188 | alphaAnimation.setRepeatCount(10);
189 | /**倒序重复REVERSE 正序重复RESTART**/
190 | alphaAnimation.setRepeatMode(Animation.REVERSE);
191 | iv.startAnimation(alphaAnimation);
192 | ```
193 |
194 | * 重复的位移动画-抖动
195 |
196 | ```java
197 | Animation translateAnimation = new TranslateAnimation(-10, 10, 0, 0);
198 | translateAnimation.setDuration(100);
199 | translateAnimation.setRepeatCount(10);
200 | /**倒序重复REVERSE 正序重复RESTART**/
201 | translateAnimation.setRepeatMode(Animation.REVERSE);
202 | iv.startAnimation(translateAnimation);
203 | ```
204 |
205 | #3.帧动画
206 |
207 | * 在drawable文件夹下建立文件
208 |
209 | ```xml
210 |
211 |
213 | -
215 |
216 | -
218 |
219 | -
221 |
222 | -
224 |
225 | -
227 |
228 | -
230 |
231 | -
233 |
234 |
235 |
236 |
237 | ```
238 | * 在activity中调用
239 |
240 | ```java
241 | iv.setImageResource(R.drawable.ring_animation);
242 | AnimationDrawable animationDrawable = (AnimationDrawable) iv.getDrawable();
243 | animationDrawable.start();
244 | ```
245 | #4.布局动画
246 | 这是一个ListView的加载布局动画
247 |
248 | * 先建立动画文件,从透明到不透明并且大小从0到原大小
249 |
250 | ```xml
251 |
252 |
254 |
255 |
263 |
267 |
268 | ```
269 |
270 | * 在activity中的用法
271 |
272 | ```java
273 | ListView listView = (ListView) findViewById(R.id.listview);
274 | List datas = new ArrayList<>();
275 | for (int i = 0; i < 18; i++) {
276 | datas.add("万能适配器测试" + i);
277 | }
278 | LayoutAnimationController layoutAnimationController= new LayoutAnimationController(AnimationUtils.loadAnimation(this, R.anim.zoom_in));
279 | layoutAnimationController.setOrder(LayoutAnimationController.ORDER_NORMAL);
280 | listView.setLayoutAnimation(layoutAnimationController);
281 | listView.setAdapter(new CommonAdapter(this, datas, R.layout.item) {
282 |
283 | @Override
284 | protected void convertView(View item, String s) {
285 | TextView textView = CommonViewHolder.get(item, R.id.textView);
286 | textView.setText(s);
287 | }
288 | });
289 | ```
290 | #5.Activity跳转动画
291 |
292 | * 退出动画:从不透明到透明并且大小从原大小到0
293 |
294 | ```xml
295 |
296 |
299 |
300 |
308 |
309 |
313 |
314 |
315 | ```
316 |
317 | * 进入动画:从透明到不透明并且大小从0到原大小
318 |
319 | ```xml
320 |
321 |
323 |
324 |
332 |
336 |
337 | ```
338 |
339 | * 在Activity中的用法
340 |
341 | ```java
342 | startActivity(new Intent(this,SecondActivity.class));
343 | overridePendingTransition(R.anim.zoom_in,R.anim.zoom_out);
344 | ```
345 | #6.[GitHub](https://github.com/linglongxin24/AnimationDemo)
346 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "25.0.0"
6 | defaultConfig {
7 | applicationId "cn.bluemobi.dylan.animationdemo"
8 | minSdkVersion 9
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:25.0.0'
28 | testCompile 'junit:junit:4.12'
29 | }
30 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in E:\kejiang\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/cn/bluemobi/dylan/animationdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package cn.bluemobi.dylan.animationdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("cn.bluemobi.dylan.animatordemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/bluemobi/dylan/animationdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package cn.bluemobi.dylan.animationdemo;
2 |
3 | import android.content.Intent;
4 | import android.graphics.drawable.AnimationDrawable;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.view.animation.AccelerateDecelerateInterpolator;
9 | import android.view.animation.AlphaAnimation;
10 | import android.view.animation.Animation;
11 | import android.view.animation.AnimationUtils;
12 | import android.view.animation.Interpolator;
13 | import android.view.animation.LayoutAnimationController;
14 | import android.view.animation.RotateAnimation;
15 | import android.view.animation.ScaleAnimation;
16 | import android.view.animation.TranslateAnimation;
17 | import android.widget.ImageView;
18 | import android.widget.ListView;
19 | import android.widget.TextView;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | import cn.bluemobi.dylan.animationdemo.adapter.CommonAdapter;
25 | import cn.bluemobi.dylan.animationdemo.adapter.CommonViewHolder;
26 |
27 | public class MainActivity extends AppCompatActivity {
28 | private boolean fromXml = true;
29 | private ImageView iv;
30 |
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_main);
36 | iv = (ImageView) findViewById(R.id.iv);
37 | }
38 |
39 | public void onClick(View v) {
40 | iv.setImageResource(R.mipmap.ic_launcher);
41 | switch (v.getId()) {
42 | case R.id.animation_alpha://透明度渐变动画
43 | if (fromXml) {
44 | Animation animation = AnimationUtils.loadAnimation(this, R.anim.alpha);
45 | iv.startAnimation(animation);
46 | } else {
47 | /**
48 | * 第一个参数fromAlpha为 动画开始时候透明度
49 | *第二个参数toAlpha为 动画结束时候透明度
50 | */
51 | Animation animation = new AlphaAnimation(0, 1);
52 | animation.setDuration(1000);
53 | iv.startAnimation(animation);
54 | }
55 | break;
56 | case R.id.animation_scale://缩放动画
57 | if (fromXml) {
58 | Animation animation = AnimationUtils.loadAnimation(this, R.anim.scale);
59 | iv.startAnimation(animation);
60 | } else {
61 | /**
62 | * 第一个参数fromX为动画起始时 X坐标上的伸缩尺寸
63 | * 第二个参数toX为动画结束时 X坐标上的伸缩尺寸
64 | * 第三个参数fromY为动画起始时Y坐标上的伸缩尺寸
65 | * 第四个参数toY为动画结束时Y坐标上的伸缩尺寸
66 | * 说明: 0.0表示收缩到没有;1.0表示正常无伸缩;值小于1.0表示收缩;值大于1.0表示放大
67 |
68 | * 第五个参数pivotXType为动画在X轴相对于物件位置类型
69 | * 第六个参数pivotXValue为动画相对于物件的X坐标的开始位置
70 | * 第七个参数pivotXType为动画在Y轴相对于物件位置类型
71 | * 第八个参数pivotYValue为动画相对于物件的Y坐标的开始位置
72 | */
73 | Animation animation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
74 | animation.setDuration(1000);
75 | iv.startAnimation(animation);
76 | }
77 | break;
78 | case R.id.animation_rotate://旋转动画
79 | if (fromXml) {
80 | Animation animation = AnimationUtils.loadAnimation(this, R.anim.rotate);
81 | iv.startAnimation(animation);
82 | } else {
83 | /**
84 | * 第一个参数fromDegrees为动画起始时角度
85 | * 第二个参数toDegrees为动画结束角度
86 | * 第三个参数pivotXType为动画在X轴相对于物件位置类型
87 | * 第四个参数pivotXValue为动画相对于物件的X坐标的开始位置
88 | * 第五个参数pivotXType为动画在Y轴相对于物件位置类型
89 | * 第六个参数pivotYValue为动画相对于物件的Y坐标的开始位置
90 | */
91 | Animation animation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
92 | animation.setDuration(1000);
93 | iv.startAnimation(animation);
94 | }
95 | break;
96 | case R.id.animation_translate://位移动画
97 | if (fromXml) {
98 | Animation animation = AnimationUtils.loadAnimation(this, R.anim.translate);
99 | iv.startAnimation(animation);
100 | } else {
101 | /**
102 | * 第一个参数fromXDelta为动画起始时的x坐标
103 | * 第二个参数toXDelta为动画结束时的x坐标
104 | * 第三个参数fromYDelta为动画起始时的y坐标
105 | * 第四个参数toYDelta为动画结束时的y坐标
106 | */
107 | Animation animation = new TranslateAnimation(0, 500, 0, 0);
108 | animation.setDuration(2000);
109 | /**设置插值器:先加速,后减速**/
110 | animation.setInterpolator(new AccelerateDecelerateInterpolator());
111 | iv.startAnimation(animation);
112 | }
113 | break;
114 | case R.id.animation_group1://先播放缩放动画,完成后播放旋转动画
115 | Animation animation = AnimationUtils.loadAnimation(this, R.anim.scale);
116 | iv.startAnimation(animation);
117 | final Animation animation2 = AnimationUtils.loadAnimation(this, R.anim.rotate);
118 | animation.setAnimationListener(new Animation.AnimationListener() {
119 | @Override
120 | public void onAnimationStart(Animation animation) {
121 |
122 | }
123 |
124 | @Override
125 | public void onAnimationEnd(Animation animation) {
126 |
127 | iv.startAnimation(animation2);
128 | }
129 |
130 | @Override
131 | public void onAnimationRepeat(Animation animation) {
132 |
133 | }
134 | });
135 | break;
136 | case R.id.animation_group2://先播放旋转动画,完成后播放位移动画,在xml中设置第二个动画执行的等待时间
137 | Animation animationGroup = AnimationUtils.loadAnimation(this, R.anim.group2);
138 | iv.startAnimation(animationGroup);
139 | break;
140 | case R.id.animation_group3://重复的透明度动画
141 | AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f);
142 | alphaAnimation.setDuration(1000);
143 | alphaAnimation.setRepeatCount(10);
144 | /**倒序重复REVERSE 正序重复RESTART**/
145 | alphaAnimation.setRepeatMode(Animation.REVERSE);
146 | iv.startAnimation(alphaAnimation);
147 | break;
148 | case R.id.animation_group4://重复的位移动画
149 | Animation translateAnimation = new TranslateAnimation(-10, 10, 0, 0);
150 | translateAnimation.setDuration(100);
151 | translateAnimation.setRepeatCount(10);
152 | /**倒序重复REVERSE 正序重复RESTART**/
153 | translateAnimation.setRepeatMode(Animation.REVERSE);
154 | iv.startAnimation(translateAnimation);
155 | break;
156 | case R.id.animation_frame://帧动画
157 | iv.setImageResource(R.drawable.ring_animation);
158 | AnimationDrawable animationDrawable = (AnimationDrawable) iv.getDrawable();
159 | animationDrawable.start();
160 | break;
161 | case R.id.animation_layout://布局动画
162 | commonAdapterTest();
163 | break;
164 | case R.id.animation_activity://activity跳转动画
165 | startActivity(new Intent(this,SecondActivity.class));
166 | overridePendingTransition(R.anim.zoom_out,R.anim.zoom_in);
167 | break;
168 | }
169 |
170 | }
171 |
172 | /**
173 | * 布局动画
174 | */
175 | private void commonAdapterTest() {
176 | ListView listView = (ListView) findViewById(R.id.listview);
177 | List datas = new ArrayList<>();
178 | for (int i = 0; i < 18; i++) {
179 | datas.add("万能适配器测试" + i);
180 | }
181 | LayoutAnimationController layoutAnimationController= new LayoutAnimationController(AnimationUtils.loadAnimation(this, R.anim.zoom_in));
182 | layoutAnimationController.setOrder(LayoutAnimationController.ORDER_NORMAL);
183 | listView.setLayoutAnimation(layoutAnimationController);
184 | listView.setAdapter(new CommonAdapter(this, datas, R.layout.item) {
185 |
186 | @Override
187 | protected void convertView(View item, String s) {
188 | TextView textView = CommonViewHolder.get(item, R.id.textView);
189 | textView.setText(s);
190 | }
191 | });
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/bluemobi/dylan/animationdemo/SecondActivity.java:
--------------------------------------------------------------------------------
1 | package cn.bluemobi.dylan.animationdemo;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | /**
9 | * Created by yuandl on 2016-11-08.
10 | */
11 |
12 | public class SecondActivity extends AppCompatActivity {
13 | @Override
14 | protected void onCreate(@Nullable Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.ac_second);
17 | }
18 | public void onClick(View v){
19 | finish();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/bluemobi/dylan/animationdemo/adapter/CommonAdapter.java:
--------------------------------------------------------------------------------
1 | package cn.bluemobi.dylan.animationdemo.adapter;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.BaseAdapter;
9 | import android.widget.ListView;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * Created by yuandl on 2016-10-13.
15 | * 万能适配器
16 | */
17 |
18 | public abstract class CommonAdapter extends BaseAdapter {
19 | private Context context;
20 | private List datas;
21 | private int layoutId;
22 |
23 | public CommonAdapter(Context context, List datas, int layoutId) {
24 | this.context = context;
25 | this.datas = datas;
26 | this.layoutId = layoutId;
27 | }
28 |
29 | @Override
30 | public int getCount() {
31 | return datas == null ? 0 : datas.size();
32 | }
33 |
34 | @Override
35 | public T getItem(int position) {
36 | return datas.get(position);
37 | }
38 |
39 | @Override
40 | public long getItemId(int position) {
41 | return position;
42 | }
43 |
44 | @Override
45 | public View getView(int position, View convertView, ViewGroup parent) {
46 | if (convertView == null) {
47 | Log.d("listview", "---------LayoutInflater()-----------" + position);
48 | convertView = LayoutInflater.from(context).inflate(layoutId, null);
49 | }else{
50 | }
51 | // Log.d("listview", "---------getView()-----------" + position);
52 | T t = getItem(position);
53 | convertView(convertView, t);
54 | return convertView;
55 | }
56 |
57 | /**
58 | * 局部更新数据,调用一次getView()方法;Google推荐的做法
59 | *
60 | * @param listView 要更新的listview
61 | * @param position 要更新的位置
62 | */
63 | public void notifyDataSetChanged(ListView listView, int position) {
64 | /**第一个可见的位置**/
65 | int firstVisiblePosition = listView.getFirstVisiblePosition();
66 | /**最后一个可见的位置**/
67 | int lastVisiblePosition = listView.getLastVisiblePosition();
68 |
69 | /**在看见范围内才更新,不可见的滑动后自动会调用getView方法更新**/
70 | if (position >= firstVisiblePosition && position <= lastVisiblePosition) {
71 | /**获取指定位置view对象**/
72 | View view = listView.getChildAt(position - firstVisiblePosition);
73 | getView(position, view, listView);
74 | }
75 |
76 | }
77 |
78 | /**
79 | * 需要去实现的对item中的view的设置操作
80 | *
81 | * @param item
82 | * @param t
83 | */
84 | protected abstract void convertView(View item, T t);
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/bluemobi/dylan/animationdemo/adapter/CommonViewHolder.java:
--------------------------------------------------------------------------------
1 | package cn.bluemobi.dylan.animationdemo.adapter;
2 |
3 |
4 | import android.util.SparseArray;
5 | import android.view.View;
6 |
7 | /**
8 | * Created by yuandl on 2016-10-13.
9 | * 万能的ViewHolder
10 | *
11 | * @author
12 | */
13 | public class CommonViewHolder {
14 | /**
15 | * @param view 所有缓存View的根View
16 | * @param id 缓存View的唯一标识
17 | * @return
18 | */
19 | public static T get(View view, int id) {
20 |
21 | SparseArray viewHolder = (SparseArray) view.getTag();
22 | //如果根view没有用来缓存View的集合
23 | if (viewHolder == null) {
24 | viewHolder = new SparseArray();
25 | view.setTag(viewHolder);//创建集合和根View关联
26 | }
27 | View chidlView = viewHolder.get(id);//获取根View储存在集合中的孩纸
28 | if (chidlView == null) {//如果没有改孩纸
29 | //找到该孩纸
30 | chidlView = view.findViewById(id);
31 | viewHolder.put(id, chidlView);//保存到集合
32 | }
33 | return (T) chidlView;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/alpha.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/group2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/push_left_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/push_left_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/push_right_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/push_right_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/rotate.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/scale.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/translate.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/zoom_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/zoom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ring_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
6 |
7 | -
9 |
10 | -
12 |
13 | -
15 |
16 | -
18 |
19 | -
21 |
22 | -
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ac_second.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
21 |
25 |
26 |
32 |
33 |
39 |
40 |
46 |
47 |
53 |
54 |
55 |
59 |
60 |
66 |
67 |
73 |
74 |
80 |
81 |
87 |
88 |
89 |
93 |
94 |
100 |
101 |
107 |
108 |
114 |
115 |
116 |
117 |
121 |
122 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/promb_voice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/promb_voice.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/promb_voice2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/promb_voice2.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/promb_voice3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/promb_voice3.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/windmill_1.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/windmill_1.JPG
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/windmill_2.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/windmill_2.JPG
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/windmill_3.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/windmill_3.JPG
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/windmill_4.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/windmill_4.JPG
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/windmill_5.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/windmill_5.JPG
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/windmill_6.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/windmill_6.JPG
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/windmill_7.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxhdpi/windmill_7.JPG
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AnimatorDemo
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/cn/bluemobi/dylan/animationdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package cn.bluemobi.dylan.animationdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.2'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/screenshorts/effect.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/screenshorts/effect.gif
--------------------------------------------------------------------------------
/screenshorts/示例图.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/screenshorts/示例图.jpg
--------------------------------------------------------------------------------
/screenshots/effect.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linglongxin24/AnimationDemo/809e2d56eda94e411309ac569ca7031564d4533f/screenshots/effect.gif
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------