Skip to content

Commit d13dc83

Browse files
committed
Remove nineoldandroids.
1 parent 0406a93 commit d13dc83

File tree

67 files changed

+248
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+248
-234
lines changed

library/build.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 22
5-
buildToolsVersion "22.0.1"
4+
compileSdkVersion 25
5+
buildToolsVersion "25.0.2"
66

77
defaultConfig {
8-
minSdkVersion 8
9-
targetSdkVersion 22
10-
versionCode 13
11-
versionName "1.1.3"
8+
minSdkVersion 14
9+
targetSdkVersion 25
10+
versionCode 20
11+
versionName "2.0"
1212
}
1313
buildTypes {
1414
release {
15-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
15+
minifyEnabled false
16+
consumerProguardFiles 'proguard-rules.pro'
1617
}
1718
}
1819
}
1920

2021
dependencies {
2122
compile fileTree(dir: 'libs', include: ['*.jar'])
22-
compile 'com.nineoldandroids:library:2.4.0'
23-
compile 'com.daimajia.easing:library:1.0.0@aar'
23+
compile 'com.daimajia.easing:library:2.0@aar'
24+
compile 'com.android.support:support-compat:25.1.1'
2425
}
2526
apply from: './gradle-mvn-push.gradle'

library/proguard-rules.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18+
-keep class com.daimajia.androidanimations.** { *; }
19+
-keep interface com.daimajia.androidanimations.** { *; }

library/src/main/java/com/daimajia/androidanimations/library/BaseViewAnimator.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424

2525
package com.daimajia.androidanimations.library;
2626

27+
import android.animation.Animator;
28+
import android.animation.AnimatorSet;
29+
import android.support.v4.view.ViewCompat;
2730
import android.view.View;
2831
import android.view.animation.Interpolator;
2932

30-
import com.nineoldandroids.animation.Animator.AnimatorListener;
31-
import com.nineoldandroids.animation.AnimatorSet;
32-
import com.nineoldandroids.view.ViewHelper;
3333

