Skip to content

Commit 277be8d

Browse files
committed
some refactorizations & added Readme
1 parent 901d62c commit 277be8d

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Working with shared elements
2+
3+
Commit - **8872619**
4+
5+
![](https://lh4.googleusercontent.com/-dmDFoF7c5UY/VD77NsFK8kI/AAAAAAAAuLM/MtSqP8JoQco/w282-h499-no/2014-10-16%2B00_51_34.gif)
6+
7+
### Working with shared elements, explode transition, and animations
8+
9+
Commit - **901d62c**
10+
11+
![](https://lh6.googleusercontent.com/-ecoWQejLmFE/VEBoRo3Qs_I/AAAAAAAAuTU/YZ7855GmOfw/w276-h498-no/appear.gif)

app/src/main/java/com/saulmm/material/MyActivity2.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,17 @@
11
package com.saulmm.material;
22

33
import android.animation.Animator;
4-
import android.animation.LayoutTransition;
54
import android.app.Activity;
6-
import android.app.Fragment;
7-
import android.graphics.Outline;
85
import android.os.Bundle;
9-
import android.transition.ChangeBounds;
10-
import android.transition.CircularPropagation;
11-
import android.transition.Explode;
12-
import android.transition.Scene;
13-
import android.transition.Slide;
146
import android.transition.Transition;
15-
import android.transition.TransitionManager;
16-
import android.view.Menu;
17-
import android.view.MenuItem;
187
import android.view.View;
19-
import android.view.ViewGroup;
208
import android.view.ViewPropertyAnimator;
21-
import android.widget.FrameLayout;
229
import android.widget.LinearLayout;
2310

24-
import com.saulmm.material.R;
25-
2611
public class MyActivity2 extends Activity {
2712

2813
private static final int NUM_VIEWS = 5;
29-
private static final int SCALE_ITEM_ANIMATION_DELAY = 30;
14+
private static final int SCALE_DELAY = 30;
3015
private LinearLayout rowContainer;
3116

3217
@Override
@@ -59,7 +44,7 @@ public void onTransitionEnd(Transition transition) {
5944
for (int i = 0; i < rowContainer.getChildCount(); i++) {
6045

6146
View rowView = rowContainer.getChildAt(i);
62-
rowView.animate().setStartDelay(i * SCALE_ITEM_ANIMATION_DELAY)
47+
rowView.animate().setStartDelay(i * SCALE_DELAY)
6348
.scaleX(1).scaleY(1);
6449
}
6550
}
@@ -72,7 +57,7 @@ public void onBackPressed() {
7257
for (int i = 0; i < rowContainer.getChildCount(); i++) {
7358

7459
View rowView = rowContainer.getChildAt(i);
75-
ViewPropertyAnimator propertyAnimator = rowView.animate().setStartDelay(i * SCALE_ITEM_ANIMATION_DELAY)
60+
ViewPropertyAnimator propertyAnimator = rowView.animate().setStartDelay(i * SCALE_DELAY)
7661
.scaleX(0).scaleY(0);
7762

7863
propertyAnimator.setListener(new Animator.AnimatorListener() {

0 commit comments

Comments
 (0)