Skip to content
This repository was archived by the owner on Feb 8, 2022. It is now read-only.

Commit dfa45e0

Browse files
committed
Merge pull request #12 from florent37/dev
Dev
2 parents 5abe2e5 + 763a265 commit dfa45e0

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Add into your **build.gradle**
186186
[![Download](https://api.bintray.com/packages/florent37/maven/ViewAnimator/images/download.svg)](https://bintray.com/florent37/maven/ViewAnimator/_latestVersion)
187187

188188
```groovy
189-
compile 'com.github.florent37:viewanimator:1.0.2@aar'
189+
compile 'com.github.florent37:viewanimator:1.0.3@aar'
190190
compile 'com.nineoldandroids:library:2.4.0'
191191
```
192192

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ext{
2525
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
2626
targetCompatibilityVersion = JavaVersion.VERSION_1_7
2727

28-
libraryVersion="1.0.2"
28+
libraryVersion="1.0.3"
2929
}
3030

3131
allprojects {

sample/src/main/java/com/github/florent37/sample/viewanimator/MainActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,5 +210,9 @@ protected void animateSequentially() {
210210
.interpolator(new AccelerateInterpolator())
211211
.duration(1200)
212212
.start();
213+
214+
ViewAnimator
215+
.animate(image).scaleX(0, 1).scaleY(0, 1).alpha(0, 1).descelerate().duration(500)
216+
.thenAnimate(image).scaleX(1, 0).scaleY(1, 0).alpha(1, 0).accelerate().duration(500);
213217
}
214218
}

viewanimator/src/main/java/com/github/florent37/viewanimator/AnimationBuilder.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import android.support.annotation.IntRange;
66
import android.util.Log;
77
import android.view.View;
8+
import android.view.animation.AccelerateInterpolator;
89
import android.view.animation.CycleInterpolator;
10+
import android.view.animation.DecelerateInterpolator;
911
import android.view.animation.Interpolator;
1012
import android.widget.TextView;
1113

@@ -443,6 +445,14 @@ public AnimationBuilder interpolator(Interpolator interpolator) {
443445
return this;
444446
}
445447

448+
public ViewAnimator accelerate() {
449+
return viewAnimator.interpolator(new AccelerateInterpolator());
450+
}
451+
452+
public ViewAnimator descelerate() {
453+
return viewAnimator.interpolator(new DecelerateInterpolator());
454+
}
455+
446456
/**
447457
* Start.
448458
*/

0 commit comments

Comments
 (0)