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

Commit 76694e4

Browse files
author
florent champigny
committed
updated README
1 parent 6014f1b commit 76694e4

4 files changed

Lines changed: 57 additions & 41 deletions

File tree

.idea/workspace.xml

Lines changed: 41 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ ViewAnimator
2020
.duration(2000)
2121

2222
.thenAnimate(image)
23-
.scale(1f,0.5f)
23+
.scale(1f,0.5f,1f)
2424
.accelerate()
2525
.duration(1000)
2626

2727
.start();
2828

2929
```
3030

31-
[![gif](https://j.gifs.com/jR2Pp4.gif)](https://youtu.be/WB_vuyGe9GI)
31+
[![gif](https://j.gifs.com/ERlBzW.gif)](https://youtu.be/ZHw8MfOM1Eg)
3232

3333
Without ViewAnimator
3434

@@ -46,8 +46,8 @@ animatorSet.addListener(new Animator.AnimatorListener(){
4646

4747
AnimatorSet animatorSet2 = new AnimatorSet();
4848
animatorSet2.playTogether(
49-
ObjectAnimator.ofFloat(image,"scaleX",1f,0.5f),
50-
ObjectAnimator.ofFloat(image,"scaleY",1f,0.5f)
49+
ObjectAnimator.ofFloat(image,"scaleX",1f,0.5f,1f),
50+
ObjectAnimator.ofFloat(image,"scaleY",1f,0.5f,1f)
5151
);
5252
animatorSet2.setInterpolator(new AccelerateInterpolator());
5353
animatorSet2.setDuration(1000);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ protected void onCreate(Bundle savedInstanceState) {
3232
}
3333
});
3434

35+
findViewById(R.id.montain).setOnClickListener(new View.OnClickListener() {
36+
@Override public void onClick(View v) {
37+
simpleAnimation();
38+
}
39+
});
40+
3541
findViewById(R.id.sequentially).setOnClickListener(new View.OnClickListener() {
3642
@Override public void onClick(View v) {
3743
animateSequentially();
@@ -49,8 +55,8 @@ protected void simpleAnimation(){
4955
.descelerate()
5056
.duration(2000)
5157

52-
.thenAnimate(image)
53-
.scale(1f,0.5f)
58+
.thenAnimate(montain)
59+
.scale(1f,0.5f,1f)
5460
.accelerate()
5561
.duration(1000)
5662

sample/src/main/res/layout/activity_main.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<TextView
2525
android:id="@+id/percent"
26+
android:visibility="gone"
2627
android:layout_width="wrap_content"
2728
android:layout_height="wrap_content"
2829
android:padding="10dp"
@@ -34,6 +35,7 @@
3435
android:layout_width="100dp"
3536
android:layout_height="wrap_content"
3637
android:layout_centerInParent="true"
38+
android:visibility="gone"
3739
android:adjustViewBounds="true"
3840
android:src="@drawable/github"/>
3941

@@ -42,13 +44,15 @@
4244
android:layout_width="wrap_content"
4345
android:layout_height="wrap_content"
4446
android:padding="10dp"
47+
android:textSize="18sp"
4548
android:text="I Love ViewAnimator"
4649
android:textColor="@android:color/black"
4750
android:textStyle="bold"/>
4851

4952
</LinearLayout>
5053

5154
<LinearLayout
55+
android:visibility="gone"
5256
android:layout_width="match_parent"
5357
android:layout_height="wrap_content"
5458
android:layout_alignParentBottom="true"

0 commit comments

Comments
 (0)