3434
public abstract class BaseViewAnimator {
3535

@@ -61,16 +61,16 @@ public void animate() {
6161
* @param target
6262
*/
6363
public void reset(View target) {
64-
ViewHelper.setAlpha(target, 1);
65-
ViewHelper.setScaleX(target, 1);
66-
ViewHelper.setScaleY(target, 1);
67-
ViewHelper.setTranslationX(target, 0);
68-
ViewHelper.setTranslationY(target, 0);
69-
ViewHelper.setRotation(target, 0);
70-
ViewHelper.setRotationY(target, 0);
71-
ViewHelper.setRotationX(target, 0);
72-
ViewHelper.setPivotX(target, target.getMeasuredWidth() / 2.0f);
73-
ViewHelper.setPivotY(target, target.getMeasuredHeight() / 2.0f);
64+
ViewCompat.setAlpha(target, 1);
65+
ViewCompat.setScaleX(target, 1);
66+
ViewCompat.setScaleY(target, 1);
67+
ViewCompat.setTranslationX(target, 0);
68+
ViewCompat.setTranslationY(target, 0);
69+
ViewCompat.setRotation(target, 0);
70+
ViewCompat.setRotationY(target, 0);
71+
ViewCompat.setRotationX(target, 0);
72+
ViewCompat.setPivotX(target, target.getMeasuredWidth() / 2.0f);
73+
ViewCompat.setPivotY(target, target.getMeasuredHeight() / 2.0f);
7474
}
7575

7676
/**
@@ -95,24 +95,24 @@ public long getStartDelay() {
9595
return mAnimatorSet.getStartDelay();
9696
}
9797

98-
public BaseViewAnimator addAnimatorListener(AnimatorListener l) {
98+
public BaseViewAnimator addAnimatorListener(Animator.AnimatorListener l) {
9999
mAnimatorSet.addListener(l);
100100
return this;
101101
}
102102

103-
public void cancel(){
103+
public void cancel() {
104104
mAnimatorSet.cancel();
105105
}
106106

107-
public boolean isRunning(){
107+
public boolean isRunning() {
108108
return mAnimatorSet.isRunning();
109109
}
110110

111-
public boolean isStarted(){
111+
public boolean isStarted() {
112112
return mAnimatorSet.isStarted();
113113
}
114114

115-
public void removeAnimatorListener(AnimatorListener l) {
115+
public void removeAnimatorListener(Animator.AnimatorListener l) {
116116
mAnimatorSet.removeListener(l);
117117
}
118118

library/src/main/java/com/daimajia/androidanimations/library/YoYo.java

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
package com.daimajia.androidanimations.library;
2727

28+
import android.animation.Animator;
2829
import android.view.View;
2930
import android.view.animation.Interpolator;
3031

31-
import com.nineoldandroids.animation.Animator;
3232

3333
import java.util.ArrayList;
3434
import java.util.List;
@@ -68,18 +68,25 @@ public interface AnimatorCallback {
6868

6969
private static class EmptyAnimatorListener implements Animator.AnimatorListener {
7070
@Override
71-
public void onAnimationStart(Animator animation){}
71+
public void onAnimationStart(Animator animation) {
72+
}
73+
7274
@Override
73-
public void onAnimationEnd(Animator animation){}
75+
public void onAnimationEnd(Animator animation) {
76+
}
77+
7478
@Override
75-
public void onAnimationCancel(Animator animation){}
79+
public void onAnimationCancel(Animator animation) {
80+
}
81+
7682
@Override
77-
public void onAnimationRepeat(Animator animation){}
83+
public void onAnimationRepeat(Animator animation) {
84+
}
7885
}
7986

8087
public static final class AnimationComposer {
8188

82-
private List<Animator.AnimatorListener> callbacks = new ArrayList<Animator.AnimatorListener>();
89+
private List<Animator.AnimatorListener> callbacks = new ArrayList<>();
8390

8491
private BaseViewAnimator animator;
8592
private long duration = DURATION;
@@ -119,31 +126,39 @@ public AnimationComposer withListener(Animator.AnimatorListener listener) {
119126
public AnimationComposer onStart(final AnimatorCallback callback) {
120127
callbacks.add(new EmptyAnimatorListener() {
121128
@Override
122-
public void onAnimationStart(Animator animation) { callback.call(animation); }
129+
public void onAnimationStart(Animator animation) {
130+
callback.call(animation);
131+
}
123132
});
124133
return this;
125134
}
126135

127136
public AnimationComposer onEnd(final AnimatorCallback callback) {
128137
callbacks.add(new EmptyAnimatorListener() {
129138
@Override
130-
public void onAnimationEnd(Animator animation) { callback.call(animation); }
139+
public void onAnimationEnd(Animator animation) {
140+
callback.call(animation);
141+
}
131142
});
132143
return this;
133144
}
134145

135146
public AnimationComposer onCancel(final AnimatorCallback callback) {
136147
callbacks.add(new EmptyAnimatorListener() {
137148
@Override
138-
public void onAnimationCancel(Animator animation) { callback.call(animation); }
149+
public void onAnimationCancel(Animator animation) {
150+
callback.call(animation);
151+
}
139152
});
140153
return this;
141154
}
142155

143156
public AnimationComposer onRepeat(final AnimatorCallback callback) {
144157
callbacks.add(new EmptyAnimatorListener() {
145158
@Override
146-
public void onAnimationRepeat(Animator animation) { callback.call(animation); }
159+
public void onAnimationRepeat(Animator animation) {
160+
callback.call(animation);
161+
}
147162
});
148163
return this;
149164
}
@@ -163,23 +178,23 @@ public static final class YoYoString {
163178
private BaseViewAnimator animator;
164179
private View target;
165180

166-
private YoYoString(BaseViewAnimator animator, View target){
181+
private YoYoString(BaseViewAnimator animator, View target) {
167182
this.target = target;
168183
this.animator = animator;
169184
}
170185

171-
public boolean isStarted(){
186+
public boolean isStarted() {
172187
return animator.isStarted();
173188
}
174189

175-
public boolean isRunning(){
190+
public boolean isRunning() {
176191
return animator.isRunning();
177192
}
178193

179-
public void stop(boolean reset){
194+
public void stop(boolean reset) {
180195
animator.cancel();
181196

182-
if(reset)
197+
if (reset)
183198
animator.reset(target);
184199
}
185200

library/src/main/java/com/daimajia/androidanimations/library/attention/BounceAnimator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424

2525
package com.daimajia.androidanimations.library.attention;
2626

27+
import android.animation.ObjectAnimator;
2728
import android.view.View;
2829

2930
import com.daimajia.androidanimations.library.BaseViewAnimator;
30-
import com.nineoldandroids.animation.ObjectAnimator;
3131

3232
public class BounceAnimator extends BaseViewAnimator {
3333
@Override
3434
public void prepare(View target) {
3535
getAnimatorAgent().playTogether(
36-
ObjectAnimator.ofFloat(target,"translationY",0,0,-30,0,-15,0,0)
36+
ObjectAnimator.ofFloat(target, "translationY", 0, 0, -30, 0, -15, 0, 0)
3737
);
3838
}
3939
}

library/src/main/java/com/daimajia/androidanimations/library/attention/FlashAnimator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424

2525
package com.daimajia.androidanimations.library.attention;
2626

27+
import android.animation.ObjectAnimator;
2728
import android.view.View;
2829

2930
import com.daimajia.androidanimations.library.BaseViewAnimator;
30-
import com.nineoldandroids.animation.ObjectAnimator;
3131

32-
public class FlashAnimator extends BaseViewAnimator{
32+
public class FlashAnimator extends BaseViewAnimator {
3333
@Override
3434
public void prepare(View target) {
3535
getAnimatorAgent().playTogether(
36-
ObjectAnimator.ofFloat(target,"alpha",1,0,1,0,1)
36+
ObjectAnimator.ofFloat(target, "alpha", 1, 0, 1, 0, 1)
3737
);
3838
}
3939
}

library/src/main/java/com/daimajia/androidanimations/library/attention/PulseAnimator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
package com.daimajia.androidanimations.library.attention;
2626

27+
import android.animation.ObjectAnimator;
2728
import android.view.View;
2829

2930
import com.daimajia.androidanimations.library.BaseViewAnimator;
30-
import com.nineoldandroids.animation.ObjectAnimator;
3131

3232
public class PulseAnimator extends BaseViewAnimator {
3333
@Override

library/src/main/java/com/daimajia/androidanimations/library/attention/RubberBandAnimator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
package com.daimajia.androidanimations.library.attention;
2626

27+
import android.animation.ObjectAnimator;
2728
import android.view.View;
2829

2930
import com.daimajia.androidanimations.library.BaseViewAnimator;
30-
import com.nineoldandroids.animation.ObjectAnimator;
3131

3232
public class RubberBandAnimator extends BaseViewAnimator {
3333
@Override

library/src/main/java/com/daimajia/androidanimations/library/attention/ShakeAnimator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
package com.daimajia.androidanimations.library.attention;
2626

2727

28+
import android.animation.ObjectAnimator;
2829
import android.view.View;
2930

3031
import com.daimajia.androidanimations.library.BaseViewAnimator;
31-
import com.nineoldandroids.animation.ObjectAnimator;
3232

3333
public class ShakeAnimator extends BaseViewAnimator {
3434
@Override
3535
public void prepare(View target) {
3636
getAnimatorAgent().playTogether(
37-
ObjectAnimator.ofFloat(target, "translationX", 0, 25, -25, 25, -25,15, -15, 6, -6, 0)
37+
ObjectAnimator.ofFloat(target, "translationX", 0, 25, -25, 25, -25, 15, -15, 6, -6, 0)
3838
);
3939
}
4040
}

library/src/main/java/com/daimajia/androidanimations/library/attention/StandUpAnimator.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,22 @@
2424

2525
package com.daimajia.androidanimations.library.attention;
2626

27+
import android.animation.ObjectAnimator;
2728
import android.view.View;
2829

2930
import com.daimajia.androidanimations.library.BaseViewAnimator;
30-
import com.nineoldandroids.animation.ObjectAnimator;
3131

3232

33-
34-
public class StandUpAnimator extends BaseViewAnimator{
33+
public class StandUpAnimator extends BaseViewAnimator {
3534
@Override
3635
public void prepare(View target) {
37-
float x = (target.getWidth() - target.getPaddingLeft() - target.getPaddingRight())/2
36+
float x = (target.getWidth() - target.getPaddingLeft() - target.getPaddingRight()) / 2
3837
+ target.getPaddingLeft();
3938
float y = target.getHeight() - target.getPaddingBottom();
4039
getAnimatorAgent().playTogether(
41-
ObjectAnimator.ofFloat(target,"pivotX",x,x,x,x,x),
42-
ObjectAnimator.ofFloat(target,"pivotY",y,y,y,y,y),
43-
ObjectAnimator.ofFloat(target,"rotationX",55,-30,15,-15,0)
40+
ObjectAnimator.ofFloat(target, "pivotX", x, x, x, x, x),
41+
ObjectAnimator.ofFloat(target, "pivotY", y, y, y, y, y),
42+
ObjectAnimator.ofFloat(target, "rotationX", 55, -30, 15, -15, 0)
4443
);
4544
}
4645
}

0 commit comments

Comments
 (0)