├── .gitignore
├── README.md
├── apk
└── app-debug.apk
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── cjj
│ │ └── beautifulanim
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── cjj
│ │ │ ├── anim
│ │ │ ├── MenuAnimation.java
│ │ │ ├── evaluator
│ │ │ │ ├── RectEvaluator.java
│ │ │ │ ├── RectFEvaluator.java
│ │ │ │ └── TRectFEvaluator.java
│ │ │ ├── helper
│ │ │ │ ├── LogHelper.java
│ │ │ │ ├── RippleHelper.java
│ │ │ │ └── TransitionHelper.java
│ │ │ └── interpolators
│ │ │ │ ├── BackIn.java
│ │ │ │ ├── BackInOut.java
│ │ │ │ ├── BackOut.java
│ │ │ │ ├── CircIn.java
│ │ │ │ ├── CircInOut.java
│ │ │ │ ├── CircOut.java
│ │ │ │ ├── ElasticIn.java
│ │ │ │ ├── ElasticInOut.java
│ │ │ │ ├── ElasticOut.java
│ │ │ │ ├── ExpoIn.java
│ │ │ │ ├── ExpoInOut.java
│ │ │ │ ├── ExpoOut.java
│ │ │ │ ├── QuadIn.java
│ │ │ │ ├── QuadInOut.java
│ │ │ │ ├── QuadOut.java
│ │ │ │ ├── QuartIn.java
│ │ │ │ ├── QuartInOut.java
│ │ │ │ ├── QuartOut.java
│ │ │ │ ├── QuintIn.java
│ │ │ │ ├── QuintInOut.java
│ │ │ │ ├── QuintOut.java
│ │ │ │ ├── SineIn.java
│ │ │ │ ├── SineInOut.java
│ │ │ │ └── SineOut.java
│ │ │ ├── beautifulanim
│ │ │ ├── MainActivity.java
│ │ │ ├── RootActivity.java
│ │ │ ├── WaterFragment.java
│ │ │ └── WindFragment.java
│ │ │ ├── customview
│ │ │ ├── CircularSplashView.java
│ │ │ ├── CustomShadow.java
│ │ │ ├── DepthLayout.java
│ │ │ └── DepthRendrer.java
│ │ │ └── headers
│ │ │ ├── AuraDrawable.java
│ │ │ ├── BearSceneView.java
│ │ │ ├── Foam.java
│ │ │ ├── FrameRateCounter.java
│ │ │ ├── MathHelper.java
│ │ │ ├── NoiseEffect.java
│ │ │ ├── Particle.java
│ │ │ ├── ParticleSystem.java
│ │ │ ├── PathBitmapMesh.java
│ │ │ ├── Renderable.java
│ │ │ ├── RenderableBear.java
│ │ │ ├── RenderableThree.java
│ │ │ ├── Smoke.java
│ │ │ ├── Water.java
│ │ │ └── WaterSceneView.java
│ └── res
│ │ ├── anim
│ │ ├── fab_in.xml
│ │ ├── fab_out.xml
│ │ ├── snackbar_in.xml
│ │ └── snackbar_out.xml
│ │ ├── color
│ │ ├── switch_thumb_material_dark.xml
│ │ └── switch_thumb_material_light.xml
│ │ ├── drawable-xxhdpi
│ │ ├── actionbar_shadow.png
│ │ ├── aura_gradient.png
│ │ ├── aura_gradient_inner.png
│ │ ├── foam.png
│ │ ├── grunge.png
│ │ ├── ic_forward.png
│ │ ├── noise.png
│ │ ├── noise_scratch.png
│ │ ├── smoke.png
│ │ ├── splash1.png
│ │ ├── splash2.png
│ │ ├── splash3.png
│ │ ├── splash4.png
│ │ ├── stones.png
│ │ ├── sun.png
│ │ ├── sun_aura.png
│ │ ├── water.png
│ │ ├── water_scene_background.9.png
│ │ └── x_y.png
│ │ ├── drawable-xxxhdpi
│ │ ├── ic_menu.png
│ │ └── mountains.png
│ │ ├── drawable
│ │ ├── bear_bg_gradient.xml
│ │ ├── circle.xml
│ │ ├── fab_background.xml
│ │ ├── menu_btn.xml
│ │ ├── menu_btn2.xml
│ │ ├── menu_btn3.xml
│ │ ├── menu_btn4.xml
│ │ ├── round_soft_shadow.png
│ │ ├── shadow.9.png
│ │ └── snackbar_background.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── activity_root.xml
│ │ ├── design_navigation_item.xml
│ │ ├── design_navigation_item_header.xml
│ │ ├── design_navigation_item_separator.xml
│ │ ├── design_navigation_item_subheader.xml
│ │ ├── design_navigation_menu.xml
│ │ ├── fragment_naruto.xml
│ │ ├── fragment_one_piece.xml
│ │ ├── fragment_playground.xml
│ │ ├── fragment_water.xml
│ │ ├── fragment_wind.xml
│ │ ├── layout_snackbar.xml
│ │ ├── layout_snackbar_include.xml
│ │ ├── menu_item.xml
│ │ ├── notification_media_action.xml
│ │ ├── notification_media_cancel_action.xml
│ │ ├── notification_template_big_media.xml
│ │ ├── notification_template_big_media_narrow.xml
│ │ ├── notification_template_lines.xml
│ │ ├── notification_template_media.xml
│ │ ├── notification_template_part_chronometer.xml
│ │ ├── notification_template_part_time.xml
│ │ ├── select_dialog_item_material.xml
│ │ ├── select_dialog_multichoice_material.xml
│ │ ├── select_dialog_singlechoice_material.xml
│ │ └── support_simple_spinner_dropdown_item.xml
│ │ ├── menu
│ │ └── menu_root.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ ├── custom_shadow.png
│ │ ├── gradien1.png
│ │ ├── gradien1circle.png
│ │ ├── ic_launcher.png
│ │ ├── lufei.png
│ │ ├── mingren.png
│ │ ├── round_shadow.png
│ │ └── yingshi.png
│ │ ├── mipmap-xxhdpi
│ │ ├── bear_1.png
│ │ ├── bear_2.png
│ │ ├── bear_white.png
│ │ ├── gfx_water_sunny.png
│ │ ├── gfx_wind_bears.png
│ │ ├── ic_launcher.png
│ │ ├── ic_previous.png
│ │ └── tree.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── cjj
│ └── beautifulanim
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Android-TransitionAnimation
2 | ======================
3 |
4 | ###说明
5 |
6 | 前些日子在微信朋友圈看到一个朋友发了个效果图,被炫哭了,原来Android还有这样吊炸天的动画效果!然后知道了他是从这里下载的:[google store Depth Library Demo](https://play.google.com/store/apps/details?id=no.agens.depth),Github上并未看到作者开源出来。只是怀着学习的心态,反编译了这个Demo,并学习它炫酷的过渡动画是怎么实现的。
7 |
8 | ####我实现的效果如下:
9 |
10 | 
11 |
12 | 有没有一种款拽酷炫吊炸天的既视感,咳,我自己都被深深感动到了,不知道你看后有什么感受?
13 |
14 | 如果觉得动画太快没看清,没事,这里还有慢动作的效果:
15 |
16 | 
17 |
18 | 搞出来之后,觉得解决反编译出来的魔法数字、代码、理解原作者所写的实现方式的等诸多问题都不是问题了,至少知道了它原来是这样炫出来的。
19 |
20 | ###简单讲讲实现方式
21 |
22 | ####(1)点击Fab按钮触发当前fragment离开的动画事件
23 | ```java
24 | TransitionHelper.startExitAnim(WaterFragment.this.root);
25 | ```
26 | 跟进去看看是这样的
27 | ```java
28 | public static void startExitAnim(View paramView) {
29 | exitAnimate((DepthLayout) paramView.findViewById(R.id.root_dl), 0.0F, 30.0F, 15L, 190, true);
30 | exitAnimate((DepthLayout) paramView.findViewById(R.id.appbar), 15.0F, 20.0F, 30L, 170, true);
31 | exitAnimate((DepthLayout) paramView.findViewById(R.id.fab_container), 30.0F, 20.0F, 45L, 210, true);
32 | exitAnimate((DepthLayout) paramView.findViewById(R.id.dl2), 15.0F, 20.0F, 60L, 230, true);
33 | exitAnimate((DepthLayout) paramView.findViewById(R.id.dl3), 30.0F, 20.0F, 75L, 250, true);
34 | hideStatusBar(paramView);
35 | }
36 | ```
37 | 通过传入的`paramView`找到内部的child view 并各自做离开时的动画,`exitAnimate`方法在`TransitionHelper`类中,这个是动画的帮助类,其中视图进入的动画,恢复动画等方法都在这里做了实现,具体可以看源码了解更多。
38 | ####(2)当前fragment离开后,另一个fragment进入
39 | ```java
40 | localWindFragment.setIntroAnimate(true);
41 | ((RootActivity) WaterFragment.this.getActivity()).goToFragment(localWindFragment);
42 | ```
43 | 进入的动画效果在`TransitionHelper`类中的一个`introAnimate`方法实现,主要是一些view视图的缩小、移动动画,具体看源码。
44 |
45 | ####(3)层级关系
46 | ```xml
47 |
48 |
53 |
54 |
57 |
60 |
61 |
62 |
63 |
66 |
67 |
69 |
70 |
72 |
73 |
74 |
79 |
80 |
87 |
88 |
89 | ```
90 | 从xml文件中,可以看出定义的DepthRendrer、DepthLayout,它们都继承了RelativeLayout,并实现绘制阴影等效果。
91 |
92 | * 注意:过多的图层嵌套,导致了掉帧的了情况,这是可以优化的。有时间我优化下,不过效果还是蛮流畅的,你可以真机试试。
93 |
94 |
95 | ###感谢
96 | [https://play.google.com/store/apps/details?id=no.agens.depth](https://play.google.com/store/apps/details?id=no.agens.depth)
97 |
98 |
99 | ###关于我
100 | 如果你喜欢这个东东的话,可以关注我[github](https://github.com/android-cjj) ,也可以关注我微博[Android_cJJ](http://weibo.com/chenjijun2011/).
101 |
102 |
103 | License
104 | =======
105 |
106 | The MIT License (MIT)
107 |
108 | Copyright (c) 2016 android-cjj
109 |
110 | Permission is hereby granted, free of charge, to any person obtaining a copy
111 | of this software and associated documentation files (the "Software"), to deal
112 | in the Software without restriction, including without limitation the rights
113 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
114 | copies of the Software, and to permit persons to whom the Software is
115 | furnished to do so, subject to the following conditions:
116 |
117 | The above copyright notice and this permission notice shall be included in all
118 | copies or substantial portions of the Software.
119 |
120 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
121 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
122 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
123 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
124 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
125 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
126 | SOFTWARE.
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/apk/app-debug.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/apk/app-debug.apk
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.2"
6 |
7 | defaultConfig {
8 | applicationId "com.cjj.beautifulanim"
9 | minSdkVersion 21
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
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 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.3.0'
26 | compile 'com.android.support:design:23.3.0'
27 | compile 'com.facebook.rebound:rebound:0.3.4'
28 | }
29 |
--------------------------------------------------------------------------------
/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 D:\world\android\sdk2/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/com/cjj/beautifulanim/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.cjj.beautifulanim;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/MenuAnimation.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim;
2 |
3 | public abstract interface MenuAnimation {
4 |
5 | public abstract void animateTOMenu();
6 |
7 | public abstract void exitFromMenu();
8 |
9 | public abstract void revertFromMenu();
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/evaluator/RectEvaluator.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.evaluator;
2 |
3 | import android.animation.TypeEvaluator;
4 | import android.graphics.Rect;
5 |
6 | public class RectEvaluator implements TypeEvaluator {
7 | public Rect evaluate(float paramFloat, Rect paramRect1, Rect paramRect2) {
8 | return new Rect(paramRect1.left + (int) (paramFloat * (paramRect2.left - paramRect1.left)), paramRect1.top + (int) (paramFloat * (paramRect2.top - paramRect1.top)), paramRect1.right + (int) (paramFloat * (paramRect2.right - paramRect1.right)), paramRect1.bottom + (int) (paramFloat * (paramRect2.bottom - paramRect1.bottom)));
9 | }
10 | }
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/evaluator/RectFEvaluator.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.evaluator;
2 |
3 | import android.animation.TypeEvaluator;
4 | import android.graphics.RectF;
5 |
6 | public class RectFEvaluator implements TypeEvaluator {
7 | public RectF evaluate(float paramFloat, RectF paramRectF1, RectF paramRectF2) {
8 | return new RectF(paramRectF1.left + (int) (paramFloat * (paramRectF2.left - paramRectF1.left)), paramRectF1.top + (int) (paramFloat * (paramRectF2.top - paramRectF1.top)), paramRectF1.right + (int) (paramFloat * (paramRectF2.right - paramRectF1.right)), paramRectF1.bottom + (int) (paramFloat * (paramRectF2.bottom - paramRectF1.bottom)));
9 | }
10 | }
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/evaluator/TRectFEvaluator.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.evaluator;
2 |
3 | import android.animation.TypeEvaluator;
4 | import android.graphics.RectF;
5 |
6 | public class TRectFEvaluator implements TypeEvaluator {
7 | public RectF evaluate(float paramFloat, RectF paramRectF1, RectF paramRectF2) {
8 | return new RectF(paramRectF1.left + (int) (paramFloat * (paramRectF2.left - paramRectF1.left)), paramRectF1.top + (int) (paramFloat * (paramRectF2.top - paramRectF1.top)), paramRectF1.right + (int) (paramFloat * (paramRectF2.right - paramRectF1.right)), paramRectF1.bottom + (int) (paramFloat * (paramRectF2.bottom - paramRectF1.bottom)));
9 | }
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/helper/LogHelper.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.helper;
2 |
3 | import android.util.Log;
4 |
5 | /**
6 | * Created by androidcjj on 2016/4/19.
7 | */
8 | public class LogHelper {
9 | public static final boolean mIsDebugMode = true;// 获取堆栈信息会影响性能,发布应用时记得关闭DebugMode
10 | private static final String TAG = "cjj_log";
11 |
12 | private static final String CLASS_METHOD_LINE_FORMAT = "%s.%s()_%s";
13 |
14 | public static void trace(String str) {
15 | if (mIsDebugMode) {
16 | StackTraceElement traceElement = Thread.currentThread()
17 | .getStackTrace()[3];// 从堆栈信息中获取当前被调用的方法信息
18 | String className = traceElement.getClassName();
19 | className = className.substring(className.lastIndexOf(".") + 1);
20 | String logText = String.format(CLASS_METHOD_LINE_FORMAT,
21 | className,
22 | traceElement.getMethodName(),
23 | String.valueOf(traceElement.getLineNumber()));
24 | Log.i(TAG, logText + "->" + str);// 打印Log
25 | }
26 | }
27 |
28 | public static void printStackTrace(Throwable throwable) {
29 | if (mIsDebugMode) {
30 | Log.w(TAG, "", throwable);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/helper/RippleHelper.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.helper;
2 |
3 | import android.content.res.ColorStateList;
4 | import android.graphics.drawable.ColorDrawable;
5 | import android.graphics.drawable.RippleDrawable;
6 |
7 | public class RippleHelper {
8 | public static ColorDrawable getColorDrawableFromColor(int paramInt) {
9 | return new ColorDrawable(paramInt);
10 | }
11 |
12 | public static RippleDrawable getPressedColorRippleDrawable(int paramInt1, int paramInt2) {
13 | return new RippleDrawable(getPressedColorSelector(paramInt1, paramInt2), getColorDrawableFromColor(paramInt1), null);
14 | }
15 |
16 | public static ColorStateList getPressedColorSelector(int paramInt1, int paramInt2) {
17 | return new ColorStateList(new int[][]{{16842919}, {16842908}, {16843518}, new int[0]}, new int[]{paramInt2, paramInt2, paramInt2, paramInt1});
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/BackIn.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class BackIn implements TimeInterpolator {
6 | protected float param_s = 1.70158F;
7 |
8 | public BackIn amount(float paramFloat) {
9 | this.param_s = paramFloat;
10 | return this;
11 | }
12 |
13 | public float getInterpolation(float paramFloat) {
14 | float f = this.param_s;
15 | return paramFloat * paramFloat * (paramFloat * (1.0F + f) - f);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/BackInOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class BackInOut implements TimeInterpolator {
6 | protected float param_s = 1.70158F;
7 |
8 | public BackInOut amount(float paramFloat) {
9 | this.param_s = paramFloat;
10 | return this;
11 | }
12 |
13 | public float getInterpolation(float paramFloat) {
14 | float f1 = this.param_s;
15 | float f2 = paramFloat * 2.0F;
16 | if (f2 < 1.0F) {
17 | float f6 = f2 * f2;
18 | float f7 = f1 * 1.525F;
19 | return 0.5F * (f6 * (f2 * (1.0F + f7) - f7));
20 | }
21 | float f3 = f2 - 2.0F;
22 | float f4 = f3 * f3;
23 | float f5 = f1 * 1.525F;
24 | return 0.5F * (2.0F + f4 * (f5 + f3 * (1.0F + f5)));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/BackOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class BackOut implements TimeInterpolator {
6 | protected float param_s = 1.70158F;
7 |
8 | public BackOut amount(float paramFloat) {
9 | this.param_s = paramFloat;
10 | return this;
11 | }
12 |
13 | public float getInterpolation(float paramFloat) {
14 | float f1 = this.param_s;
15 | float f2 = paramFloat - 1.0F;
16 | return 1.0F + f2 * f2 * (f1 + f2 * (f1 + 1.0F));
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/CircIn.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class CircIn implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return (float) Math.sqrt(1.0F - paramFloat * paramFloat);
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/CircInOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class CircInOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | float f1 = paramFloat * 2.0F;
8 | if (f1 < 1.0F) {
9 | return -0.5F * ((float) Math.sqrt(1.0F - f1 * f1) - 1.0F);
10 | }
11 | float f2 = f1 - 2.0F;
12 | return 0.5F * (1.0F + (float) Math.sqrt(1.0F - f2 * f2));
13 | }
14 | }
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/CircOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class CircOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return 1.0F + (float) Math.sqrt(1.0F - paramFloat * (paramFloat - 1.0F));
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/ElasticIn.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class ElasticIn implements TimeInterpolator {
6 | protected float param_a;
7 | protected float param_p;
8 | protected boolean setA = false;
9 | protected boolean setP = false;
10 |
11 | public ElasticIn a(float paramFloat) {
12 | this.param_a = paramFloat;
13 | this.setA = true;
14 | return this;
15 | }
16 |
17 | public float getInterpolation(float paramFloat) {
18 | float f1 = this.param_a;
19 | float f2 = this.param_p;
20 | if (paramFloat == 0.0F) {
21 | return 0.0F;
22 | }
23 | if (paramFloat == 1.0F) {
24 | return 1.0F;
25 | }
26 | if (!this.setP) {
27 | f2 = 0.3F;
28 | }
29 | if ((!this.setA) || (f1 < 1.0F)) {
30 | f1 = 1.0F;
31 | }
32 | for (float f3 = f2 / 4.0F; ; f3 = f2 / 6.2831855F * (float) Math.asin(1.0F / f1)) {
33 | float f4 = paramFloat - 1.0F;
34 | return -(f1 * (float) Math.pow(2.0D, 10.0F * f4) * (float) Math.sin(6.283185307179586D * (f4 - f3) / f2));
35 | }
36 | }
37 |
38 | public ElasticIn p(float paramFloat) {
39 | this.param_p = paramFloat;
40 | this.setP = true;
41 | return this;
42 | }
43 | }
44 |
45 |
46 | /* Location: /home/andrew/works/KotSharedPreferences/a/classes_dex2jar.jar!/no/agens/agtween/interpolators/ElasticIn.class
47 | * Java compiler version: 6 (50.0)
48 | * JD-Core Version: 0.7.1
49 | */
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/ElasticInOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class ElasticInOut implements TimeInterpolator {
6 | protected float param_a;
7 | protected float param_p;
8 | protected boolean setA = false;
9 | protected boolean setP = false;
10 |
11 | public ElasticInOut a(float paramFloat) {
12 | this.param_a = paramFloat;
13 | this.setA = true;
14 | return this;
15 | }
16 |
17 | public float getInterpolation(float paramFloat) {
18 | float f1 = this.param_a;
19 | float f2 = this.param_p;
20 | if (paramFloat == 0.0F) {
21 | return 0.0F;
22 | }
23 | float f3 = paramFloat * 2.0F;
24 | if (f3 == 2.0F) {
25 | return 1.0F;
26 | }
27 | if (!this.setP) {
28 | f2 = 0.45000002F;
29 | }
30 | if ((!this.setA) || (f1 < 1.0F)) {
31 | f1 = 1.0F;
32 | }
33 | float f4 = f2 / 4.0F;
34 | for (; f3 < 1.0F; f4 = f2 / 6.2831855F * (float) Math.asin(1.0F / f1)) {
35 | float f6 = f3 - 1.0F;
36 | return -0.5F * (f1 * (float) Math.pow(2.0D, 10.0F * f6) * (float) Math.sin(6.2831855F * (f6 - f4) / f2));
37 | }
38 | float f5 = f3 - 1.0F;
39 | return 1.0F + 0.5F * (f1 * (float) Math.pow(2.0D, -10.0F * f5) * (float) Math.sin(6.2831855F * (f5 - f4) / f2));
40 | }
41 |
42 | public ElasticInOut p(float paramFloat) {
43 | this.param_p = paramFloat;
44 | this.setP = true;
45 | return this;
46 | }
47 | }
48 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/ElasticOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class ElasticOut implements TimeInterpolator {
6 | protected float param_a;
7 | protected float param_p;
8 | protected boolean setA = false;
9 | protected boolean setP = false;
10 |
11 | public ElasticOut a(float paramFloat) {
12 | this.param_a = paramFloat;
13 | this.setA = true;
14 | return this;
15 | }
16 |
17 | public float getInterpolation(float paramFloat) {
18 | float f1 = this.param_a;
19 | float f2 = this.param_p;
20 | if (paramFloat == 0.0F) {
21 | return 0.0F;
22 | }
23 | if (paramFloat == 1.0F) {
24 | return 1.0F;
25 | }
26 | if (!this.setP) {
27 | f2 = 0.3F;
28 | }
29 | if ((!this.setA) || (f1 < 1.0F)) {
30 | f1 = 1.0F;
31 | }
32 | for (float f3 = f2 / 4.0F; ; f3 = f2 / 6.2831855F * (float) Math.asin(1.0F / f1)) {
33 | return 1.0F + f1 * (float) Math.pow(2.0D, -10.0F * paramFloat) * (float) Math.sin(6.283185307179586D * (paramFloat - f3) / f2);
34 | }
35 | }
36 |
37 | public ElasticOut p(float paramFloat) {
38 | this.param_p = paramFloat;
39 | this.setP = true;
40 | return this;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/ExpoIn.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class ExpoIn implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | if (paramFloat == 0.0F) {
8 | return 0.0F;
9 | }
10 | return (float) Math.pow(2.0D, 10.0F * (paramFloat - 1.0F));
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/ExpoInOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class ExpoInOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | if (paramFloat == 0.0F) {
8 | return 0.0F;
9 | }
10 | if (paramFloat == 1.0F) {
11 | return 1.0F;
12 | }
13 | float f = paramFloat * 2.0F;
14 | if (f < 1.0F) {
15 | return 0.5F * (float) Math.pow(2.0D, 10.0F * (f - 1.0F));
16 | }
17 | return 0.5F * (2.0F + -(float) Math.pow(2.0D, -10.0F * (f - 1.0F)));
18 | }
19 | }
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/ExpoOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class ExpoOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | if (paramFloat == 1.0F) {
8 | return 1.0F;
9 | }
10 | return 1.0F + -(float) Math.pow(2.0D, -10.0F * paramFloat);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuadIn.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuadIn implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return paramFloat * paramFloat;
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuadInOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuadInOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | float f1 = paramFloat * 2.0F;
8 | if (f1 < 1.0F) {
9 | return f1 * (0.5F * f1);
10 | }
11 | float f2 = f1 - 1.0F;
12 | return -0.5F * (f2 * (f2 - 2.0F) - 1.0F);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuadOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuadOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return -paramFloat * (paramFloat - 2.0F);
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuartIn.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuartIn implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return paramFloat * (paramFloat * (paramFloat * paramFloat));
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuartInOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuartInOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | float f1 = paramFloat * 2.0F;
8 | if (f1 < 1.0F) {
9 | return f1 * (f1 * (f1 * (0.5F * f1)));
10 | }
11 | float f2 = f1 - 2.0F;
12 | return -0.5F * (f2 * (f2 * (f2 * f2)) - 2.0F);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuartOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuartOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | float f = paramFloat - 1.0F;
8 | return -(f * (f * (f * f)) - 1.0F);
9 | }
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuintIn.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuintIn implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return paramFloat * (paramFloat * (paramFloat * (paramFloat * paramFloat)));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuintInOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuintInOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | float f1 = paramFloat * 2.0F;
8 | if (f1 < 1.0F) {
9 | return f1 * (f1 * (f1 * (f1 * (0.5F * f1))));
10 | }
11 | float f2 = f1 - 2.0F;
12 | return 0.5F * (2.0F + f2 * (f2 * (f2 * (f2 * f2))));
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/QuintOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class QuintOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | float f = paramFloat - 1.0F;
8 | return 1.0F + f * (f * (f * (f * f)));
9 | }
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/SineIn.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class SineIn implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return 1.0F + (float) -Math.cos(1.5707963267948966D * paramFloat);
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/SineInOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class SineInOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return -0.5F * ((float) Math.cos(3.141592653589793D * paramFloat) - 1.0F);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/anim/interpolators/SineOut.java:
--------------------------------------------------------------------------------
1 | package com.cjj.anim.interpolators;
2 |
3 | import android.animation.TimeInterpolator;
4 |
5 | public class SineOut implements TimeInterpolator {
6 | public float getInterpolation(float paramFloat) {
7 | return (float) Math.sin(1.5707963267948966D * paramFloat);
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/beautifulanim/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.cjj.beautifulanim;
2 |
3 | import android.graphics.Color;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | public class MainActivity extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_main);
14 | getWindow().setStatusBarColor(Color.TRANSPARENT);
15 | getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
16 |
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/beautifulanim/RootActivity.java:
--------------------------------------------------------------------------------
1 | package com.cjj.beautifulanim;
2 |
3 | import android.animation.ArgbEvaluator;
4 | import android.animation.ObjectAnimator;
5 | import android.app.Activity;
6 | import android.app.AlertDialog;
7 | import android.app.Fragment;
8 | import android.content.Intent;
9 | import android.graphics.BitmapFactory;
10 | import android.graphics.Color;
11 | import android.os.Bundle;
12 | import android.util.Property;
13 | import android.view.LayoutInflater;
14 | import android.view.View;
15 | import android.view.View.OnClickListener;
16 | import android.view.ViewGroup;
17 | import android.widget.LinearLayout.LayoutParams;
18 | import android.widget.TextView;
19 |
20 | import com.cjj.anim.MenuAnimation;
21 | import com.cjj.anim.interpolators.ExpoIn;
22 | import com.cjj.anim.interpolators.QuintOut;
23 | import com.cjj.customview.CircularSplashView;
24 |
25 |
26 | public class RootActivity extends Activity {
27 | Fragment currentFragment;
28 | int curretMenuIndex = 0;
29 | boolean isMenuVisible = false;
30 | ViewGroup menu;
31 |
32 | private void addMenuItem(ViewGroup paramViewGroup, String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
33 | ViewGroup localViewGroup = (ViewGroup) LayoutInflater.from(this).inflate(R.layout.menu_item, paramViewGroup, false);
34 | ((TextView) localViewGroup.findViewById(R.id.item_text)).setText(paramString);
35 | CircularSplashView localCircularSplashView = (CircularSplashView) localViewGroup.findViewById(R.id.circle);
36 | localCircularSplashView.setSplash(BitmapFactory.decodeResource(getResources(), paramInt1));
37 | localCircularSplashView.setSplashColor(paramInt2);
38 | localViewGroup.setOnClickListener(getMenuItemCLick(paramInt4, paramInt2));
39 | if (paramInt4 == 0) {
40 | int j = (int) getResources().getDimension(R.dimen.menu_item_height_padding);
41 | paramViewGroup.addView(localViewGroup, new LayoutParams(-1, j + (int) getResources().getDimension(R.dimen.menu_item_height)));
42 | localViewGroup.setPadding(0, j, 0, 0);
43 | } else {
44 | localViewGroup.setBackground(getResources().getDrawable(paramInt3, null));
45 | if (paramInt4 == 3) {
46 | int i = (int) getResources().getDimension(R.dimen.menu_item_height_padding);
47 | paramViewGroup.addView(localViewGroup, new LayoutParams(-1, i + (int) getResources().getDimension(R.dimen.menu_item_height)));
48 | localViewGroup.setPadding(0, 0, 0, i);
49 | } else {
50 | paramViewGroup.addView(localViewGroup, new LayoutParams(-1, (int) getResources().getDimension(R.dimen.menu_item_height)));
51 | }
52 | }
53 | }
54 |
55 | private void fadeColoTo(int paramInt, TextView paramTextView) {
56 | ArgbEvaluator localArgbEvaluator = new ArgbEvaluator();
57 | Object[] arrayOfObject = new Object[2];
58 | arrayOfObject[0] = Integer.valueOf(paramTextView.getCurrentTextColor());
59 | arrayOfObject[1] = Integer.valueOf(paramInt);
60 | ObjectAnimator localObjectAnimator = ObjectAnimator.ofObject(paramTextView, "TextColor", localArgbEvaluator, arrayOfObject);
61 | localObjectAnimator.setDuration(200L);
62 | localObjectAnimator.start();
63 | }
64 |
65 | private OnClickListener getMenuItemCLick(final int paramInt1, final int paramInt2) {
66 | return new OnClickListener() {
67 | public void onClick(View paramAnonymousView) {
68 | if (paramInt1 == RootActivity.this.curretMenuIndex) {
69 | RootActivity.this.onBackPressed();
70 | }
71 | do {
72 | if ((paramInt1 == 0) && (!(RootActivity.this.currentFragment instanceof WaterFragment))) {
73 | ((MenuAnimation) RootActivity.this.currentFragment).exitFromMenu();
74 | WaterFragment localWaterFragment = new WaterFragment();
75 | localWaterFragment.setIntroAnimate(true);
76 | RootActivity.this.goToFragment(localWaterFragment);
77 | RootActivity.this.hideMenu();
78 | RootActivity.this.selectMenuItem(paramInt1, paramInt2);
79 | return;
80 | }
81 | if ((paramInt1 == 1) && (!(RootActivity.this.currentFragment instanceof WindFragment))) {
82 | ((MenuAnimation) RootActivity.this.currentFragment).exitFromMenu();
83 | WindFragment localWindFragment = new WindFragment();
84 | localWindFragment.setIntroAnimate(true);
85 | RootActivity.this.goToFragment(localWindFragment);
86 | RootActivity.this.hideMenu();
87 | RootActivity.this.selectMenuItem(paramInt1, paramInt2);
88 | return;
89 | }
90 | } while (paramInt1 != 2);
91 | showAboutDialog();
92 | RootActivity.this.onBackPressed();
93 | }
94 | };
95 | }
96 |
97 | private void showAboutDialog() {
98 | AlertDialog.Builder builder = new AlertDialog.Builder(this);
99 | builder.setMessage("cjjjjjjjjjjjjjjjjjjjjjjjjj");
100 | builder.setTitle("About");
101 | builder.show();
102 | }
103 |
104 | private void makeAppFullscreen() {
105 | getWindow().setStatusBarColor(Color.TRANSPARENT);
106 | getWindow().getDecorView().setSystemUiVisibility(1280);
107 | }
108 |
109 | private void select(View paramView, int paramInt) {
110 | CircularSplashView localCircularSplashView = (CircularSplashView) paramView.findViewById(R.id.circle);
111 | localCircularSplashView.setScaleX(1.0F);
112 | localCircularSplashView.setScaleY(1.0F);
113 | localCircularSplashView.setVisibility(View.VISIBLE);
114 | localCircularSplashView.introAnimate();
115 | fadeColoTo(paramInt, (TextView) paramView.findViewById(R.id.item_text));
116 | }
117 |
118 | private void selectMenuItem(int paramInt1, int paramInt2) {
119 | for (int i = 0; i < this.menu.getChildCount(); i++) {
120 | View localView = this.menu.getChildAt(i);
121 | if (i == paramInt1) {
122 | select(localView, paramInt2);
123 | } else {
124 | unSelect(localView);
125 | }
126 | }
127 | this.curretMenuIndex = paramInt1;
128 | }
129 |
130 | private void setupMenu() {
131 | this.menu = ((ViewGroup) findViewById(R.id.menu_container));
132 | int i = getResources().getColor(R.color.splash1);
133 | addMenuItem(this.menu, "Naruto", R.drawable.splash1, i, R.drawable.menu_btn, 0);
134 | addMenuItem(this.menu, "OnePiece", R.drawable.splash2, getResources().getColor(R.color.splash2), R.drawable.menu_btn2, 1);
135 | addMenuItem(this.menu, "About", R.drawable.splash3, getResources().getColor(R.color.splash3), R.drawable.menu_btn3, 2);
136 | selectMenuItem(0, i);
137 | this.menu.setTranslationY(20000.0F);
138 | }
139 |
140 | private void unSelect(View paramView) {
141 | final View localView = paramView.findViewById(R.id.circle);
142 | localView.animate().scaleX(0.0F).scaleY(0.0F).setDuration(150L).withEndAction(new Runnable() {
143 | public void run() {
144 | localView.setVisibility(View.INVISIBLE);
145 | }
146 | }).start();
147 | fadeColoTo(-16777216, (TextView) paramView.findViewById(R.id.item_text));
148 | }
149 |
150 | public void goToFragment(Fragment paramFragment) {
151 | getFragmentManager().beginTransaction().add(R.id.fragment_container, paramFragment).commit();
152 | final Fragment localFragment = this.currentFragment;
153 | this.currentFragment = paramFragment;
154 | getWindow().getDecorView().postDelayed(new Runnable() {
155 | public void run() {
156 | RootActivity.this.getFragmentManager().beginTransaction().remove(localFragment).commit();
157 | }
158 | }, 2000L);
159 | }
160 |
161 | public void hideMenu() {
162 | this.isMenuVisible = false;
163 | ViewGroup localViewGroup = this.menu;
164 | Property localProperty = View.TRANSLATION_Y;
165 | float[] arrayOfFloat = new float[1];
166 | arrayOfFloat[0] = this.menu.getHeight();
167 | ObjectAnimator localObjectAnimator = ObjectAnimator.ofFloat(localViewGroup, localProperty, arrayOfFloat);
168 | localObjectAnimator.setDuration(750L);
169 | localObjectAnimator.setInterpolator(new ExpoIn());
170 | localObjectAnimator.start();
171 | }
172 |
173 | public void onBackPressed() {
174 | if (this.isMenuVisible) {
175 | hideMenu();
176 | ((MenuAnimation) this.currentFragment).revertFromMenu();
177 | return;
178 | }
179 | super.onBackPressed();
180 | }
181 |
182 | protected void onCreate(Bundle paramBundle) {
183 | super.onCreate(paramBundle);
184 | setContentView(R.layout.activity_root);
185 | makeAppFullscreen();
186 | if (paramBundle == null) {
187 | this.currentFragment = new WaterFragment();
188 | getFragmentManager().beginTransaction().add(R.id.fragment_container, this.currentFragment).commit();
189 | }
190 | setupMenu();
191 | }
192 |
193 | public void setCurretMenuIndex(int paramInt) {
194 | this.curretMenuIndex = paramInt;
195 | }
196 |
197 | public void showMenu() {
198 | this.isMenuVisible = true;
199 | ViewGroup localViewGroup = this.menu;
200 | Property localProperty = View.TRANSLATION_Y;
201 | float[] arrayOfFloat = new float[2];
202 | arrayOfFloat[0] = this.menu.getHeight();
203 | arrayOfFloat[1] = 0.0F;
204 | ObjectAnimator localObjectAnimator = ObjectAnimator.ofFloat(localViewGroup, localProperty, arrayOfFloat);
205 | localObjectAnimator.setDuration(1000L);
206 | localObjectAnimator.setInterpolator(new QuintOut());
207 | localObjectAnimator.setStartDelay(150L);
208 | localObjectAnimator.start();
209 | selectMenuItem(this.curretMenuIndex, ((TextView) this.menu.getChildAt(this.curretMenuIndex).findViewById(R.id.item_text)).getCurrentTextColor());
210 | ((MenuAnimation) this.currentFragment).animateTOMenu();
211 | }
212 | }
213 |
214 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/beautifulanim/WaterFragment.java:
--------------------------------------------------------------------------------
1 | package com.cjj.beautifulanim;
2 |
3 | import android.animation.Animator;
4 | import android.animation.AnimatorListenerAdapter;
5 | import android.animation.ObjectAnimator;
6 | import android.app.Fragment;
7 | import android.os.Bundle;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.View.OnClickListener;
11 | import android.view.ViewGroup;
12 | import android.view.ViewTreeObserver.OnGlobalLayoutListener;
13 | import android.widget.ImageView;
14 | import android.widget.SeekBar;
15 | import android.widget.SeekBar.OnSeekBarChangeListener;
16 | import android.widget.Toast;
17 |
18 | import com.cjj.anim.MenuAnimation;
19 | import com.cjj.anim.helper.TransitionHelper;
20 |
21 |
22 | public class WaterFragment extends Fragment implements MenuAnimation {
23 | public static final int TRANSFORM_DURATION = 900;
24 | private boolean introAnimate;
25 | // MaterialMenuDrawable menuIcon;
26 | View root;
27 | AnimatorListenerAdapter showShadowListener = new AnimatorListenerAdapter() {
28 | public void onAnimationEnd(Animator paramAnonymousAnimator) {
29 | super.onAnimationEnd(paramAnonymousAnimator);
30 | WaterFragment.this.showShadow();
31 | // WaterFragment.this.waterScene.setPause(false);
32 | }
33 | };
34 | // WaterSceneView waterScene;
35 |
36 | private void hideShadow() {
37 | this.root.findViewById(R.id.actionbar_shadow).setVisibility(View.GONE);
38 | }
39 |
40 | private void introAnimate() {
41 | if (this.introAnimate) {
42 | this.root.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
43 | public void onGlobalLayout() {
44 | WaterFragment.this.root.getViewTreeObserver().removeOnGlobalLayoutListener(this);
45 | TransitionHelper.startIntroAnim(WaterFragment.this.root, WaterFragment.this.showShadowListener);
46 | WaterFragment.this.hideShadow();
47 | // WaterFragment.this.waterScene.postDelayed(new Runnable() {
48 | // public void run() {
49 | // WaterFragment.this.waterScene.setPause(true);
50 | // }
51 | // }, 10L);
52 | }
53 | });
54 | }
55 | }
56 |
57 |
58 | private void setupFab() {
59 | this.root.findViewById(R.id.fab).setOnClickListener(new OnClickListener() {
60 | public void onClick(View paramAnonymousView) {
61 | WaterFragment.this.root.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
62 | public void onGlobalLayout() {
63 | WaterFragment.this.root.getViewTreeObserver().removeOnGlobalLayoutListener(this);
64 | TransitionHelper.startExitAnim(WaterFragment.this.root);
65 | }
66 | });
67 | WindFragment localWindFragment = new WindFragment();
68 | localWindFragment.setIntroAnimate(true);
69 | ((RootActivity) WaterFragment.this.getActivity()).goToFragment(localWindFragment);
70 | if (((RootActivity) WaterFragment.this.getActivity()).isMenuVisible) {
71 | ((RootActivity) WaterFragment.this.getActivity()).hideMenu();
72 | }
73 | // WaterFragment.this.hideShadow();
74 | // WaterFragment.this.waterScene.setPause(true);
75 | }
76 | });
77 | }
78 |
79 | private void setupMenuButton() {
80 | ImageView localImageView = (ImageView) this.root.findViewById(R.id.menu);
81 | localImageView.setOnClickListener(new OnClickListener() {
82 | public void onClick(View paramAnonymousView) {
83 | if (!((RootActivity) WaterFragment.this.getActivity()).isMenuVisible) {
84 | ((RootActivity) WaterFragment.this.getActivity()).showMenu();
85 | return;
86 | }
87 | ((RootActivity) WaterFragment.this.getActivity()).onBackPressed();
88 | }
89 | });
90 | // this.menuIcon = new MaterialMenuDrawable(getActivity(), -1, MaterialMenuDrawable.Stroke.THIN, 900);
91 | // localImageView.setImageDrawable(this.menuIcon);
92 | }
93 |
94 | private void setupSeekbars() {
95 | SeekBar localSeekBar1 = (SeekBar) this.root.findViewById(R.id.wave_seekbar);
96 | SeekBar localSeekBar2 = (SeekBar) this.root.findViewById(R.id.noise_seekbar);
97 | WindFragment.setProgressBarColor(localSeekBar1, getResources().getColor(R.color.fab));
98 | WindFragment.setProgressBarColor(localSeekBar2, getResources().getColor(R.color.fab));
99 | localSeekBar2.setProgress(50);
100 | localSeekBar1.setProgress(50);
101 | localSeekBar1.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
102 | public void onProgressChanged(SeekBar paramAnonymousSeekBar, int paramAnonymousInt, boolean paramAnonymousBoolean) {
103 | // WaterFragment.this.waterScene.setWaveHeight(paramAnonymousInt / 4.0F * WaterFragment.this.getResources().getDisplayMetrics().density);
104 | }
105 |
106 | public void onStartTrackingTouch(SeekBar paramAnonymousSeekBar) {
107 | }
108 |
109 | public void onStopTrackingTouch(SeekBar paramAnonymousSeekBar) {
110 | }
111 | });
112 | localSeekBar2.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
113 | public void onProgressChanged(SeekBar paramAnonymousSeekBar, int paramAnonymousInt, boolean paramAnonymousBoolean) {
114 | // WaterFragment.this.waterScene.setNoiseIntensity(paramAnonymousInt / 100.0F);
115 | }
116 |
117 | public void onStartTrackingTouch(SeekBar paramAnonymousSeekBar) {
118 | }
119 |
120 | public void onStopTrackingTouch(SeekBar paramAnonymousSeekBar) {
121 | }
122 | });
123 | }
124 |
125 | private void showShadow() {
126 | View localView = this.root.findViewById(R.id.actionbar_shadow);
127 | localView.setVisibility(View.VISIBLE);
128 | ObjectAnimator.ofFloat(localView, View.ALPHA, new float[]{0.0F, 0.8F}).setDuration(400L).start();
129 | }
130 |
131 | public void animateTOMenu() {
132 | TransitionHelper.animateToMenuState(this.root, new AnimatorListenerAdapter() {
133 | public void onAnimationEnd(Animator paramAnonymousAnimator) {
134 | super.onAnimationEnd(paramAnonymousAnimator);
135 | // WaterFragment.this.waterScene.setPause(false);
136 | }
137 | });
138 | // this.menuIcon.animateIconState(MaterialMenuDrawable.IconState.ARROW);
139 | hideShadow();
140 | // this.waterScene.setPause(true);
141 | }
142 |
143 | public void exitFromMenu() {
144 | TransitionHelper.animateMenuOut(this.root);
145 | // this.waterScene.setPause(true);
146 | }
147 |
148 | public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle) {
149 | this.root = paramLayoutInflater.inflate(R.layout.fragment_water, paramViewGroup, false);
150 | // this.waterScene = ((WaterSceneView) this.root.findViewById(R.id.water_scene));
151 | setupFab();
152 | introAnimate();
153 | setupSeekbars();
154 | setupMenuButton();
155 | ((RootActivity) getActivity()).setCurretMenuIndex(0);
156 | return this.root;
157 | }
158 |
159 | public void revertFromMenu() {
160 | TransitionHelper.startRevertFromMenu(this.root, this.showShadowListener);
161 | // this.menuIcon.animateIconState(MaterialMenuDrawable.IconState.BURGER);
162 | // this.waterScene.setPause(true);
163 | }
164 |
165 | public void setIntroAnimate(boolean paramBoolean) {
166 | this.introAnimate = paramBoolean;
167 | }
168 | }
169 |
170 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/beautifulanim/WindFragment.java:
--------------------------------------------------------------------------------
1 | package com.cjj.beautifulanim;
2 |
3 | import android.animation.Animator;
4 | import android.animation.AnimatorListenerAdapter;
5 | import android.animation.ObjectAnimator;
6 | import android.app.Fragment;
7 | import android.graphics.PorterDuff.Mode;
8 | import android.graphics.drawable.LayerDrawable;
9 | import android.graphics.drawable.StateListDrawable;
10 | import android.os.Bundle;
11 | import android.view.LayoutInflater;
12 | import android.view.View;
13 | import android.view.View.OnClickListener;
14 | import android.view.ViewGroup;
15 | import android.view.ViewTreeObserver.OnGlobalLayoutListener;
16 | import android.widget.ImageView;
17 | import android.widget.SeekBar;
18 | import android.widget.SeekBar.OnSeekBarChangeListener;
19 |
20 | import com.cjj.anim.MenuAnimation;
21 | import com.cjj.anim.helper.TransitionHelper;
22 | import com.cjj.headers.BearSceneView;
23 |
24 |
25 | public class WindFragment extends Fragment implements MenuAnimation
26 | {
27 | public static final int FLAMES_INITIAL_HEIGHT = 50;
28 | // BearSceneView bearsScene;
29 | private boolean introAnimate;
30 | // MaterialMenuDrawable menuIcon;
31 | View root;
32 | AnimatorListenerAdapter showShadowListener = new AnimatorListenerAdapter()
33 | {
34 | public void onAnimationEnd(Animator paramAnonymousAnimator)
35 | {
36 | super.onAnimationEnd(paramAnonymousAnimator);
37 | WindFragment.this.showShadow();
38 | // WindFragment.this.bearsScene.setPause(false);
39 | }
40 | };
41 |
42 | private void doIntroAnimation()
43 | {
44 | if (this.introAnimate) {
45 | this.root.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener()
46 | {
47 | public void onGlobalLayout()
48 | {
49 | WindFragment.this.root.getViewTreeObserver().removeOnGlobalLayoutListener(this);
50 | TransitionHelper.startIntroAnim(WindFragment.this.root, WindFragment.this.showShadowListener);
51 | WindFragment.this.hideShadow();
52 | // WindFragment.this.bearsScene.postDelayed(new Runnable()
53 | // {
54 | // public void run()
55 | // {
56 | // WindFragment.this.bearsScene.setPause(true);
57 | // }
58 | // }, 10L);
59 | }
60 | });
61 | }
62 | }
63 |
64 | private void hideShadow()
65 | {
66 | this.root.findViewById(R.id.actionbar_shadow).setVisibility(View.GONE);
67 | }
68 |
69 | public static void setProgressBarColor(SeekBar paramSeekBar, int paramInt)
70 | {
71 | if ((paramSeekBar.getProgressDrawable() instanceof StateListDrawable))
72 | {
73 | ((StateListDrawable)paramSeekBar.getProgressDrawable()).setColorFilter(paramInt, Mode.SRC_IN);
74 | paramSeekBar.getThumb().setColorFilter(paramInt, Mode.SRC_IN);
75 | }
76 | while (!(paramSeekBar.getProgressDrawable() instanceof LayerDrawable)) {
77 | return;
78 | }
79 | LayerDrawable localLayerDrawable = (LayerDrawable)paramSeekBar.getProgressDrawable();
80 | for (int i = 0; i < localLayerDrawable.getNumberOfLayers(); i++) {
81 | localLayerDrawable.getDrawable(i).setColorFilter(paramInt, Mode.SRC_IN);
82 | }
83 | paramSeekBar.getThumb().setColorFilter(paramInt, Mode.SRC_IN);
84 | }
85 |
86 | private void setupFabButton()
87 | {
88 | this.root.findViewById(R.id.fab).setOnClickListener(new OnClickListener()
89 | {
90 | public void onClick(View paramAnonymousView)
91 | {
92 | WindFragment.this.root.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener()
93 | {
94 | public void onGlobalLayout()
95 | {
96 | WindFragment.this.root.getViewTreeObserver().removeOnGlobalLayoutListener(this);
97 | TransitionHelper.startExitAnim(WindFragment.this.root);
98 | }
99 | });
100 | WaterFragment localWaterFragment = new WaterFragment();
101 | localWaterFragment.setIntroAnimate(true);
102 | ((RootActivity)WindFragment.this.getActivity()).goToFragment(localWaterFragment);
103 | if (((RootActivity)WindFragment.this.getActivity()).isMenuVisible) {
104 | ((RootActivity)WindFragment.this.getActivity()).hideMenu();
105 | }
106 | WindFragment.this.hideShadow();
107 | // WindFragment.this.bearsScene.setPause(true);
108 | }
109 | });
110 | }
111 |
112 | private void setupMenuButton()
113 | {
114 | ImageView localImageView = (ImageView)this.root.findViewById(R.id.menu);
115 | localImageView.setOnClickListener(new OnClickListener()
116 | {
117 | public void onClick(View paramAnonymousView)
118 | {
119 | if (!((RootActivity)WindFragment.this.getActivity()).isMenuVisible)
120 | {
121 | ((RootActivity)WindFragment.this.getActivity()).showMenu();
122 | return;
123 | }
124 | WindFragment.this.getActivity().onBackPressed();
125 | }
126 | });
127 | // this.menuIcon = new MaterialMenuDrawable(getActivity(), -1, MaterialMenuDrawable.Stroke.THIN, 900);
128 | // localImageView.setImageDrawable(this.menuIcon);
129 | }
130 |
131 | private void setupSliders()
132 | {
133 | SeekBar localSeekBar1 = (SeekBar)this.root.findViewById(R.id.wind_seekbar);
134 | final SeekBar localSeekBar2 = (SeekBar)this.root.findViewById(R.id.flames_seekbar);
135 | setProgressBarColor(localSeekBar1, getResources().getColor(R.color.fab2));
136 | setProgressBarColor(localSeekBar2, getResources().getColor(R.color.fab2));
137 | localSeekBar1.setOnSeekBarChangeListener(new OnSeekBarChangeListener()
138 | {
139 | public void onProgressChanged(SeekBar paramAnonymousSeekBar, int paramAnonymousInt, boolean paramAnonymousBoolean)
140 | {
141 | // WindFragment.this.bearsScene.setWind(paramAnonymousInt);
142 | }
143 |
144 | public void onStartTrackingTouch(SeekBar paramAnonymousSeekBar) {}
145 |
146 | public void onStopTrackingTouch(SeekBar paramAnonymousSeekBar) {}
147 | });
148 | localSeekBar2.setOnSeekBarChangeListener(new OnSeekBarChangeListener()
149 | {
150 | public void onProgressChanged(SeekBar paramAnonymousSeekBar, int paramAnonymousInt, boolean paramAnonymousBoolean)
151 | {
152 | // WindFragment.this.bearsScene.setFlamesHeight(paramAnonymousInt);
153 | }
154 |
155 | public void onStartTrackingTouch(SeekBar paramAnonymousSeekBar) {}
156 |
157 | public void onStopTrackingTouch(SeekBar paramAnonymousSeekBar) {}
158 | });
159 | // this.bearsScene.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener()
160 | // {
161 | // public void onGlobalLayout()
162 | // {
163 | // WindFragment.this.bearsScene.getViewTreeObserver().removeOnGlobalLayoutListener(this);
164 | // localSeekBar2.setProgress(50);
165 | // }
166 | // });
167 | }
168 |
169 | private void showShadow()
170 | {
171 | View localView = this.root.findViewById(R.id.actionbar_shadow);
172 | localView.setVisibility(View.VISIBLE);
173 | ObjectAnimator.ofFloat(localView, View.ALPHA, new float[] { 0.0F, 0.8F }).setDuration(400L).start();
174 | }
175 |
176 | public void animateTOMenu()
177 | {
178 | TransitionHelper.animateToMenuState(this.root, new AnimatorListenerAdapter()
179 | {
180 | public void onAnimationEnd(Animator paramAnonymousAnimator)
181 | {
182 | super.onAnimationEnd(paramAnonymousAnimator);
183 | // WindFragment.this.bearsScene.setPause(false);
184 | }
185 | });
186 | // this.menuIcon.animateIconState(MaterialMenuDrawable.IconState.ARROW);
187 | hideShadow();
188 | // this.bearsScene.setPause(true);
189 | }
190 |
191 | public void exitFromMenu()
192 | {
193 | TransitionHelper.animateMenuOut(this.root);
194 | // this.bearsScene.setPause(true);
195 | }
196 |
197 | public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
198 | {
199 | this.root = paramLayoutInflater.inflate(R.layout.fragment_wind, paramViewGroup, false);
200 | // this.bearsScene = ((BearSceneView)this.root.findViewById(R.id.water_scene));
201 | doIntroAnimation();
202 | setupFabButton();
203 | setupMenuButton();
204 | ((RootActivity)getActivity()).setCurretMenuIndex(1);
205 | setupSliders();
206 | return this.root;
207 | }
208 |
209 | public void revertFromMenu()
210 | {
211 | TransitionHelper.startRevertFromMenu(this.root, this.showShadowListener);
212 | // this.menuIcon.animateIconState(MaterialMenuDrawable.IconState.BURGER);
213 | // this.bearsScene.setPause(true);
214 | }
215 |
216 | public void setIntroAnimate(boolean paramBoolean)
217 | {
218 | this.introAnimate = paramBoolean;
219 | }
220 | }
221 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/customview/CircularSplashView.java:
--------------------------------------------------------------------------------
1 | package com.cjj.customview;
2 |
3 | import android.animation.ValueAnimator;
4 | import android.animation.ValueAnimator.AnimatorUpdateListener;
5 | import android.content.Context;
6 | import android.graphics.Bitmap;
7 | import android.graphics.Bitmap.Config;
8 | import android.graphics.Canvas;
9 | import android.graphics.Paint;
10 | import android.graphics.Path;
11 | import android.graphics.Path.Direction;
12 | import android.graphics.Rect;
13 | import android.graphics.RectF;
14 | import android.util.AttributeSet;
15 | import android.view.View;
16 |
17 | import com.cjj.anim.evaluator.RectEvaluator;
18 | import com.cjj.anim.evaluator.RectFEvaluator;
19 | import com.cjj.anim.interpolators.QuintOut;
20 | import com.cjj.beautifulanim.R;
21 |
22 | import java.util.ArrayList;
23 | import java.util.Iterator;
24 | import java.util.List;
25 |
26 |
27 | public class CircularSplashView extends View {
28 | private List circles = new ArrayList();
29 | private Bitmap splash;
30 | private int splashColor;
31 |
32 | public CircularSplashView(Context paramContext) {
33 | super(paramContext);
34 | }
35 |
36 | public CircularSplashView(Context paramContext, AttributeSet paramAttributeSet) {
37 | super(paramContext, paramAttributeSet);
38 | }
39 |
40 | public CircularSplashView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) {
41 | super(paramContext, paramAttributeSet, paramInt);
42 | }
43 |
44 | public void introAnimate() {
45 | this.circles.clear();
46 | RectF localRectF1 = new RectF(0.0F, 0.0F, getWidth(), getHeight());
47 | Rect localRect = new Rect(0, 0, getWidth(), getHeight());
48 | RectF localRectF2 = new RectF(-1.0F, -1.0F, 1 + getWidth(), 1 + getHeight());
49 | this.circles.add(new CircleColorExpand(localRectF1, 0L, 600L, this.splashColor));
50 | this.circles.add(new CircleColorExpand(localRectF2, 70L, 600L, getResources().getColor(R.color.white)));
51 | this.circles.add(new CircleBitmapExpand(localRect, 130L, 800L, this.splash));
52 | Iterator localIterator = this.circles.iterator();
53 | while (localIterator.hasNext()) {
54 | ((CircledDrawable) localIterator.next()).startAnim();
55 | }
56 | }
57 |
58 | protected void onDraw(Canvas paramCanvas) {
59 | super.onDraw(paramCanvas);
60 | Iterator localIterator = this.circles.iterator();
61 | while (localIterator.hasNext()) {
62 | ((CircledDrawable) localIterator.next()).draw(paramCanvas);
63 | }
64 | }
65 |
66 | protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
67 | super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
68 | if (this.circles.size() == 0) {
69 | introAnimate();
70 | }
71 | }
72 |
73 | public void setSplash(Bitmap paramBitmap) {
74 | this.splash = paramBitmap;
75 | }
76 |
77 | public void setSplashColor(int paramInt) {
78 | this.splashColor = paramInt;
79 | }
80 |
81 | public class CircleBitmapExpand
82 | implements CircularSplashView.CircledDrawable {
83 | long animDuration;
84 | Bitmap bitmap;
85 | Rect drawingRect;
86 | long startDelay;
87 | Rect targetSize;
88 |
89 | public CircleBitmapExpand(Rect paramRect, long paramLong1, long paramLong2, Bitmap paramBitmap) {
90 | this.targetSize = paramRect;
91 | this.startDelay = paramLong1;
92 | this.animDuration = paramLong2;
93 | this.bitmap = paramBitmap;
94 | }
95 |
96 | public Bitmap GetBitmapClippedCircle(Bitmap paramBitmap) {
97 | int i = paramBitmap.getWidth();
98 | int j = paramBitmap.getHeight();
99 | Bitmap localBitmap = Bitmap.createBitmap(i, j, Config.ARGB_8888);
100 | Path localPath = new Path();
101 | localPath.addCircle(i / 2, j / 2, Math.min(i, j / 2), Direction.CCW);
102 | Canvas localCanvas = new Canvas(localBitmap);
103 | localCanvas.clipPath(localPath);
104 | localCanvas.drawBitmap(paramBitmap, 0.0F, 0.0F, null);
105 | paramBitmap.recycle();
106 | return localBitmap;
107 | }
108 |
109 | public void draw(Canvas paramCanvas) {
110 | if (this.drawingRect != null && this.bitmap != null) {
111 | paramCanvas.drawBitmap(this.bitmap, null, this.drawingRect, null);
112 | }
113 | }
114 |
115 | public void startAnim() {
116 | Rect localRect = new Rect(this.targetSize.centerX(), this.targetSize.centerY(), this.targetSize.centerX(), this.targetSize.centerY());
117 | this.drawingRect = localRect;
118 | RectEvaluator localRectEvaluator = new RectEvaluator();
119 | Object[] arrayOfObject = new Object[2];
120 | arrayOfObject[0] = localRect;
121 | arrayOfObject[1] = this.targetSize;
122 | ValueAnimator localValueAnimator = ValueAnimator.ofObject(localRectEvaluator, arrayOfObject);
123 | localValueAnimator.setDuration(this.animDuration);
124 | localValueAnimator.setInterpolator(new QuintOut());
125 | localValueAnimator.setStartDelay(this.startDelay);
126 | localValueAnimator.addUpdateListener(new AnimatorUpdateListener() {
127 | public void onAnimationUpdate(ValueAnimator paramAnonymousValueAnimator) {
128 | CircularSplashView.CircleBitmapExpand.this.drawingRect = ((Rect) paramAnonymousValueAnimator.getAnimatedValue());
129 | CircularSplashView.this.invalidate();
130 | }
131 | });
132 | localValueAnimator.start();
133 | }
134 | }
135 |
136 | public class CircleColorExpand
137 | implements CircularSplashView.CircledDrawable {
138 | long animDuration;
139 | RectF drawingRect;
140 | private Paint paint = new Paint(-16777216);
141 | long startDelay;
142 | RectF targetSize;
143 |
144 | public CircleColorExpand(RectF paramRectF, long paramLong1, long paramLong2, int paramInt) {
145 | this.targetSize = paramRectF;
146 | this.startDelay = paramLong1;
147 | this.animDuration = paramLong2;
148 | this.paint.setColor(paramInt);
149 | this.paint.setAntiAlias(true);
150 | this.paint.setDither(true);
151 | }
152 |
153 | public void draw(Canvas paramCanvas) {
154 | if (this.drawingRect != null) {
155 | paramCanvas.drawOval(this.drawingRect, this.paint);
156 | }
157 | }
158 |
159 | public void startAnim() {
160 | RectF localRectF = new RectF(this.targetSize.centerX(), this.targetSize.centerY(), this.targetSize.centerX(), this.targetSize.centerY());
161 | RectFEvaluator localRectFEvaluator = new RectFEvaluator();
162 | Object[] arrayOfObject = new Object[2];
163 | arrayOfObject[0] = localRectF;
164 | arrayOfObject[1] = this.targetSize;
165 | ValueAnimator localValueAnimator = ValueAnimator.ofObject(localRectFEvaluator, arrayOfObject);
166 | localValueAnimator.setDuration(this.animDuration);
167 | localValueAnimator.setInterpolator(new QuintOut());
168 | localValueAnimator.setStartDelay(this.startDelay);
169 | localValueAnimator.addUpdateListener(new AnimatorUpdateListener() {
170 | public void onAnimationUpdate(ValueAnimator paramAnonymousValueAnimator) {
171 | CircularSplashView.CircleColorExpand.this.drawingRect = ((RectF) paramAnonymousValueAnimator.getAnimatedValue());
172 | CircularSplashView.this.invalidate();
173 | }
174 | });
175 | localValueAnimator.start();
176 | }
177 | }
178 |
179 | static abstract interface CircledDrawable {
180 | public abstract void draw(Canvas paramCanvas);
181 |
182 | public abstract void startAnim();
183 | }
184 | }
185 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/AuraDrawable.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Rect;
5 | import android.graphics.drawable.Drawable;
6 |
7 | import com.cjj.headers.Renderable;
8 |
9 |
10 | public class AuraDrawable extends Renderable {
11 | private Drawable drawable;
12 | long lastflicker;
13 |
14 | public AuraDrawable(Drawable paramDrawable, Rect paramRect) {
15 | super(null, 0.0F, 0.0F);
16 | paramDrawable.setBounds(paramRect);
17 | this.drawable = paramDrawable;
18 | this.lastflicker = System.currentTimeMillis();
19 | }
20 |
21 | public void draw(Canvas paramCanvas) {
22 | this.drawable.draw(paramCanvas);
23 | }
24 |
25 | public void update(float paramFloat1, float paramFloat2) {
26 | if (50L + this.lastflicker >= System.currentTimeMillis())
27 | return;
28 | this.drawable.setAlpha((int) (255.0F * (30.0F + MathHelper.rand.nextInt(25)) / 100.0F));
29 | this.lastflicker = System.currentTimeMillis();
30 | }
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/BearSceneView.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.graphics.BitmapFactory;
6 | import android.graphics.Canvas;
7 | import android.graphics.Rect;
8 | import android.util.AttributeSet;
9 | import android.view.View;
10 |
11 |
12 | public class BearSceneView extends View {
13 | public static final int WIND_RANDOMIZE_INTERVAL = 300;
14 | float HIGHEST_FLAMES_COORD = 0.4F;
15 | float HIGHEST_SMOKE_COORD = 0.6F;
16 | float LOWEST_FLAMES_COORD = 0.8F;
17 | ParticleSystem flames;
18 | int index = 0;
19 | long lastWindRandomChange;
20 | private boolean pause = false;
21 | private Renderable[] renderables;
22 | Smoke smoke;
23 | ParticleSystem sparks;
24 | private float wind = 10.0F;
25 | float windRanomizerEased;
26 | float windRanomizerTarget;
27 |
28 | public BearSceneView(Context paramContext) {
29 | super(paramContext);
30 | }
31 |
32 | public BearSceneView(Context paramContext, AttributeSet paramAttributeSet) {
33 | super(paramContext, paramAttributeSet);
34 | }
35 |
36 | public BearSceneView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) {
37 | super(paramContext, paramAttributeSet, paramInt);
38 | }
39 |
40 | private void addBear(float paramFloat1, float paramFloat2, Bitmap paramBitmap1, Bitmap paramBitmap2) {
41 | Renderable[] arrayOfRenderable = this.renderables;
42 | int i = this.index;
43 | Bitmap[] arrayOfBitmap = new Bitmap[2];
44 | arrayOfBitmap[0] = paramBitmap1;
45 | arrayOfBitmap[1] = paramBitmap2;
46 | arrayOfRenderable[i] = new RenderableBear(arrayOfBitmap, paramFloat1, paramFloat2);
47 | this.index = (1 + this.index);
48 | }
49 |
50 | private void addFire(Bitmap paramBitmap1, Bitmap paramBitmap2, float paramFloat1, float paramFloat2) {
51 | this.renderables[this.index] = new AuraDrawable(getResources().getDrawable(2130837564),
52 | new Rect((int) (0.44F * getMeasuredWidth()), (int) (0.4F * getMeasuredHeight()), (int) (0.8F * getMeasuredWidth()), (int) (1.1F * getMeasuredHeight())));
53 | this.index = (1 + this.index);
54 | this.renderables[this.index] = new AuraDrawable(getResources().getDrawable(2130837565), new Rect((int) (0.5F * getMeasuredWidth()), (int) (0.6F * getMeasuredHeight()), (int) (0.72F * getMeasuredWidth()), (int) (1.0F * getMeasuredHeight())));
55 | this.index = (1 + this.index);
56 | float f1 = getResources().getDisplayMetrics().density;
57 | float f2 = 5.0F * f1;
58 | this.flames = new ParticleSystem(paramFloat1, paramFloat2, 30, -30.0F * f1, f2);
59 | this.sparks = new ParticleSystem(paramFloat1, paramFloat2, 600, -30.0F * f1, f2);
60 | this.renderables[this.index] = this.flames;
61 | this.flames.setParticleSize((int) (8.0F * f1));
62 | this.flames.setRandomMovementX(20.0F * f1);
63 | this.flames.setRandomMovementY(1.5F * f1);
64 | this.flames.setColors(getResources().getColor(2131427367), getResources().getColor(2131427366));
65 | this.index = (1 + this.index);
66 | this.renderables[this.index] = this.sparks;
67 | this.sparks.setParticleSize((int) (1.0F * f1));
68 | this.sparks.setRandomMovementX(25.0F * f1);
69 | this.sparks.setRandomMovementY(2.5F * f1);
70 | this.sparks.setRandomMovementChangeInterval(900);
71 | this.sparks.setColors(getResources().getColor(2131427367), getResources().getColor(2131427367));
72 | this.sparks.setMinYCoord(0.0F);
73 | this.index = (1 + this.index);
74 | this.renderables[this.index] = new Renderable(paramBitmap2, paramFloat1 - 2.0F * f2, paramFloat2);
75 | this.index = (1 + this.index);
76 | this.smoke = new Smoke(paramBitmap1, paramFloat1, 0.68F * getMeasuredHeight(), 110.0F * f1, 60.0F * f1, 8, f1);
77 | this.renderables[this.index] = this.smoke;
78 | this.index = (1 + this.index);
79 | }
80 |
81 | private void addGrunge(Bitmap paramBitmap) {
82 | NoiseEffect localNoiseEffect = new NoiseEffect(paramBitmap, 100, 2.5F);
83 | this.renderables[this.index] = localNoiseEffect;
84 | localNoiseEffect.setNoiseIntensity(0.22F);
85 | this.index = (1 + this.index);
86 | }
87 |
88 | private void addWhiteBear(float paramFloat1, float paramFloat2, Bitmap paramBitmap) {
89 | this.renderables[this.index] = new Renderable(paramBitmap, paramFloat1, paramFloat2);
90 | this.index = (1 + this.index);
91 | }
92 |
93 | private void destroyResources() {
94 | Renderable[] arrayOfRenderable = this.renderables;
95 | int i = arrayOfRenderable.length;
96 | for (int j = 0; j < i; ++j)
97 | arrayOfRenderable[j].destroy();
98 | }
99 |
100 | private float getYCoordByPercent(float paramFloat) {
101 | return paramFloat * getHeight();
102 | }
103 |
104 | private void init() {
105 | this.renderables = new Renderable[17];
106 | Bitmap localBitmap1 = BitmapFactory.decodeResource(getResources(), 2130903051);
107 | addThree(localBitmap1, 0.18F * getMeasuredWidth(), -0.65F * getMeasuredHeight(), 0.28F, 0.46F);
108 | addThree(localBitmap1, 0.6F * getMeasuredWidth(), -0.65F * getMeasuredHeight(), 0.33F, 0.46F);
109 | addThree(localBitmap1, 0.45F * getMeasuredWidth(), -0.45F * getMeasuredHeight(), 0.5F, 0.8F);
110 | addThree(localBitmap1, 0.13F * getMeasuredWidth(), -0.65F * getMeasuredHeight(), 0.3F, 0.46F);
111 | addThree(localBitmap1, 0.83F * getMeasuredWidth(), -0.2F * getMeasuredHeight(), 0.5F, 1.0F);
112 | addThree(localBitmap1, 0.02F * getMeasuredWidth(), -0.1F * getMeasuredHeight(), 0.8F, 1.0F);
113 | addThree(localBitmap1, 0.18F * getMeasuredWidth(), 0.15F * getMeasuredHeight(), 0.8F, 1.0F);
114 | addThree(localBitmap1, 0.7F * getMeasuredWidth(), -0.1F * getMeasuredHeight(), 0.8F, 1.0F);
115 | Bitmap localBitmap2 = BitmapFactory.decodeResource(getResources(), 2130903040);
116 | Bitmap localBitmap3 = BitmapFactory.decodeResource(getResources(), 2130903041);
117 | Bitmap localBitmap4 = BitmapFactory.decodeResource(getResources(), 2130903042);
118 | Bitmap localBitmap5 = BitmapFactory.decodeResource(getResources(), 2130837588);
119 | Bitmap localBitmap6 = BitmapFactory.decodeResource(getResources(), 2130837582);
120 | Bitmap localBitmap7 = BitmapFactory.decodeResource(getResources(), 2130837570);
121 | addFire(localBitmap6, localBitmap5, 0.61F * getMeasuredWidth(), 0.8F * getMeasuredHeight());
122 | addBear(0.636F * getMeasuredWidth(), 0.59F * getMeasuredHeight(), localBitmap2, localBitmap3);
123 | addWhiteBear(0.44F * getMeasuredWidth(), 0.66F * getMeasuredHeight(), localBitmap4);
124 | setLayerType(2, null);
125 | addGrunge(localBitmap7);
126 | }
127 |
128 | void addThree(Bitmap paramBitmap, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4) {
129 | this.renderables[this.index] = new RenderableThree(paramBitmap, paramFloat1, paramFloat2, paramFloat4);
130 | this.renderables[this.index].setScale(paramFloat3, paramFloat3);
131 | this.index = (1 + this.index);
132 | }
133 |
134 | protected void onAttachedToWindow() {
135 | super.onAttachedToWindow();
136 | if ((this.renderables != null) || (getWidth() == 0))
137 | return;
138 | init();
139 | }
140 |
141 | protected void onDetachedFromWindow() {
142 | super.onDetachedFromWindow();
143 | destroyResources();
144 | }
145 |
146 | protected void onDraw(Canvas paramCanvas) {
147 | super.onDraw(paramCanvas);
148 | float f1 = FrameRateCounter.timeStep();
149 | this.windRanomizerEased += f1 * (4.0F * (this.windRanomizerTarget - this.windRanomizerEased));
150 | Renderable[] arrayOfRenderable = this.renderables;
151 | int i = arrayOfRenderable.length;
152 | int j = 0;
153 | // if (j < i) {
154 | // label45:
155 | // Renderable localRenderable = arrayOfRenderable[j];
156 | // localRenderable.draw(paramCanvas);
157 | // if ((localRenderable instanceof Smoke) || (localRenderable instanceof ParticleSystem))
158 | // localRenderable.update(f1, this.wind);
159 | // while (true) {
160 | // ++j;
161 | // break label45:
162 | // localRenderable.update(f1, this.wind + this.windRanomizerEased);
163 | // }
164 | // }
165 | if (300L + this.lastWindRandomChange < System.currentTimeMillis()) {
166 | this.lastWindRandomChange = System.currentTimeMillis();
167 | float f2 = Math.max(this.wind / 2.0F, 1.0F);
168 | this.windRanomizerTarget = (MathHelper.rand.nextInt((int) f2) - f2 / 2.0F);
169 | }
170 | if (this.pause)
171 | return;
172 | invalidate();
173 | }
174 |
175 | protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
176 | super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
177 | if (this.renderables != null)
178 | return;
179 | init();
180 | }
181 |
182 | public void setFlamesHeight(int paramInt) {
183 | float f1 = getYCoordByPercent(this.LOWEST_FLAMES_COORD - (this.LOWEST_FLAMES_COORD - this.HIGHEST_FLAMES_COORD) * (paramInt / 100.0F));
184 | this.flames.setMinYCoord(f1);
185 | float f2 = getYCoordByPercent(this.LOWEST_FLAMES_COORD - (this.LOWEST_FLAMES_COORD - this.HIGHEST_SMOKE_COORD) * (paramInt / 100.0F));
186 | this.smoke.setY(f2);
187 | }
188 |
189 | public void setPause(boolean paramBoolean) {
190 | int i = 0;
191 | this.pause = paramBoolean;
192 | if (!paramBoolean) {
193 | FrameRateCounter.timeStep();
194 | invalidate();
195 | Renderable[] arrayOfRenderable2 = this.renderables;
196 | int k = arrayOfRenderable2.length;
197 | while (true) {
198 | if (i >= k)
199 | return;
200 | arrayOfRenderable2[i].resume();
201 | ++i;
202 | }
203 | }
204 | Renderable[] arrayOfRenderable1 = this.renderables;
205 | int j = arrayOfRenderable1.length;
206 | while (i < j) {
207 | arrayOfRenderable1[i].pause();
208 | ++i;
209 | }
210 | }
211 |
212 | public void setWind(int paramInt) {
213 | this.wind = paramInt;
214 | }
215 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/Foam.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Path;
5 | import android.graphics.PathMeasure;
6 |
7 | public class Foam extends PathBitmapMesh {
8 | float[] easedFoamCoords;
9 | float[] foamCoords;
10 | float maxHeight;
11 | float minHeight;
12 | private float verticalOffset;
13 |
14 | public Foam(int paramInt1, int paramInt2, Bitmap paramBitmap, float paramFloat1, float paramFloat2, int paramInt3) {
15 | super(paramInt1, paramInt2, paramBitmap, paramInt3);
16 | setupFoam(paramInt1);
17 | this.minHeight = paramFloat1;
18 | this.maxHeight = paramFloat2;
19 | }
20 |
21 | private void setupFoam(int paramInt) {
22 | this.foamCoords = new float[paramInt];
23 | this.easedFoamCoords = new float[paramInt];
24 | for (int i = 0; i < paramInt; ++i) {
25 | this.foamCoords[i] = 0.0F;
26 | this.easedFoamCoords[i] = 0.0F;
27 | }
28 | }
29 |
30 | void calcWave() {
31 | for (int i = 0; i < this.foamCoords.length; ++i)
32 | this.foamCoords[i] = MathHelper.randomRange(this.minHeight, this.maxHeight);
33 | }
34 |
35 | public void matchVertsToPath(Path paramPath, float paramFloat) {
36 | PathMeasure localPathMeasure = new PathMeasure(paramPath, false);
37 | int i = 0;
38 | int j = 0;
39 | if (j >= this.staticVerts.length / 2)
40 | label16:return;
41 | float f1 = this.staticVerts[(1 + j * 2)];
42 | float f2 = this.staticVerts[(j * 2)];
43 | float f3 = (1.0E-006F + f2) / this.bitmap.getWidth();
44 | float f4 = (1.0E-006F + f2) / (paramFloat + this.bitmap.getWidth()) + this.pathOffsetPercent;
45 | localPathMeasure.getPosTan(localPathMeasure.getLength() * (1.0F - f3), this.coords, null);
46 | localPathMeasure.getPosTan(localPathMeasure.getLength() * (1.0F - f4), this.coords2, null);
47 | if (f1 == 0.0F)
48 | setXY(this.drawingVerts, j, this.coords[0], this.coords2[1] + this.verticalOffset);
49 | while (true) {
50 | ++j;
51 | // break
52 | // label16: //todo cjj
53 | float f5 = Math.max(this.coords2[1], this.coords2[1] + this.easedFoamCoords[Math.min(-1 + this.easedFoamCoords.length, i)]);
54 | setXY(this.drawingVerts, j, this.coords[0], f5 + this.verticalOffset);
55 | ++i;
56 | }
57 | }
58 |
59 | public void setVerticalOffset(float paramFloat) {
60 | this.verticalOffset = paramFloat;
61 | }
62 |
63 | void update(float paramFloat) {
64 | for (int i = 0; i < this.foamCoords.length; ++i) {
65 | float[] arrayOfFloat = this.easedFoamCoords;
66 | arrayOfFloat[i] += paramFloat * (this.foamCoords[i] - this.easedFoamCoords[i]);
67 | }
68 | }
69 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/FrameRateCounter.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.os.SystemClock;
4 |
5 | public class FrameRateCounter {
6 | private static long mLastTime;
7 |
8 | public static float timeStep() {
9 | long l1 = SystemClock.uptimeMillis();
10 | long l2 = l1 - mLastTime;
11 | boolean bool = (float) mLastTime < 0.0F;
12 | float f = 0.0F;
13 | if (bool) {
14 | f = (float) l2 / 1000.0F;
15 | }
16 | mLastTime = l1;
17 | return Math.min(0.021F, f);
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/MathHelper.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import java.util.Random;
4 |
5 | public class MathHelper {
6 | public static Random rand = new Random();
7 |
8 | public static float randomRange(float paramFloat1, float paramFloat2) {
9 | return rand.nextInt(1 + ((int) paramFloat2 - (int) paramFloat1)) + (int) paramFloat1;
10 | }
11 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/NoiseEffect.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.BitmapShader;
5 | import android.graphics.Canvas;
6 | import android.graphics.Matrix;
7 | import android.graphics.Paint;
8 | import android.graphics.PorterDuff;
9 | import android.graphics.PorterDuffXfermode;
10 | import android.graphics.Shader;
11 | import android.graphics.Xfermode;
12 |
13 |
14 | public class NoiseEffect extends Renderable {
15 | private static final Xfermode[] sModes;
16 | private int grainFPS;
17 | long lastGrainOffset;
18 | Matrix matrix;
19 | private Paint paint = new Paint();
20 | float scale;
21 | BitmapShader shader;
22 |
23 | static {
24 | Xfermode[] arrayOfXfermode = new Xfermode[16];
25 | arrayOfXfermode[0] = new PorterDuffXfermode(PorterDuff.Mode.CLEAR);
26 | arrayOfXfermode[1] = new PorterDuffXfermode(PorterDuff.Mode.SRC);
27 | arrayOfXfermode[2] = new PorterDuffXfermode(PorterDuff.Mode.DST);
28 | arrayOfXfermode[3] = new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER);
29 | arrayOfXfermode[4] = new PorterDuffXfermode(PorterDuff.Mode.DST_OVER);
30 | arrayOfXfermode[5] = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN);
31 | arrayOfXfermode[6] = new PorterDuffXfermode(PorterDuff.Mode.DST_IN);
32 | arrayOfXfermode[7] = new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT);
33 | arrayOfXfermode[8] = new PorterDuffXfermode(PorterDuff.Mode.DST_OUT);
34 | arrayOfXfermode[9] = new PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP);
35 | arrayOfXfermode[10] = new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP);
36 | arrayOfXfermode[11] = new PorterDuffXfermode(PorterDuff.Mode.XOR);
37 | arrayOfXfermode[12] = new PorterDuffXfermode(PorterDuff.Mode.DARKEN);
38 | arrayOfXfermode[13] = new PorterDuffXfermode(PorterDuff.Mode.LIGHTEN);
39 | arrayOfXfermode[14] = new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY);
40 | arrayOfXfermode[15] = new PorterDuffXfermode(PorterDuff.Mode.SCREEN);
41 | sModes = arrayOfXfermode;
42 | }
43 |
44 | public NoiseEffect(Bitmap paramBitmap, int paramInt, float paramFloat) {
45 | super(paramBitmap, 0.0F, 0.0F);
46 | this.shader = new BitmapShader(paramBitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
47 | this.matrix = new Matrix();
48 | this.shader.setLocalMatrix(this.matrix);
49 | this.paint.setShader(this.shader);
50 | this.paint.setAlpha(144);
51 | this.paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SCREEN));
52 | this.lastGrainOffset = System.currentTimeMillis();
53 | this.grainFPS = paramInt;
54 | this.scale = paramFloat;
55 | }
56 |
57 | public void draw(Canvas paramCanvas) {
58 | paramCanvas.drawPaint(this.paint);
59 | }
60 |
61 | public void setNoiseIntensity(float paramFloat) {
62 | this.paint.setAlpha((int) (255.0F * paramFloat));
63 | }
64 |
65 | public void update(float paramFloat1, float paramFloat2) {
66 | if (this.lastGrainOffset + this.grainFPS >= System.currentTimeMillis())
67 | return;
68 | this.matrix.reset();
69 | this.matrix.setScale(this.scale, this.scale);
70 | this.matrix.postTranslate(MathHelper.randomRange(10.0F * -this.bitmap.getWidth(), 10.0F * this.bitmap.getWidth()), MathHelper.randomRange(10.0F * -this.bitmap.getHeight(), 10.0F * this.bitmap.getHeight()));
71 | this.shader.setLocalMatrix(this.matrix);
72 | this.lastGrainOffset = System.currentTimeMillis();
73 | }
74 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/Particle.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | public class Particle extends Renderable {
4 | long lastRandomizeChange;
5 | float randomSpeedX;
6 | float randomSpeedY;
7 |
8 | public Particle(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4) {
9 | super(null, paramFloat1, paramFloat2);
10 | this.randomSpeedX = paramFloat3;
11 | this.randomSpeedY = paramFloat4;
12 | this.lastRandomizeChange = System.currentTimeMillis();
13 | }
14 |
15 | public void setRandomSpeed(float paramFloat1, float paramFloat2) {
16 | this.randomSpeedX = paramFloat1;
17 | this.randomSpeedY = paramFloat2;
18 | }
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/ParticleSystem.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.animation.ArgbEvaluator;
4 | import android.animation.ValueAnimator;
5 | import android.graphics.Canvas;
6 | import android.graphics.Color;
7 | import android.graphics.Paint;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | public class ParticleSystem extends Renderable {
13 | public static final int DURATION = 10000;
14 | ValueAnimator color;
15 | private int emitInterWall;
16 | int endColor;
17 | private float gravityY;
18 | long lastEmit = System.currentTimeMillis();
19 | private float minYCoord;
20 | List paricles = new ArrayList();
21 | Paint particlePaint = new Paint();
22 | int particleSize = 20;
23 | private int randomMovementChangeInterval = 2000;
24 | float randomMovementX = 10.0F;
25 | private float randomMovementY;
26 | private float randomXPlacement;
27 | int startColor;
28 |
29 | public ParticleSystem(float paramFloat1, float paramFloat2, int paramInt, float paramFloat3, float paramFloat4) {
30 | super(null, paramFloat1, paramFloat2);
31 | this.particlePaint.setColor(Color.WHITE);//todo cjj
32 | this.emitInterWall = paramInt;
33 | this.gravityY = paramFloat3;
34 | this.randomXPlacement = paramFloat4;
35 | }
36 |
37 | private void addParticle() {
38 | this.paricles.add(new Particle(this.x + MathHelper.randomRange(-this.randomXPlacement, this.randomXPlacement), this.y, MathHelper.randomRange(-this.randomMovementX, this.randomMovementX), MathHelper.randomRange(-this.randomMovementY, this.randomMovementY)));
39 | this.lastEmit = System.currentTimeMillis();
40 | }
41 |
42 | public void draw(Canvas paramCanvas) {
43 | for (int i = 0; i < this.paricles.size(); ++i) {
44 | Particle localParticle = (Particle) this.paricles.get(i);
45 | setParticlePaintColor(localParticle);
46 | paramCanvas.drawRect(localParticle.x, localParticle.y, localParticle.x + this.particleSize, localParticle.y + this.particleSize, this.particlePaint);
47 | }
48 | }
49 |
50 | public void setColors(int paramInt1, int paramInt2) {
51 | this.startColor = paramInt1;
52 | this.endColor = paramInt2;
53 | ArgbEvaluator localArgbEvaluator = new ArgbEvaluator();
54 | Object[] arrayOfObject = new Object[3];
55 | arrayOfObject[0] = Integer.valueOf(paramInt1);
56 | arrayOfObject[1] = Integer.valueOf(paramInt2);
57 | arrayOfObject[2] = Integer.valueOf(0);
58 | this.color = ValueAnimator.ofObject(localArgbEvaluator, arrayOfObject).setDuration(10000L);
59 | }
60 |
61 | public void setMinYCoord(float paramFloat) {
62 | this.minYCoord = paramFloat;
63 | }
64 |
65 | public void setParticlePaintColor(Particle paramParticle) {
66 | float f = (this.y - paramParticle.y) / (this.y - this.minYCoord);
67 | this.color.setCurrentPlayTime((long) (10000.0F * f));
68 | this.particlePaint.setColor(((Integer) this.color.getAnimatedValue()).intValue());
69 | }
70 |
71 | public void setParticleSize(int paramInt) {
72 | this.particleSize = paramInt;
73 | }
74 |
75 | public void setRandomMovementChangeInterval(int paramInt) {
76 | this.randomMovementChangeInterval = paramInt;
77 | }
78 |
79 | public void setRandomMovementX(float paramFloat) {
80 | this.randomMovementX = paramFloat;
81 | }
82 |
83 | public void setRandomMovementY(float paramFloat) {
84 | this.randomMovementY = paramFloat;
85 | }
86 |
87 | public void update(float paramFloat1, float paramFloat2) {
88 | long l = System.currentTimeMillis();
89 | if (this.lastEmit + this.emitInterWall < l)
90 | addParticle();
91 | for (int i = 0; i < this.paricles.size(); ++i) {
92 | Particle localParticle = (Particle) this.paricles.get(i);
93 | localParticle.y += paramFloat1 * this.gravityY;
94 | localParticle.y += paramFloat1 * localParticle.randomSpeedY;
95 | localParticle.x += paramFloat1 * localParticle.randomSpeedX;
96 | localParticle.x += paramFloat2 * paramFloat1;
97 | if (localParticle.lastRandomizeChange + this.randomMovementChangeInterval < l) {
98 | localParticle.lastRandomizeChange = System.currentTimeMillis();
99 | localParticle.setRandomSpeed(MathHelper.randomRange(-this.randomMovementX, this.randomMovementX), MathHelper.randomRange(-this.randomMovementY, this.randomMovementY));
100 | }
101 | if (localParticle.y >= this.minYCoord)
102 | continue;
103 | this.paricles.remove(i);
104 | --i;
105 | }
106 | }
107 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/PathBitmapMesh.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.animation.ValueAnimator;
4 | import android.graphics.Bitmap;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.Path;
8 | import android.graphics.PathMeasure;
9 | import android.view.animation.LinearInterpolator;
10 |
11 | public class PathBitmapMesh {
12 | private static final int HORIZONTAL_SLICES = 6;
13 | private static final int VERTICAL_SLICES = 1;
14 | Bitmap bitmap;
15 | float[] coords = new float[2];
16 | float[] coords2 = new float[2];
17 | float[] drawingVerts = new float[2 * this.totaolSlicesCount];
18 | int horizontalSlices;
19 | Paint paint = new Paint();
20 | ValueAnimator pathOffset;
21 | float pathOffsetPercent = 1.0F;
22 | final float[] staticVerts = new float[2 * this.totaolSlicesCount];
23 | private int totaolSlicesCount = 14;
24 | int verticalSlices;
25 |
26 | public PathBitmapMesh(int paramInt1, int paramInt2, Bitmap paramBitmap, int paramInt3) {
27 | this.horizontalSlices = paramInt1;
28 | this.verticalSlices = paramInt2;
29 | this.bitmap = paramBitmap;
30 | createVerts();
31 | startWaveAnim(paramBitmap, paramInt1, paramInt3);
32 | }
33 |
34 | private void createVerts() {
35 | float f1 = this.bitmap.getWidth();
36 | float f2 = this.bitmap.getHeight();
37 | int i = 0;
38 | for (int j = 0; j <= 1; ++j) {
39 | float f3 = f2 * j / 1.0F;
40 | for (int k = 0; k <= 6; ++k) {
41 | float f4 = f1 * k / 6.0F;
42 | setXY(this.drawingVerts, i, f4, f3);
43 | setXY(this.staticVerts, i, f4, f3);
44 | ++i;
45 | }
46 | }
47 | }
48 |
49 | private void startWaveAnim(Bitmap paramBitmap, float paramFloat, int paramInt) {
50 | float[] arrayOfFloat = new float[2];
51 | arrayOfFloat[0] = 0.0F;
52 | arrayOfFloat[1] = (2.0F * (paramBitmap.getWidth() / paramFloat) / paramBitmap.getWidth());
53 | this.pathOffset = ValueAnimator.ofFloat(arrayOfFloat).setDuration(paramInt);
54 | this.pathOffset.setRepeatCount(-1);
55 | this.pathOffset.setRepeatMode(1);
56 | this.pathOffset.addUpdateListener(new jjUpdateListtener());
57 | this.pathOffset.setInterpolator(new LinearInterpolator());
58 | this.pathOffset.start();
59 | }
60 |
61 | public void destroy() {
62 | this.pathOffset.cancel();
63 | if ((this.bitmap == null) || (this.bitmap.isRecycled()))
64 | return;
65 | this.bitmap.recycle();
66 | this.bitmap = null;
67 | }
68 |
69 | public void draw(Canvas paramCanvas) {
70 | paramCanvas.drawBitmapMesh(this.bitmap, 6, 1, this.drawingVerts, 0, null, 0, this.paint);
71 | }
72 |
73 | public Bitmap getBitmap() {
74 | return this.bitmap;
75 | }
76 |
77 | public void matchVertsToPath(Path paramPath, float paramFloat1, float paramFloat2) {
78 | PathMeasure localPathMeasure = new PathMeasure(paramPath, false);
79 | int i = 0;
80 | if (i >= this.staticVerts.length / 2)
81 | label14:return;
82 | float f1 = this.staticVerts[(1 + i * 2)];
83 | float f2 = this.staticVerts[(i * 2)];
84 | float f3 = (1.0E-006F + f2) / this.bitmap.getWidth();
85 | float f4 = (1.0E-006F + f2) / (paramFloat2 + this.bitmap.getWidth()) + this.pathOffsetPercent;
86 | localPathMeasure.getPosTan(localPathMeasure.getLength() * (1.0F - f3), this.coords, null);
87 | localPathMeasure.getPosTan(localPathMeasure.getLength() * (1.0F - f4), this.coords2, null);
88 | if (f1 == 0.0F)
89 | setXY(this.drawingVerts, i, this.coords[0], this.coords2[1]);
90 | while (true) {
91 | ++i;
92 | // break label14: //// TODO: 2016/4/19
93 | setXY(this.drawingVerts, i, this.coords[0], paramFloat1);
94 | }
95 | }
96 |
97 | public void pause() {
98 | this.pathOffset.pause();
99 | }
100 |
101 | public void resume() {
102 | this.pathOffset.resume();
103 | }
104 |
105 | public void setAlpha(int paramInt) {
106 | this.paint.setAlpha(paramInt);
107 | }
108 |
109 | public void setXY(float[] paramArrayOfFloat, int paramInt, float paramFloat1, float paramFloat2) {
110 | paramArrayOfFloat[(0 + paramInt * 2)] = paramFloat1;
111 | paramArrayOfFloat[(1 + paramInt * 2)] = paramFloat2;
112 | }
113 |
114 | class jjUpdateListtener implements ValueAnimator.AnimatorUpdateListener {
115 | public void onAnimationUpdate(ValueAnimator paramValueAnimator) {
116 | pathOffsetPercent = ((Float) paramValueAnimator.getAnimatedValue()).floatValue();
117 | }
118 | }
119 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/Renderable.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Canvas;
5 | import android.graphics.RectF;
6 |
7 | public class Renderable {
8 | public Bitmap bitmap;
9 | float scaleX = 1.0F;
10 | float scaleY = 1.0F;
11 | public float translationX;
12 | public float translationY;
13 | public float x;
14 | public float y;
15 |
16 | public Renderable(Bitmap paramBitmap, float paramFloat1, float paramFloat2) {
17 | this.x = paramFloat1;
18 | this.y = paramFloat2;
19 | this.bitmap = paramBitmap;
20 | }
21 |
22 | public void destroy() {
23 | if ((this.bitmap == null) || (this.bitmap.isRecycled()))
24 | return;
25 | this.bitmap.recycle();
26 | this.bitmap = null;
27 | }
28 |
29 | public void draw(Canvas paramCanvas) {
30 | paramCanvas.save();
31 | paramCanvas.drawBitmap(this.bitmap, this.x + this.translationX / 2.0F, this.y + this.translationY, null);
32 | paramCanvas.restore();
33 | }
34 |
35 | public void drawStretched(Canvas paramCanvas, float paramFloat) {
36 | paramCanvas.save();
37 | paramCanvas.drawBitmap(this.bitmap, null, new RectF(this.x + this.translationX / 2.0F, this.y + this.translationY, paramFloat + (this.x + this.translationX / 2.0F), this.y + this.translationY + this.bitmap.getHeight()), null);
38 | paramCanvas.restore();
39 | }
40 |
41 | public float getTranslationX() {
42 | return this.translationX;
43 | }
44 |
45 | public float getTranslationY() {
46 | return this.translationY;
47 | }
48 |
49 | public void pause() {
50 | }
51 |
52 | public void resume() {
53 | }
54 |
55 | public void setScale(float paramFloat1, float paramFloat2) {
56 | }
57 |
58 | public void setTranslationX(float paramFloat) {
59 | this.translationX = paramFloat;
60 | }
61 |
62 | public void setTranslationY(float paramFloat) {
63 | this.translationY = paramFloat;
64 | }
65 |
66 | public void setTranslationY(Float paramFloat) {
67 | this.translationY = paramFloat.floatValue();
68 | }
69 |
70 | public void setY(float paramFloat) {
71 | this.y = paramFloat;
72 | }
73 |
74 | public void update(float paramFloat1, float paramFloat2) {
75 | }
76 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/RenderableBear.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Canvas;
5 |
6 | public class RenderableBear extends Renderable {
7 | public static final int FRAME_DELAY = 2500;
8 | int bitmapIndex = 0;
9 | Bitmap[] bitmaps;
10 | long lastFrameChange = System.currentTimeMillis();
11 |
12 | public RenderableBear(Bitmap[] paramArrayOfBitmap, float paramFloat1, float paramFloat2) {
13 | super(null, paramFloat1, paramFloat2);
14 | this.bitmaps = paramArrayOfBitmap;
15 | }
16 |
17 | public void destroy() {
18 | for (Bitmap localBitmap : this.bitmaps) {
19 | if ((localBitmap == null) || (localBitmap.isRecycled()))
20 | continue;
21 | localBitmap.recycle();
22 | }
23 | }
24 |
25 | public void draw(Canvas paramCanvas) {
26 | paramCanvas.save();
27 | paramCanvas.drawBitmap(this.bitmaps[this.bitmapIndex], this.x + this.translationX / 2.0F, this.y + this.translationY, null);
28 | paramCanvas.restore();
29 | }
30 |
31 | public void update(float paramFloat1, float paramFloat2) {
32 | super.update(paramFloat1, paramFloat2);
33 | if (2500L + this.lastFrameChange >= System.currentTimeMillis())
34 | return;
35 | this.lastFrameChange = System.currentTimeMillis();
36 | this.bitmapIndex = (1 + this.bitmapIndex);
37 | if (this.bitmapIndex != this.bitmaps.length)
38 | return;
39 | this.bitmapIndex = 0;
40 | }
41 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/RenderableThree.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Canvas;
5 | import android.graphics.Color;
6 | import android.graphics.Paint;
7 | import android.graphics.Path;
8 | import android.graphics.PathMeasure;
9 |
10 | import com.facebook.rebound.SimpleSpringListener;
11 | import com.facebook.rebound.Spring;
12 | import com.facebook.rebound.SpringConfig;
13 | import com.facebook.rebound.SpringSystem;
14 |
15 |
16 | public class RenderableThree extends Renderable {
17 | private static final int HORIZONTAL_SLICES = 1;
18 | private static final int TOTAL_SLICES_COUNT = 192;
19 | private static final int VERTICAL_SLICES = 95;
20 | private final float[] drawingVerts = new float[384];
21 | private boolean isBounceAnimatin = false;
22 | private float offsetInPercent;
23 | private Paint p = new Paint();
24 | private Paint paint = new Paint();
25 | private Path pathLeft = new Path();
26 | private Path pathRight = new Path();
27 | Spring spring;
28 | private SpringSystem springSystem = SpringSystem.create();
29 | private final float[] staticVerts = new float[384];
30 |
31 | public RenderableThree(Bitmap paramBitmap, float paramFloat1, float paramFloat2, float paramFloat3) {
32 | super(paramBitmap, paramFloat1, paramFloat2);
33 | this.p.setColor(Color.GREEN);//// TODO: 2016/4/19 cjj
34 | this.p.setStrokeWidth(6.0F);
35 | this.p.setStyle(Paint.Style.STROKE);
36 | createVerts();
37 | this.paint.setAlpha((int) (255.0F * paramFloat3));
38 | }
39 |
40 | private void createPath() {
41 | this.pathLeft.reset();
42 | this.pathLeft.moveTo(this.x, this.y + this.bitmap.getHeight());
43 | this.pathLeft.cubicTo(this.x, this.y + this.bitmap.getHeight(), this.x, this.y, this.x + 1.5F * this.bitmap.getWidth() * this.offsetInPercent, this.y);
44 | this.pathRight.reset();
45 | this.pathRight.moveTo(this.x + this.bitmap.getWidth(), this.y + this.bitmap.getHeight());
46 | this.pathRight.cubicTo(this.x + this.bitmap.getWidth(), this.y + this.bitmap.getHeight(), this.x + this.bitmap.getWidth(), this.y + 0.3F * this.bitmap.getWidth() * this.offsetInPercent, this.x + this.bitmap.getWidth() + this.bitmap.getWidth() / 2 * this.offsetInPercent, this.y + 0.8F * this.bitmap.getWidth() * this.offsetInPercent);
47 | matchVertsToPath();
48 | }
49 |
50 | private void createVerts() {
51 | float f1 = this.bitmap.getWidth();
52 | float f2 = this.bitmap.getHeight();
53 | int i = 0;
54 | for (int j = 0; j <= 95; ++j) {
55 | float f3 = f2 * j / 95.0F;
56 | for (int k = 0; k <= 1; ++k) {
57 | float f4 = f1 * k / 1.0F;
58 | setXY(this.drawingVerts, i, f4, f3);
59 | setXY(this.staticVerts, i, f4, f3);
60 | ++i;
61 | }
62 | }
63 | }
64 |
65 | private void matchVertsToPath() {
66 | PathMeasure localPathMeasure1 = new PathMeasure(this.pathLeft, false);
67 | PathMeasure localPathMeasure2 = new PathMeasure(this.pathRight, false);
68 | float[] arrayOfFloat = new float[2];
69 | int i = 0;
70 | if (i >= this.staticVerts.length / 2)
71 | label33:return;
72 | float f1 = this.staticVerts[(1 + i * 2)];
73 | if (this.staticVerts[(i * 2)] == 0.0F) {
74 | float f3 = (1.0E-006F + f1) / this.bitmap.getHeight();
75 | localPathMeasure1.getPosTan(localPathMeasure1.getLength() * (1.0F - f3), arrayOfFloat, null);
76 | setXY(this.drawingVerts, i, arrayOfFloat[0], arrayOfFloat[1]);
77 | }
78 | while (true) {
79 | ++i;
80 | // break label33://// TODO: 2016/4/19
81 | float f2 = (1.0E-006F + f1) / this.bitmap.getHeight();
82 | localPathMeasure2.getPosTan(localPathMeasure2.getLength() * (1.0F - f2), arrayOfFloat, null);
83 | setXY(this.drawingVerts, i, arrayOfFloat[0], arrayOfFloat[1]);
84 | }
85 | }
86 |
87 | public void bounceBack() {
88 | cancelBounce();
89 | this.isBounceAnimatin = true;
90 | this.spring = this.springSystem.createSpring();
91 | this.spring.setSpringConfig(SpringConfig.fromOrigamiTensionAndFriction(150.0D, 4.0D));
92 | float f = this.offsetInPercent;
93 | this.spring.addListener(new JJSimpleSpringListener());
94 | this.spring.setEndValue(1.0D);
95 | }
96 |
97 | public void cancelBounce() {
98 | if (this.spring != null)
99 | this.spring.destroy();
100 | this.isBounceAnimatin = false;
101 | }
102 |
103 | public void draw(Canvas paramCanvas) {
104 | createPath();
105 | paramCanvas.save();
106 | if ((this.scaleX != 1.0F) || (this.scaleY != 1.0F))
107 | paramCanvas.scale(this.scaleX, this.scaleY, this.x + this.bitmap.getWidth() / 2, this.y + this.bitmap.getHeight());
108 | paramCanvas.drawBitmapMesh(this.bitmap, 1, 95, this.drawingVerts, 0, null, 0, this.paint);
109 | paramCanvas.restore();
110 | }
111 |
112 | public boolean isBounceAnimatin() {
113 | return this.isBounceAnimatin;
114 | }
115 |
116 | public void setOffsetPercent(float paramFloat) {
117 | if (this.isBounceAnimatin)
118 | return;
119 | this.offsetInPercent = paramFloat;
120 | }
121 |
122 | public void setScale(float paramFloat1, float paramFloat2) {
123 | this.scaleX = paramFloat1;
124 | this.scaleY = paramFloat2;
125 | }
126 |
127 | public void setXA(float[] paramArrayOfFloat, int paramInt, float paramFloat) {
128 | paramArrayOfFloat[(0 + paramInt * 2)] = paramFloat;
129 | }
130 |
131 | public void setXY(float[] paramArrayOfFloat, int paramInt, float paramFloat1, float paramFloat2) {
132 | paramArrayOfFloat[(0 + paramInt * 2)] = paramFloat1;
133 | paramArrayOfFloat[(1 + paramInt * 2)] = paramFloat2;
134 | }
135 |
136 | public void setYA(float[] paramArrayOfFloat, int paramInt, float paramFloat) {
137 | paramArrayOfFloat[(1 + paramInt * 2)] = (paramFloat + this.staticVerts[(1 + paramInt * 2)]);
138 | }
139 |
140 | public void update(float paramFloat1, float paramFloat2) {
141 | super.update(paramFloat1, paramFloat2);
142 | setOffsetPercent(paramFloat2 / 100.0F);
143 | }
144 |
145 |
146 | class JJSimpleSpringListener extends SimpleSpringListener
147 | {
148 | public void onSpringAtRest(Spring paramSpring)
149 | {
150 | super.onSpringAtRest(paramSpring);
151 | // RenderableThree.access$102(this.this$0, false);
152 | // RenderableThree.
153 | }
154 |
155 | public void onSpringUpdate(Spring paramSpring)
156 | {
157 | float f = (float)paramSpring.getCurrentValue();
158 | // RenderableThree.access$002(this.this$0, this.val$offsetAtStart - f * this.val$offsetAtStart);
159 | }
160 | }
161 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/Smoke.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.animation.ValueAnimator;
4 | import android.graphics.Bitmap;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.Path;
8 | import android.graphics.PathMeasure;
9 | import android.view.animation.DecelerateInterpolator;
10 | import android.view.animation.LinearInterpolator;
11 |
12 | public class Smoke extends Renderable {
13 | private static final int HORIZONTAL_SLICES = 1;
14 | private static final int TOTAL_SLICES_COUNT = 162;
15 | private static final int VERTICAL_SLICES = 80;
16 | public static final float WIND_SENSITIVITY = 7.0F;
17 | float[] coords = new float[2];
18 | float[] coords2 = new float[2];
19 | float density;
20 | private final float[] drawingVerts = new float[324];
21 | float height;
22 | int numberOfTurns;
23 | Paint paint = new Paint();
24 | float pathPointOffset = 1.0F;
25 | ValueAnimator pathPointOffsetAnim;
26 | DecelerateInterpolator smokeExponentionWindStuff = new DecelerateInterpolator(1.0F);
27 | Path smokePath = new Path();
28 | private final float[] staticVerts = new float[324];
29 | float width;
30 |
31 | public Smoke(Bitmap paramBitmap, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, int paramInt, float paramFloat5) {
32 | super(paramBitmap, paramFloat1, paramFloat2);
33 | this.height = paramFloat3;
34 | this.width = paramFloat4;
35 | this.numberOfTurns = paramInt;
36 | this.paint.setStyle(Paint.Style.STROKE);
37 | this.density = paramFloat5;
38 | createVerts();
39 | createPath();
40 | float[] arrayOfFloat = new float[2];
41 | arrayOfFloat[0] = 0.0F;
42 | arrayOfFloat[1] = (2.0F * (paramBitmap.getHeight() / paramInt) / paramBitmap.getHeight());
43 | this.pathPointOffsetAnim = ValueAnimator.ofFloat(arrayOfFloat).setDuration(1500L);
44 | this.pathPointOffsetAnim.setRepeatCount(-1);
45 | this.pathPointOffsetAnim.setRepeatMode(1);
46 | // this.pathPointOffsetAnim.addUpdateListener(new Smoke .1 (this)); //// TODO: 2016/4/19
47 | this.pathPointOffsetAnim.setInterpolator(new LinearInterpolator());
48 | this.pathPointOffsetAnim.start();
49 | createPath();
50 | }
51 |
52 | private void createPath() {
53 | this.smokePath.reset();
54 | this.smokePath.moveTo(this.x, this.y);
55 | int i = (int) (this.height / this.numberOfTurns);
56 | int j = 1;
57 | int k = 0;
58 | if (k >= this.numberOfTurns)
59 | label38:return;
60 | if (j != 0) {
61 | this.smokePath.cubicTo(this.x, this.y - i * k, this.x + this.width, this.y - i * k - i / 2, this.x, this.y - i * k - i);
62 | // label109:
63 | // if (j != 0)
64 | // break label183;
65 | }
66 | for (j = 1; ; j = 0) {
67 | ++k;
68 | // break label38:
69 | this.smokePath.cubicTo(this.x, this.y - i * k, this.x - this.width, this.y - i * k - i / 2, this.x, this.y - i * k - i);
70 | // label183:
71 | // break label109:
72 | }
73 | }
74 |
75 | private void createVerts() {
76 | float f1 = this.bitmap.getWidth();
77 | float f2 = this.bitmap.getHeight();
78 | int i = 0;
79 | for (int j = 0; j <= 80; ++j) {
80 | float f3 = f2 * j / 80.0F;
81 | for (int k = 0; k <= 1; ++k) {
82 | float f4 = f1 * k / 1.0F;
83 | setXY(this.drawingVerts, i, f4, f3);
84 | setXY(this.staticVerts, i, f4, f3);
85 | ++i;
86 | }
87 | }
88 | }
89 |
90 | private void matchVertsToPath(float paramFloat) {
91 | PathMeasure localPathMeasure = new PathMeasure(this.smokePath, false);
92 | int i = 0;
93 | if (i >= this.staticVerts.length / 2)
94 | label15:return;
95 | float f1 = this.staticVerts[(1 + i * 2)];
96 | float f2 = this.staticVerts[(i * 2)];
97 | float f3 = (1.0E-006F + f1) / this.bitmap.getHeight();
98 | float f4 = (1.0E-006F + f1) / (this.bitmap.getHeight() + 4.0F * (this.bitmap.getHeight() / this.numberOfTurns)) + this.pathPointOffset;
99 | localPathMeasure.getPosTan(localPathMeasure.getLength() * (1.0F - f3), this.coords, null);
100 | localPathMeasure.getPosTan(localPathMeasure.getLength() * (1.0F - f4), this.coords2, null);
101 | if (f2 == 0.0F) {
102 | float f7 = this.coords2[0] - this.bitmap.getWidth() / 2;
103 | float f8 = f7 - f3 * (f7 - this.x) + (paramFloat / 3.0F * this.density + 7.0F * paramFloat * (1.0F - this.smokeExponentionWindStuff.getInterpolation(f3)));
104 | setXY(this.drawingVerts, i, f8, this.coords[1]);
105 | }
106 | while (true) {
107 | ++i;
108 | // break label15:
109 | float f5 = this.coords2[0] + this.bitmap.getWidth() / 2;
110 | float f6 = f5 - f3 * (f5 - this.x) + (paramFloat / 3.0F * this.density + 7.0F * paramFloat * (1.0F - this.smokeExponentionWindStuff.getInterpolation(f3)));
111 | setXY(this.drawingVerts, i, f6, this.coords[1]);
112 | }
113 | }
114 |
115 | public void destroy() {
116 | super.destroy();
117 | this.pathPointOffsetAnim.cancel();
118 | }
119 |
120 | public void draw(Canvas paramCanvas) {
121 | paramCanvas.drawBitmapMesh(this.bitmap, 1, 80, this.drawingVerts, 0, null, 0, this.paint);
122 | }
123 |
124 | public void pause() {
125 | super.pause();
126 | this.pathPointOffsetAnim.pause();
127 | }
128 |
129 | public void resume() {
130 | super.resume();
131 | this.pathPointOffsetAnim.resume();
132 | }
133 |
134 | public void setXY(float[] paramArrayOfFloat, int paramInt, float paramFloat1, float paramFloat2) {
135 | paramArrayOfFloat[(0 + paramInt * 2)] = paramFloat1;
136 | paramArrayOfFloat[(1 + paramInt * 2)] = paramFloat2;
137 | }
138 |
139 | public void setY(float paramFloat) {
140 | this.y = paramFloat;
141 | createPath();
142 | }
143 |
144 | public void update(float paramFloat1, float paramFloat2) {
145 | matchVertsToPath(paramFloat2);
146 | }
147 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/Water.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Canvas;
5 | import android.graphics.Color;
6 | import android.graphics.Paint;
7 | import android.graphics.Paint.Style;
8 | import android.graphics.Path;
9 |
10 | import com.cjj.headers.Renderable;
11 |
12 | public class Water extends Renderable
13 | {
14 | public static final int VERTS = 6;
15 | Paint debugPaint = new Paint();
16 | private int emitInterWall = 1000;
17 | Foam[] foams = new Foam[4];
18 | private float height;
19 | long lastEmit;
20 | int numberOfWaves;
21 | PathBitmapMesh water;
22 | private Path waterPath = new Path();
23 | private float waveHeight;
24 | private float width;
25 |
26 | public Water(Bitmap paramBitmap1, Bitmap paramBitmap2, float paramFloat1, float paramFloat2, float paramFloat3, int paramInt)
27 | {
28 | super(paramBitmap1, 0.0F, paramFloat1);
29 | this.height = paramFloat2;
30 | this.width = paramFloat3;
31 | this.numberOfWaves = paramInt;
32 | this.debugPaint.setColor(Color.RED);//todo cjj
33 | this.debugPaint.setStyle(Paint.Style.STROKE);
34 | this.lastEmit = System.currentTimeMillis();
35 | this.water = new PathBitmapMesh(6, 1, paramBitmap1, 1500);
36 | this.foams[0] = new Foam(6, 1, paramBitmap2, 0.0F, paramFloat2 / 12.0F, 1500);
37 | this.foams[1] = new Foam(6, 1, paramBitmap2, -paramFloat2 / 5.0F, paramFloat2 / 5.0F, 1500);
38 | this.foams[1].setAlpha(100);
39 | this.foams[2] = new Foam(6, 1, paramBitmap2, -paramFloat2 / 12.0F, paramFloat2 / 12.0F, 1450);
40 | this.foams[2].setVerticalOffset(paramFloat2 / 7.0F);
41 | this.foams[3] = new Foam(6, 1, paramBitmap2, -paramFloat2 / 12.0F, paramFloat2 / 12.0F, 1400);
42 | this.foams[3].setVerticalOffset(paramFloat2 / 4.0F);
43 | this.waveHeight = (paramFloat2 / 10.0F);
44 | createPath();
45 | }
46 |
47 | private void createPath()
48 | {
49 | this.waterPath.reset();
50 | this.waterPath.moveTo(0.0F, this.y);
51 | int i = (int)(this.width / this.numberOfWaves);
52 | int j = 1;
53 | int k = 0;
54 | if (k >= this.numberOfWaves)
55 | label35: return;
56 | if (j != 0)
57 | {
58 | this.waterPath.cubicTo(this.x + i * k, this.y, this.x + i * k + i / 2.0F, this.y + this.waveHeight, this.x + i * k + i, this.y);
59 | // label106: if (j != 0)
60 | // break label180;
61 | }
62 | for (j = 1; ; j = 0)
63 | {
64 | ++k;
65 | // break label35:
66 | this.waterPath.cubicTo(this.x + i * k, this.y, this.x + i * k + i / 2.0F, this.y - this.waveHeight, this.x + i * k + i, this.y);
67 | // label180: break label106:
68 | }
69 | }
70 |
71 | public void destroy()
72 | {
73 | super.destroy();
74 | Foam[] arrayOfFoam = this.foams;
75 | int i = arrayOfFoam.length;
76 | for (int j = 0; j < i; ++j)
77 | arrayOfFoam[j].destroy();
78 | }
79 |
80 | public void draw(Canvas paramCanvas)
81 | {
82 | this.water.draw(paramCanvas);
83 | Foam[] arrayOfFoam = this.foams;
84 | int i = arrayOfFoam.length;
85 | for (int j = 0; j < i; ++j)
86 | arrayOfFoam[j].draw(paramCanvas);
87 | }
88 |
89 | public void pause()
90 | {
91 | super.pause();
92 | this.water.pause();
93 | Foam[] arrayOfFoam = this.foams;
94 | int i = arrayOfFoam.length;
95 | for (int j = 0; j < i; ++j)
96 | arrayOfFoam[j].pause();
97 | }
98 |
99 | public void resume()
100 | {
101 | super.resume();
102 | this.water.resume();
103 | Foam[] arrayOfFoam = this.foams;
104 | int i = arrayOfFoam.length;
105 | for (int j = 0; j < i; ++j)
106 | arrayOfFoam[j].resume();
107 | }
108 |
109 | public void setWaveHeight(float paramFloat)
110 | {
111 | this.waveHeight = paramFloat;
112 | createPath();
113 | }
114 |
115 | public void update(float paramFloat1, float paramFloat2)
116 | {
117 | int i = 0;
118 | super.update(paramFloat1, paramFloat2);
119 | Foam[] arrayOfFoam1 = this.foams;
120 | int j = arrayOfFoam1.length;
121 | for (int k = 0; k < j; ++k)
122 | arrayOfFoam1[k].update(paramFloat1);
123 | this.water.matchVertsToPath(this.waterPath, this.height, 4.0F * (this.bitmap.getWidth() / this.numberOfWaves));
124 | for (Foam localFoam : this.foams)
125 | localFoam.matchVertsToPath(this.waterPath, 4.0F * (localFoam.getBitmap().getWidth() / this.numberOfWaves));
126 | if (this.lastEmit + this.emitInterWall >= System.currentTimeMillis())
127 | return;
128 | Foam[] arrayOfFoam3 = this.foams;
129 | int i2 = arrayOfFoam3.length;
130 | while (i < i2)
131 | {
132 | arrayOfFoam3[i].calcWave();
133 | ++i;
134 | }
135 | this.lastEmit = System.currentTimeMillis();
136 | }
137 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/cjj/headers/WaterSceneView.java:
--------------------------------------------------------------------------------
1 | package com.cjj.headers;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.graphics.BitmapFactory;
6 | import android.graphics.Canvas;
7 | import android.util.AttributeSet;
8 | import android.view.View;
9 |
10 | public class WaterSceneView extends View {
11 | private NoiseEffect noise;
12 | private NoiseEffect noiseScratchEffect;
13 | private boolean pasuse = false;
14 | private Renderable[] renderables;
15 | private Water water;
16 |
17 | public WaterSceneView(Context paramContext) {
18 | super(paramContext);
19 | }
20 |
21 | public WaterSceneView(Context paramContext, AttributeSet paramAttributeSet) {
22 | super(paramContext, paramAttributeSet);
23 | }
24 |
25 | public WaterSceneView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) {
26 | super(paramContext, paramAttributeSet, paramInt);
27 | }
28 |
29 | private void destroyResources() {
30 | Renderable[] arrayOfRenderable = this.renderables;
31 | int i = arrayOfRenderable.length;
32 | for (int j = 0; j < i; ++j)
33 | arrayOfRenderable[j].destroy();
34 | }
35 |
36 | private float getXCoordByPercent(float paramFloat) {
37 | return paramFloat * getWidth();
38 | }
39 |
40 | private float getYCoordByPercent(float paramFloat) {
41 | return paramFloat * getHeight();
42 | }
43 |
44 | private void init() {
45 | this.renderables = new Renderable[4];
46 | Bitmap localBitmap1 = BitmapFactory.decodeResource(getResources(), 2130837591);
47 | Bitmap localBitmap2 = BitmapFactory.decodeResource(getResources(), 2130837569);
48 | setLayerType(2, null);
49 | this.water = new Water(localBitmap1, localBitmap2, getYCoordByPercent(0.65F), getYCoordByPercent(1.0F), getXCoordByPercent(1.0F), 6);
50 | this.renderables[0] = this.water;
51 | Bitmap localBitmap3 = BitmapFactory.decodeResource(getResources(), 2130837590);
52 | this.renderables[1] = new Renderable(localBitmap3, getXCoordByPercent(0.5F), getYCoordByPercent(0.35F));
53 | Bitmap localBitmap4 = BitmapFactory.decodeResource(getResources(), 2130837579);
54 | Bitmap localBitmap5 = BitmapFactory.decodeResource(getResources(), 2130837578);
55 | this.noiseScratchEffect = new NoiseEffect(localBitmap4, 100, 2.0F);
56 | this.renderables[2] = this.noiseScratchEffect;
57 | this.noise = new NoiseEffect(localBitmap5, 30, 1.0F);
58 | this.renderables[3] = this.noise;
59 | setNoiseIntensity(0.5F);
60 | setWaveHeight(50.0F);
61 | }
62 |
63 | protected void onAttachedToWindow() {
64 | super.onAttachedToWindow();
65 | if ((this.renderables != null) || (getWidth() == 0))
66 | return;
67 | init();
68 | }
69 |
70 | protected void onDetachedFromWindow() {
71 | super.onDetachedFromWindow();
72 | destroyResources();
73 | }
74 |
75 | protected void onDraw(Canvas paramCanvas) {
76 | super.onDraw(paramCanvas);
77 | float f = FrameRateCounter.timeStep();
78 | for (Renderable localRenderable : this.renderables) {
79 | localRenderable.draw(paramCanvas);
80 | localRenderable.update(f, 0.0F);
81 | }
82 | if (this.pasuse)
83 | return;
84 | invalidate();
85 | }
86 |
87 | protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
88 | super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
89 | if (this.renderables != null)
90 | return;
91 | init();
92 | }
93 |
94 | public void setNoiseIntensity(float paramFloat) {
95 | this.noiseScratchEffect.setNoiseIntensity(paramFloat);
96 | this.noise.setNoiseIntensity(paramFloat);
97 | }
98 |
99 | public void setPause(boolean paramBoolean) {
100 | int i = 0;
101 | this.pasuse = paramBoolean;
102 | if (!paramBoolean) {
103 | FrameRateCounter.timeStep();
104 | invalidate();
105 | Renderable[] arrayOfRenderable2 = this.renderables;
106 | int k = arrayOfRenderable2.length;
107 | while (true) {
108 | if (i >= k)
109 | return;
110 | arrayOfRenderable2[i].resume();
111 | ++i;
112 | }
113 | }
114 | Renderable[] arrayOfRenderable1 = this.renderables;
115 | int j = arrayOfRenderable1.length;
116 | while (i < j) {
117 | arrayOfRenderable1[i].pause();
118 | ++i;
119 | }
120 | }
121 |
122 | public void setWaveHeight(float paramFloat) {
123 | this.water.setWaveHeight(paramFloat);
124 | }
125 | }
--------------------------------------------------------------------------------
/app/src/main/res/anim/fab_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fab_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/snackbar_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/snackbar_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/color/switch_thumb_material_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/color/switch_thumb_material_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/actionbar_shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/actionbar_shadow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/aura_gradient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/aura_gradient.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/aura_gradient_inner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/aura_gradient_inner.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/foam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/foam.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/grunge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/grunge.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/ic_forward.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/noise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/noise.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/noise_scratch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/noise_scratch.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/smoke.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/smoke.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/splash1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/splash1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/splash2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/splash2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/splash3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/splash3.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/splash4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/splash4.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/stones.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/stones.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/sun.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/sun_aura.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/sun_aura.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/water.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/water.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/water_scene_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/water_scene_background.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/x_y.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxhdpi/x_y.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxxhdpi/ic_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/mountains.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable-xxxhdpi/mountains.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bear_bg_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fab_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/menu_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/menu_btn2.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/menu_btn3.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/menu_btn4.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/round_soft_shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable/round_soft_shadow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/drawable/shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/snackbar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_root.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/design_navigation_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/design_navigation_item_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/design_navigation_item_separator.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/design_navigation_item_subheader.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/design_navigation_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_naruto.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
15 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_one_piece.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_playground.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
21 |
22 |
29 |
30 |
40 |
41 |
42 |
48 |
49 |
54 |
55 |
60 |
61 |
68 |
69 |
77 |
78 |
82 |
83 |
90 |
91 |
99 |
100 |
104 |
105 |
112 |
113 |
121 |
122 |
126 |
127 |
134 |
135 |
143 |
144 |
148 |
149 |
156 |
157 |
165 |
166 |
167 |
168 |
175 |
176 |
180 |
181 |
182 |
189 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_water.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
23 |
24 |
25 |
32 |
33 |
38 |
39 |
46 |
47 |
58 |
59 |
60 |
66 |
67 |
75 |
76 |
81 |
82 |
91 |
92 |
100 |
101 |
105 |
106 |
114 |
115 |
123 |
124 |
125 |
126 |
134 |
135 |
144 |
145 |
153 |
154 |
155 |
166 |
167 |
175 |
176 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wind.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
23 |
24 |
25 |
32 |
33 |
38 |
39 |
46 |
47 |
57 |
58 |
59 |
65 |
66 |
74 |
75 |
80 |
81 |
90 |
91 |
99 |
100 |
104 |
105 |
113 |
114 |
122 |
123 |
124 |
125 |
133 |
134 |
143 |
144 |
152 |
153 |
154 |
166 |
167 |
174 |
175 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_snackbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_snackbar_include.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/menu_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_media_action.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_media_cancel_action.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_template_big_media.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
20 |
21 |
30 |
31 |
40 |
41 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_template_big_media_narrow.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
21 |
22 |
30 |
31 |
42 |
43 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_template_lines.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
20 |
21 |
30 |
31 |
39 |
40 |
48 |
49 |
50 |
63 |
64 |
72 |
73 |
83 |
84 |
95 |
96 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_template_media.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
20 |
27 |
28 |
34 |
35 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_template_part_chronometer.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_template_part_time.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/select_dialog_item_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/select_dialog_multichoice_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/select_dialog_singlechoice_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/support_simple_spinner_dropdown_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_root.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/custom_shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xhdpi/custom_shadow.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/gradien1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xhdpi/gradien1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/gradien1circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xhdpi/gradien1circle.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/lufei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xhdpi/lufei.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/mingren.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xhdpi/mingren.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/round_shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xhdpi/round_shadow.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/yingshi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xhdpi/yingshi.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/bear_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xxhdpi/bear_1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/bear_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xxhdpi/bear_2.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/bear_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xxhdpi/bear_white.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/gfx_water_sunny.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xxhdpi/gfx_water_sunny.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/gfx_wind_bears.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xxhdpi/gfx_wind_bears.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_previous.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xxhdpi/ic_previous.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/app/src/main/res/mipmap-xxhdpi/tree.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/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/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 | @android:color/black
7 | #ff7fa87f
8 | @android:color/black
9 | @android:color/black
10 | @color/material_deep_teal_200
11 | @color/material_deep_teal_500
12 | #ff424242
13 | #ffeeeeee
14 | #ff303030
15 | #ffeeeeee
16 | #ff000000
17 | #ff323453
18 | #80ffffff
19 | #80000000
20 | @color/bright_foreground_material_light
21 |
22 | @color/bright_foreground_material_dark
23 |
24 | @android:color/white
25 | @android:color/black
26 | #ff5a595b
27 | #ffd6d7d7
28 | #ff202020
29 | #fffafafa
30 | #03000000
31 | #47000000
32 | #80bebebe
33 | #80323232
34 | #ffbebebe
35 | #ff323232
36 | #ffdbdbdb
37 | #ffffffff
38 | #ffdd2c00
39 | #fff19ba2
40 | #ffdc8f9a
41 | #ffcb747b
42 | #0a000000
43 | #0f000000
44 | #1affffff
45 | #2effffff
46 | #ffe89183
47 | #fffcfbeb
48 | #ff4e8186
49 | #6680cbc4
50 | #66009688
51 | @color/bright_foreground_disabled_material_dark
52 |
53 | @color/bright_foreground_disabled_material_light
54 |
55 | @color/material_deep_teal_200
56 | @color/material_deep_teal_500
57 | #ff37474f
58 | #ff263238
59 | #ff21272b
60 | #ff80cbc4
61 | #ff009688
62 | #ff000000
63 | #ff757575
64 | #ff212121
65 | #ffefefef
66 | #ffffffff
67 | #de000000
68 | #4dffffff
69 | #39000000
70 | #4dffffff
71 | #1f000000
72 | #b3ffffff
73 | #8a000000
74 | #36ffffff
75 | #24000000
76 | @android:color/transparent
77 | #14000000
78 | #44000000
79 | #ff323232
80 | #fff19ba2
81 | #ff323453
82 | #ff649692
83 | #ffc68c94
84 | #ff282942
85 | #ff3e676b
86 | #ff616161
87 | #ffbdbdbd
88 | #ffbdbdbd
89 | #fff1f1f1
90 | #ff727272
91 | #fff
92 |
93 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 48.0dip
5 | 56.0dip
6 | 4.0dip
7 | 40.0dip
8 | 16.0dip
9 | 20.0dip
10 | 320.0dip
11 | 160.0dip
12 | - 79.99999%
13 | - 100.0%
14 | 320.0dip
15 | 320.0dip
16 | 16.0dip
17 | 0.0dip
18 | 10.0dip
19 | 128.0dip
20 | 0.0dip
21 | 0.0dip
22 | -1.0px
23 | -1.0px
24 | 24.0dip
25 | 72.0dip
26 | 3.0dip
27 | 0.0dip
28 | 16.0dip
29 | 6.0dip
30 | 48.0dip
31 | 180.0dip
32 | 5.0dip
33 | -3.0dip
34 | 48.0dip
35 | 48.0dip
36 | 36.0dip
37 | -
38 | @dimen/abc_control_inset_material
39 |
40 | 6.0dip
41 | 8.0dip
42 | -
43 | @dimen/abc_control_padding_material
44 |
45 | 2.0dip
46 | 4.0dip
47 | 4.0dip
48 | 8.0dip
49 | - 65.0%
50 | - 95.00001%
51 | 24.0dip
52 | 18.0dip
53 | - 0.3
54 | - 0.26
55 | 32.0dip
56 | 8.0dip
57 | 8.0dip
58 | 7.0dip
59 | 4.0dip
60 | 10.0dip
61 | 16.0dip
62 | -
63 | @dimen/abc_action_bar_content_inset_material
64 |
65 | 296.0dip
66 | 320.0dip
67 | 14.0sp
68 | 14.0sp
69 | 14.0sp
70 | 12.0sp
71 | 34.0sp
72 | 45.0sp
73 | 56.0sp
74 | 112.0sp
75 | 24.0sp
76 | 22.0sp
77 | 18.0sp
78 | 16.0sp
79 | 14.0sp
80 | 16.0sp
81 | 20.0sp
82 | 16.0dip
83 | 4.0dip
84 | 80.0dip
85 | 1.0dip
86 | 2.0dip
87 | 2.0dip
88 | 12.0dip
89 | - 0.3
90 | - 0.26
91 | 0.5dip
92 | 24.0dip
93 | 8.0dip
94 | 16.0dip
95 | 40.0dip
96 | 56.0dip
97 | 6.0dip
98 | 53.0dip
99 | 6.0dip
100 | 12.0dip
101 | 32.0dip
102 | 24.0dip
103 | 320.0dip
104 | 8.0dip
105 | 8.0dip
106 | 64.0dip
107 | 64.0dip
108 | 12.0dip
109 | 8.0dip
110 | 11.0dip
111 | 10.0dip
112 | 2.0dip
113 | 12.0dip
114 | 14.0dip
115 | 14.0sp
116 | 264.0dip
117 |
118 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BeautifulAnimDemo
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/cjj/beautifulanim/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.cjj.beautifulanim;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/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.1.0-alpha5'
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 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tedzyc/Android-TransitionAnimation/9fe362a2f3dd3d33f880b710fbe0340a4b2f0362/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.10-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 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------