summaryrefslogtreecommitdiffstats
path: root/tests/TransitionTests
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2013-08-26 14:20:16 -0700
committerChet Haase <chet@google.com>2013-09-04 14:46:38 -0700
commitd82c8ac4db7091d2e976af4c89a1734465d20cd2 (patch)
treea3ccb4d7a4325582dfe028030e4ca2d38ba4c2be /tests/TransitionTests
parent2a59f3f24076d96cbb10e1c00c3264dec43f19b1 (diff)
downloadframeworks_base-d82c8ac4db7091d2e976af4c89a1734465d20cd2.zip
frameworks_base-d82c8ac4db7091d2e976af4c89a1734465d20cd2.tar.gz
frameworks_base-d82c8ac4db7091d2e976af4c89a1734465d20cd2.tar.bz2
Transition API changes from API council recommendations
Issue #10460684 KLP API Review: android.view.transition and android.animation Issue #10570740 Transitions: inflate transition targets from xml Change-Id: I7a3f6d3aece2fcafc5efd555d033f79e86635c98
Diffstat (limited to 'tests/TransitionTests')
-rw-r--r--tests/TransitionTests/res/scene/incorrect_password_scene.xml2
-rw-r--r--tests/TransitionTests/res/scene/login_scene.xml2
-rw-r--r--tests/TransitionTests/res/scene/new_user_scene.xml2
-rw-r--r--tests/TransitionTests/res/scene/password_scene.xml2
-rw-r--r--tests/TransitionTests/res/scene/results_scene.xml3
-rw-r--r--tests/TransitionTests/res/scene/search_scene.xml3
-rw-r--r--tests/TransitionTests/res/scene/success_scene.xml2
-rw-r--r--tests/TransitionTests/res/transition/colorizer_transition.xml6
-rw-r--r--tests/TransitionTests/res/transition/login_slider_transition.xml14
-rw-r--r--tests/TransitionTests/res/transition/login_transition_mgr.xml49
-rw-r--r--tests/TransitionTests/res/transition/mover.xml2
-rw-r--r--tests/TransitionTests/res/transition/mover_fader.xml6
-rw-r--r--tests/TransitionTests/res/transition/my_scene.xml (renamed from tests/TransitionTests/res/scene/my_scene.xml)0
-rw-r--r--tests/TransitionTests/res/transition/my_transition.xml26
-rw-r--r--tests/TransitionTests/res/transition/my_transition_mgr.xml8
-rw-r--r--tests/TransitionTests/res/transition/username_taken_scene.xml (renamed from tests/TransitionTests/res/scene/username_taken_scene.xml)0
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ChangingText.java31
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ClippingText.java33
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java30
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java21
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java18
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java45
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/DelayedTransition.java2
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/Demo1.java17
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/Demo2.java28
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/Demo3.java20
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/Demo4.java32
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/Demo5.java8
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java3
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/FadingTest.java20
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/HierarchicalMove.java54
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java38
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java34
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java19
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java39
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/LoginActivityFromResources.java24
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/Reparenting.java8
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java14
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java20
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java12
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition2.java8
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java35
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java43
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java39
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java15
-rw-r--r--tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java6
46 files changed, 410 insertions, 433 deletions
diff --git a/tests/TransitionTests/res/scene/incorrect_password_scene.xml b/tests/TransitionTests/res/scene/incorrect_password_scene.xml
deleted file mode 100644
index a31ad22..0000000
--- a/tests/TransitionTests/res/scene/incorrect_password_scene.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<scene xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout="@layout/incorrect_password"/> \ No newline at end of file
diff --git a/tests/TransitionTests/res/scene/login_scene.xml b/tests/TransitionTests/res/scene/login_scene.xml
deleted file mode 100644
index b258303..0000000
--- a/tests/TransitionTests/res/scene/login_scene.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<scene xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout="@layout/activity_login"/> \ No newline at end of file
diff --git a/tests/TransitionTests/res/scene/new_user_scene.xml b/tests/TransitionTests/res/scene/new_user_scene.xml
deleted file mode 100644
index d6e5f0f..0000000
--- a/tests/TransitionTests/res/scene/new_user_scene.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<scene xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout="@layout/new_user"/> \ No newline at end of file
diff --git a/tests/TransitionTests/res/scene/password_scene.xml b/tests/TransitionTests/res/scene/password_scene.xml
deleted file mode 100644
index 99a0038..0000000
--- a/tests/TransitionTests/res/scene/password_scene.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<scene xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout="@layout/login_password"/> \ No newline at end of file
diff --git a/tests/TransitionTests/res/scene/results_scene.xml b/tests/TransitionTests/res/scene/results_scene.xml
deleted file mode 100644
index 9c9fc69..0000000
--- a/tests/TransitionTests/res/scene/results_scene.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<scene xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout="@layout/results_screen">
-</scene> \ No newline at end of file
diff --git a/tests/TransitionTests/res/scene/search_scene.xml b/tests/TransitionTests/res/scene/search_scene.xml
deleted file mode 100644
index 742cd57..0000000
--- a/tests/TransitionTests/res/scene/search_scene.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<scene xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout="@layout/search_screen">
-</scene> \ No newline at end of file
diff --git a/tests/TransitionTests/res/scene/success_scene.xml b/tests/TransitionTests/res/scene/success_scene.xml
deleted file mode 100644
index 3d76d89..0000000
--- a/tests/TransitionTests/res/scene/success_scene.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<scene xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout="@layout/success"/> \ No newline at end of file
diff --git a/tests/TransitionTests/res/transition/colorizer_transition.xml b/tests/TransitionTests/res/transition/colorizer_transition.xml
index 731d7ee..12f4be7 100644
--- a/tests/TransitionTests/res/transition/colorizer_transition.xml
+++ b/tests/TransitionTests/res/transition/colorizer_transition.xml
@@ -1,6 +1,6 @@
-<recolor xmlns:android="http://schemas.android.com/apk/res/android">>
+<recolor xmlns:android="http://schemas.android.com/apk/res/android">
<targets>
- <target android:targetID="@id/password"/>
- <target android:targetID="@id/passwordEdit"/>
+ <target android:targetId="@id/password"/>
+ <target android:targetId="@id/passwordEdit"/>
</targets>
</recolor> \ No newline at end of file
diff --git a/tests/TransitionTests/res/transition/login_slider_transition.xml b/tests/TransitionTests/res/transition/login_slider_transition.xml
index dbdd6e9..2317857 100644
--- a/tests/TransitionTests/res/transition/login_slider_transition.xml
+++ b/tests/TransitionTests/res/transition/login_slider_transition.xml
@@ -1,21 +1,21 @@
-<transitionGroup xmlns:android="http://schemas.android.com/apk/res/android">
+<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
<slide>
<targets>
- <target android:targetID="@id/retype"/>
- <target android:targetID="@id/retypeEdit"/>
+ <target android:targetId="@id/retype"/>
+ <target android:targetId="@id/retypeEdit"/>
</targets>
</slide>
<recolor>
<targets>
- <target android:targetID="@id/password"/>
- <target android:targetID="@id/passwordEdit"/>
+ <target android:targetId="@id/password"/>
+ <target android:targetId="@id/passwordEdit"/>
</targets>
</recolor>
<fade/>
-</transitionGroup>
+</transitionSet>
<!--
- TransitionGroup slider = new TransitionGroup();
+ TransitionSet slider = new TransitionSet();
slider.addTransition(new Slide(R.id.retype, R.id.retypeEdit));
slider.addTransition(new Recolor(R.id.password, R.id.passwordEdit));
slider.addTransition(new Fade());
diff --git a/tests/TransitionTests/res/transition/login_transition_mgr.xml b/tests/TransitionTests/res/transition/login_transition_mgr.xml
index 8a8b9e9..5d07be0 100644
--- a/tests/TransitionTests/res/transition/login_transition_mgr.xml
+++ b/tests/TransitionTests/res/transition/login_transition_mgr.xml
@@ -1,39 +1,14 @@
<transitionManager xmlns:android="http://schemas.android.com/apk/res/android">
- <transition fromScene="@scene/login_scene" toScene="@scene/new_user_scene"
- transition="@transition/login_slider_transition"/>
- <transition fromScene="@scene/password_scene" toScene="@scene/new_user_scene"
- transition="@transition/login_slider_transition"/>
- <transition fromScene="@scene/new_user_scene" toScene="@scene/login_scene"
- transition="@transition/login_slider_transition"/>
- <transition fromScene="@scene/new_user_scene" toScene="@scene/password_scene"
- transition="@transition/login_slider_transition"/>
- <transition fromScene="@scene/login_scene" toScene="@scene/password_scene"
- transition="@transition/colorizer_transition"/>
- <transition fromScene="@scene/password_scene" toScene="@scene/login_scene"
- transition="@transition/colorizer_transition"/>
+ <transition android:fromScene="@layout/activity_login" android:toScene="@layout/new_user"
+ android:transition="@transition/login_slider_transition"/>
+ <transition android:fromScene="@layout/login_password" android:toScene="@layout/new_user"
+ android:transition="@transition/login_slider_transition"/>
+ <transition android:fromScene="@layout/new_user" android:toScene="@layout/activity_login"
+ android:transition="@transition/login_slider_transition"/>
+ <transition android:fromScene="@layout/new_user" android:toScene="@layout/login_password"
+ android:transition="@transition/login_slider_transition"/>
+ <transition android:fromScene="@layout/activity_login" android:toScene="@layout/login_password"
+ android:transition="@transition/colorizer_transition"/>
+ <transition android:fromScene="@layout/login_password" android:toScene="@layout/activity_login"
+ android:transition="@transition/colorizer_transition"/>
</transitionManager>
-
- <!--
- mLoginScene = new Scene(this, mSceneRoot, R.layout.activity_login);
- mPasswordScene = new Scene(this, mSceneRoot, R.layout.login_password);
- mIncorrectPasswordScene = new Scene(this, mSceneRoot, R.layout.incorrect_password);
- mUsernameTakenScene = new Scene(this, mSceneRoot, R.layout.username_taken);
- mSuccessScene = new Scene(this, mSceneRoot, R.layout.success);
- mNewUserScene = new Scene(this, mSceneRoot, R.layout.new_user);
-
- mTransitionManager = new TransitionManager();
- // Custom transitions in/out of NewUser screen - slide in the 2nd password UI
- TransitionGroup slider = new TransitionGroup();
- slider.addTransition(new Slide(R.id.retype, R.id.retypeEdit));
- slider.addTransition(new Recolor(R.id.password, R.id.passwordEdit));
- slider.addTransition(new Fade());
- mTransitionManager.setTransition(mLoginScene, mNewUserScene, slider);
- mTransitionManager.setTransition(mPasswordScene, mNewUserScene, slider);
- mTransitionManager.setTransition(mNewUserScene, mLoginScene, slider);
- mTransitionManager.setTransition(mNewUserScene, mPasswordScene, slider);
-
- // Custom transitions with recoloring password field
- Transition colorizer = new Recolor(R.id.password, R.id.passwordEdit);
- mTransitionManager.setTransition(mLoginScene, mPasswordScene, colorizer);
- mTransitionManager.setTransition(mPasswordScene, mLoginScene, colorizer);
---> \ No newline at end of file
diff --git a/tests/TransitionTests/res/transition/mover.xml b/tests/TransitionTests/res/transition/mover.xml
index 3c47606..b23d2a5 100644
--- a/tests/TransitionTests/res/transition/mover.xml
+++ b/tests/TransitionTests/res/transition/mover.xml
@@ -1 +1 @@
-<move/> \ No newline at end of file
+<changeBounds/> \ No newline at end of file
diff --git a/tests/TransitionTests/res/transition/mover_fader.xml b/tests/TransitionTests/res/transition/mover_fader.xml
index 8b805e9..ef11676 100644
--- a/tests/TransitionTests/res/transition/mover_fader.xml
+++ b/tests/TransitionTests/res/transition/mover_fader.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<transitionGroup xmlns:android="http://schemas.android.com/apk/res/android">
+<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
<fade/>
- <move/>
-</transitionGroup> \ No newline at end of file
+ <changeBounds/>
+</transitionSet> \ No newline at end of file
diff --git a/tests/TransitionTests/res/scene/my_scene.xml b/tests/TransitionTests/res/transition/my_scene.xml
index b8278c9..b8278c9 100644
--- a/tests/TransitionTests/res/scene/my_scene.xml
+++ b/tests/TransitionTests/res/transition/my_scene.xml
diff --git a/tests/TransitionTests/res/transition/my_transition.xml b/tests/TransitionTests/res/transition/my_transition.xml
index 14c91b9..022313c 100644
--- a/tests/TransitionTests/res/transition/my_transition.xml
+++ b/tests/TransitionTests/res/transition/my_transition.xml
@@ -1,20 +1,20 @@
-<transitionGroup xmlns:android="http://schemas.android.com/apk/res/android">
+<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
<fade></fade>
- <transitionGroup>
- <move android:duration="500">
+ <transitionSet>
+ <changeBounds android:duration="500">
<targets>
- <target android:targetID="@id/container"/>
- <target android:targetID="@id/resultsList"/>
+ <target android:targetId="@id/container"/>
+ <target android:targetId="@id/resultsList"/>
</targets>
- </move>
- <transitionGroup>
+ </changeBounds>
+ <transitionSet>
<targets>
- <target android:targetID="@id/container"/>
- <target android:targetID="@id/resultsList"/>
+ <target android:targetId="@id/container"/>
+ <target android:targetId="@id/resultsList"/>
</targets>
<fade android:startOffset="25"/>
- </transitionGroup>
+ </transitionSet>
<recolor/>
- </transitionGroup>
- <move/>
-</transitionGroup> \ No newline at end of file
+ </transitionSet>
+ <changeBounds/>
+</transitionSet> \ No newline at end of file
diff --git a/tests/TransitionTests/res/transition/my_transition_mgr.xml b/tests/TransitionTests/res/transition/my_transition_mgr.xml
index ca9705a..5d8f799 100644
--- a/tests/TransitionTests/res/transition/my_transition_mgr.xml
+++ b/tests/TransitionTests/res/transition/my_transition_mgr.xml
@@ -1,6 +1,6 @@
<transitionManager xmlns:android="http://schemas.android.com/apk/res/android">
- <transition fromScene="@scene/search_scene" toScene="@scene/results_scene"
- transition="@transition/mover_fader"/>
- <transition fromScene="@scene/results_scene" toScene="@scene/search_scene"
- transition="@transition/mover_fader"/>
+ <transition android:fromScene="@layout/search_screen" android:toScene="@layout/results_screen"
+ android:transition="@transition/mover_fader"/>
+ <transition android:fromScene="@layout/results_screen" android:toScene="@layout/search_screen"
+ android:transition="@transition/mover_fader"/>
</transitionManager> \ No newline at end of file
diff --git a/tests/TransitionTests/res/scene/username_taken_scene.xml b/tests/TransitionTests/res/transition/username_taken_scene.xml
index b2f050e..b2f050e 100644
--- a/tests/TransitionTests/res/scene/username_taken_scene.xml
+++ b/tests/TransitionTests/res/transition/username_taken_scene.xml
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ChangingText.java b/tests/TransitionTests/src/com/android/transitiontests/ChangingText.java
index 05bed5f..a1ddd74 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ChangingText.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ChangingText.java
@@ -19,42 +19,43 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
-import android.widget.Button;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.TextChange;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.ChangeBounds;
+import android.transition.TextChange;
+import android.transition.TransitionManager;
public class ChangingText extends Activity {
Scene mScene1, mScene2;
ViewGroup mSceneRoot;
- TransitionGroup mChanger;
+ TransitionSet mChanger;
+ Scene mCurrentScene;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.changing_text_1);
- View container = (View) findViewById(R.id.container);
+ View container = findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mScene1 = new Scene(mSceneRoot, R.layout.changing_text_1, this);
- mScene2 = new Scene(mSceneRoot, R.layout.changing_text_2, this);
+ mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.changing_text_1, this);
+ mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.changing_text_2, this);
- mChanger = new TransitionGroup(TransitionGroup.TOGETHER);
- mChanger.addTransitions(new Move(), new TextChange());
+ mChanger = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER);
+ mChanger.addTransition(new ChangeBounds()).addTransition(new TextChange());
- mSceneRoot.setCurrentScene(mScene1);
+ mCurrentScene = mScene1;
}
public void sendMessage(View view) {
- if (mSceneRoot.getCurrentScene() == mScene1) {
+ if (mCurrentScene == mScene1) {
TransitionManager.go(mScene2, mChanger);
+ mCurrentScene = mScene2;
} else {
TransitionManager.go(mScene1, mChanger);
+ mCurrentScene = mScene1;
}
}
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java b/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java
index c3201f2..85702fa 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java
@@ -17,15 +17,15 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
+import android.transition.Scene;
import android.widget.Button;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.TextChange;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.TextChange;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class ClippingText extends Activity {
@@ -34,7 +34,8 @@ public class ClippingText extends Activity {
ViewGroup mSceneRoot;
// static Fade sFade = new Fade(R.id.removingButton, R.id.invisibleButton, R.id.goneButton);
Fade fader;
- TransitionGroup mChanger;
+ TransitionSet mChanger;
+ Scene mCurrentScene;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -44,22 +45,24 @@ public class ClippingText extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mScene1 = new Scene(mSceneRoot, R.layout.clipping_text_1, this);
- mScene2 = new Scene(mSceneRoot, R.layout.clipping_text_2, this);
+ mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.clipping_text_1, this);
+ mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.clipping_text_2, this);
- mChanger = new TransitionGroup(TransitionGroup.TOGETHER);
- Move move = new Move();
- move.setResizeClip(true);
- mChanger.addTransitions(move, new TextChange());
+ mChanger = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER);
+ ChangeBounds changeBounds = new ChangeBounds();
+ changeBounds.setResizeClip(true);
+ mChanger.addTransition(changeBounds).addTransition(new TextChange());
- mSceneRoot.setCurrentScene(mScene1);
+ mCurrentScene = mScene1;
}
public void sendMessage(View view) {
- if (mSceneRoot.getCurrentScene() == mScene1) {
+ if (mCurrentScene == mScene1) {
TransitionManager.go(mScene2, mChanger);
+ mCurrentScene = mScene2;
} else {
TransitionManager.go(mScene1, mChanger);
+ mCurrentScene = mScene1;
}
}
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java b/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java
index c7da6a3..482dc05 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java
@@ -18,19 +18,19 @@ package com.android.transitiontests;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Fade;
-import android.view.transition.Scene;
-import android.view.transition.Transition;
+import android.transition.Fade;
+import android.transition.Scene;
+import android.transition.Transition;
+import android.transition.TransitionSet;
import android.widget.ImageView;
import android.widget.TextView;
-import android.view.transition.Crossfade;
-import android.view.transition.Move;
-import android.view.transition.Rotate;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Crossfade;
+import android.transition.Rotate;
+import android.transition.TransitionManager;
public class ContactsExpansion extends Activity {
@@ -42,7 +42,8 @@ public class ContactsExpansion extends Activity {
View currentItem = null;
- TransitionGroup mMyAutoTransition = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
+ TransitionSet mMyAutoTransition = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -73,11 +74,12 @@ public class ContactsExpansion extends Activity {
((TextView)contactItem.findViewById(R.id.contact_email)).setText(contactsData[dataIndex++]);
container.addView(contactItem);
- final TransitionGroup myTransition = new TransitionGroup();
- myTransition.addTransitions(new Fade(Fade.IN),
- new Rotate().setTargetIds(R.id.contact_arrow),
- new Move(), new Fade(Fade.OUT),
- new Crossfade().setTargetIds(R.id.contact_picture));
+ final TransitionSet myTransition = new TransitionSet();
+ myTransition.addTransition(new Fade(Fade.IN)).
+ addTransition(new Rotate().addTargetId(R.id.contact_arrow)).
+ addTransition(new ChangeBounds()).
+ addTransition(new Fade(Fade.OUT)).
+ addTransition(new Crossfade().addTargetId(R.id.contact_picture));
final ToggleScene toggleScene = new ToggleScene(container, myTransition);
contactItem.setOnClickListener(new View.OnClickListener() {
@Override
diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java b/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java
index d5f6a28..eb799ec 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java
@@ -17,13 +17,13 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Crossfade;
-import android.view.transition.Move;
-import android.view.transition.Scene;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Crossfade;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class CrossFadeDemo extends Activity {
@@ -41,16 +41,17 @@ public class CrossFadeDemo extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mScene1 = new Scene(mSceneRoot, R.layout.crossfade, this);
- mScene2 = new Scene(mSceneRoot, R.layout.crossfade_1, this);
+ mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade, this);
+ mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade_1, this);
Crossfade crossfade = new Crossfade();
crossfade.setFadeBehavior(Crossfade.FADE_BEHAVIOR_CROSSFADE);
crossfade.setResizeBehavior(Crossfade.RESIZE_BEHAVIOR_NONE);
- crossfade.setTargetIds(R.id.textview, R.id.textview1, R.id.textview2);
+ crossfade.addTargetId(R.id.textview).addTargetId(R.id.textview1).
+ addTargetId(R.id.textview2);
mTransitionManager = new TransitionManager();
- TransitionGroup moveCrossFade = new TransitionGroup();
- moveCrossFade.addTransitions(crossfade, new Move());
+ TransitionSet moveCrossFade = new TransitionSet();
+ moveCrossFade.addTransition(crossfade).addTransition(new ChangeBounds());
mTransitionManager.setTransition(mScene1, moveCrossFade);
mTransitionManager.setTransition(mScene2, moveCrossFade);
mCurrentScene = 1;
diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java
index 28e055f..09b495f 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java
@@ -19,12 +19,12 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Crossfade;
-import android.view.transition.Move;
-import android.view.transition.Scene;
-import android.view.transition.Transition;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Crossfade;
+import android.transition.ChangeBounds;
+import android.transition.Scene;
+import android.transition.Transition;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
import android.widget.ImageView;
public class CrossfadeImage extends Activity {
@@ -48,11 +48,11 @@ public class CrossfadeImage extends Activity {
mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
Crossfade mCrossfade = new Crossfade();
- mCrossfade.setTargetIds(R.id.contact_picture);
+ mCrossfade.addTargetId(R.id.contact_picture);
- TransitionGroup group = new TransitionGroup();
+ TransitionSet group = new TransitionSet();
group.setDuration(1500);
- group.addTransitions(mCrossfade, new Move());
+ group.addTransition(mCrossfade).addTransition(new ChangeBounds());
mTransition = group;
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java
index b82dbd8..c118398 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java
@@ -17,14 +17,14 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Crossfade;
-import android.view.transition.Move;
-import android.view.transition.TextChange;
-import android.view.transition.Transition;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Crossfade;
+import android.transition.TextChange;
+import android.transition.Transition;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
@@ -40,9 +40,9 @@ public class CrossfadeMultiple extends Activity {
TextView mTextView;
Button mButton;
Crossfade mCrossfade;
- TransitionGroup mCrossfadeGroup;
- TransitionGroup mTextChangeGroup1, mTextChangeGroup2;
- TransitionGroup mInOutGroup;
+ TransitionSet mCrossfadeGroup;
+ TransitionSet mTextChangeGroup1, mTextChangeGroup2;
+ TransitionSet mInOutGroup;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -57,34 +57,35 @@ public class CrossfadeMultiple extends Activity {
mTextView = (TextView) findViewById(R.id.textview);
mCrossfade = new Crossfade();
- mCrossfade.setTargetIds(R.id.button, R.id.textview, R.id.imageview);
+ mCrossfade.addTargetId(R.id.button).addTargetId(R.id.textview).addTargetId(R.id.imageview);
- mCrossfadeGroup = new TransitionGroup();
+ mCrossfadeGroup = new TransitionSet();
mCrossfadeGroup.setDuration(300);
- mCrossfadeGroup.addTransitions(mCrossfade, new Move());
+ mCrossfadeGroup.addTransition(mCrossfade).addTransition(new ChangeBounds());
mTransition = mCrossfadeGroup;
- mInOutGroup = new TransitionGroup();
+ mInOutGroup = new TransitionSet();
Crossfade inOut = new Crossfade();
inOut.setDuration(300);
inOut.setFadeBehavior(Crossfade.FADE_BEHAVIOR_OUT_IN);
- Move move = new Move();
- move.setStartDelay(150);
- move.setDuration(0);
- mInOutGroup.addTransitions(inOut, move);
+ ChangeBounds changeBounds = new ChangeBounds();
+ changeBounds.setStartDelay(150);
+ changeBounds.setDuration(0);
+ mInOutGroup.addTransition(inOut).addTransition(changeBounds);
- mTextChangeGroup1 = new TransitionGroup();
+ mTextChangeGroup1 = new TransitionSet();
TextChange textChangeInOut = new TextChange();
textChangeInOut.setChangeBehavior(TextChange.CHANGE_BEHAVIOR_OUT_IN);
- mTextChangeGroup1.addTransitions(textChangeInOut, new Move());
+ mTextChangeGroup1.addTransition(textChangeInOut).addTransition(new ChangeBounds());
- mTextChangeGroup2 = new TransitionGroup();
- mTextChangeGroup2.setOrdering(TransitionGroup.SEQUENTIALLY);
+ mTextChangeGroup2 = new TransitionSet();
+ mTextChangeGroup2.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
TextChange textChangeOut = new TextChange();
textChangeOut.setChangeBehavior(TextChange.CHANGE_BEHAVIOR_OUT);
TextChange textChangeIn = new TextChange();
textChangeIn.setChangeBehavior(TextChange.CHANGE_BEHAVIOR_IN);
- mTextChangeGroup2.addTransitions(textChangeOut, new Move(), textChangeIn);
+ mTextChangeGroup2.addTransition(textChangeOut).addTransition(new ChangeBounds()).
+ addTransition(textChangeIn);
}
public void sendMessage(View view) {
diff --git a/tests/TransitionTests/src/com/android/transitiontests/DelayedTransition.java b/tests/TransitionTests/src/com/android/transitiontests/DelayedTransition.java
index f05ea78..fe5f05a 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/DelayedTransition.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/DelayedTransition.java
@@ -19,7 +19,7 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.TransitionManager;
+import android.transition.TransitionManager;
import android.widget.Button;
import android.widget.LinearLayout;
import static android.widget.LinearLayout.LayoutParams;
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo1.java b/tests/TransitionTests/src/com/android/transitiontests/Demo1.java
index ce7f439..5c0cd45 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo1.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo1.java
@@ -21,11 +21,11 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.Scene;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.ChangeBounds;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class Demo1 extends Activity {
@@ -69,9 +69,10 @@ public class Demo1 extends Activity {
public void sendMessage(View view) {
if (mFirstTime) {
mFirstTime = false;
- TransitionGroup transition = new TransitionGroup();
- transition.addTransitions(new Fade().setTargetIds(R.id.resultsText, R.id.resultsList),
- new Move().setTargetIds(R.id.searchContainer));
+ TransitionSet transition = new TransitionSet();
+ transition.addTransition(new Fade().addTargetId(R.id.resultsText).
+ addTargetId(R.id.resultsList)).
+ addTransition(new ChangeBounds().addTargetId(R.id.searchContainer));
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transition);
mTransitionManager.setTransition(mResultsScreen, transition);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo2.java b/tests/TransitionTests/src/com/android/transitiontests/Demo2.java
index 7e1afab..334b777 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo2.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo2.java
@@ -19,13 +19,12 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.Recolor;
-import android.view.transition.Scene;
-import android.view.transition.TransitionInflater;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.ChangeBounds;
+import android.transition.Recolor;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class Demo2 extends Activity {
ViewGroup mSceneRoot;
@@ -51,18 +50,17 @@ public class Demo2 extends Activity {
// mSearchScreen = new Scene(this, mSceneRoot, R.layout.search_screen);
// mResultsScreen = new Scene(this, mSceneRoot, R.layout.results_screen);
try {
- mSearchScreen = TransitionInflater.from(this).
- inflateScene(R.scene.search_scene, mSceneRoot);
- mResultsScreen = TransitionInflater.from(this).
- inflateScene(R.scene.results_scene, mSceneRoot);
+ mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
+ mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
} catch (Exception e) {
System.out.println("Problem loading scene resource: " + e);
}
- TransitionGroup transition = new TransitionGroup();
- transition.addTransitions(new Fade().setTargetIds(R.id.resultsText, R.id.resultsList),
- new Move().setTargetIds(R.id.searchContainer),
- new Recolor().setTargetIds(R.id.container));
+ TransitionSet transition = new TransitionSet();
+ transition.addTransition(new Fade().addTargetId(R.id.resultsText).
+ addTargetId(R.id.resultsList)).
+ addTransition(new ChangeBounds().addTargetId(R.id.searchContainer)).
+ addTransition(new Recolor().addTargetId(R.id.container));
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transition);
mTransitionManager.setTransition(mResultsScreen, transition);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo3.java b/tests/TransitionTests/src/com/android/transitiontests/Demo3.java
index b8daff5..0ffa1f5 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo3.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo3.java
@@ -17,14 +17,14 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.Recolor;
-import android.view.transition.Scene;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.Recolor;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class Demo3 extends Activity {
@@ -41,11 +41,11 @@ public class Demo3 extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mSearchScreen = new Scene(mSceneRoot, R.layout.search_screen, this);
- mResultsScreen = new Scene(mSceneRoot, R.layout.results_screen, this);
+ mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
+ mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
- TransitionGroup transition = new TransitionGroup();
- transition.addTransitions(new Fade(), new Move(), new Recolor());
+ TransitionSet transition = new TransitionSet();
+ transition.addTransition(new Fade()).addTransition(new ChangeBounds()).addTransition(new Recolor());
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transition);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo4.java b/tests/TransitionTests/src/com/android/transitiontests/Demo4.java
index 8be54f5..d1c3358 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo4.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo4.java
@@ -17,14 +17,14 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.Recolor;
-import android.view.transition.Scene;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.Recolor;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class Demo4 extends Activity {
@@ -41,20 +41,22 @@ public class Demo4 extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mSearchScreen = new Scene(mSceneRoot, R.layout.search_screen, this);
- mResultsScreen = new Scene(mSceneRoot, R.layout.results_screen, this);
+ mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
+ mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
- TransitionGroup transitionToResults = new TransitionGroup();
+ TransitionSet transitionToResults = new TransitionSet();
Fade fade = new Fade();
- fade.setTargetIds(R.id.resultsText, R.id.resultsList);
+ fade.addTargetId(R.id.resultsText).addTargetId(R.id.resultsList);
fade.setStartDelay(300);
fade.setDuration(1000);
- transitionToResults.addTransitions(fade, new Move().setTargetIds(R.id.searchContainer),
- new Recolor().setTargetIds(R.id.container));
+ transitionToResults.addTransition(fade).
+ addTransition(new ChangeBounds().addTargetId(R.id.searchContainer)).
+ addTransition(new Recolor().addTargetId(R.id.container));
- TransitionGroup transitionToSearch = new TransitionGroup();
- transitionToSearch.addTransitions(fade, new Move().setTargetIds(R.id.searchContainer),
- new Recolor().setTargetIds(R.id.container));
+ TransitionSet transitionToSearch = new TransitionSet();
+ transitionToSearch.addTransition(fade).
+ addTransition(new ChangeBounds().addTargetId(R.id.searchContainer)).
+ addTransition(new Recolor().addTargetId(R.id.container));
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transitionToSearch);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo5.java b/tests/TransitionTests/src/com/android/transitiontests/Demo5.java
index e64511e..c36abda 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo5.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo5.java
@@ -19,8 +19,8 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
-import android.view.transition.TransitionManager;
+import android.transition.Scene;
+import android.transition.TransitionManager;
public class Demo5 extends Activity {
@@ -36,8 +36,8 @@ public class Demo5 extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mSearchScreen = new Scene(mSceneRoot, R.layout.search_screen, this);
- mResultsScreen = new Scene(mSceneRoot, R.layout.results_screen, this);
+ mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
+ mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java b/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java
index e0fe379..d497abe 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java
@@ -19,8 +19,7 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
-import android.view.transition.TransitionManager;
+import android.transition.TransitionManager;
import android.widget.Button;
public class FadingHierarchy extends Activity {
diff --git a/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java b/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java
index 400e994..000ea9b 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java
@@ -19,10 +19,10 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
+import android.transition.Scene;
import android.widget.Button;
-import android.view.transition.Fade;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.TransitionManager;
public class FadingTest extends Activity {
@@ -31,9 +31,11 @@ public class FadingTest extends Activity {
Scene mScene1, mScene2;
ViewGroup mSceneRoot;
static Fade sFade = new Fade();
+ Scene mCurrentScene;
static {
- sFade.setTargetIds(R.id.removingButton, R.id.invisibleButton, R.id.goneButton);
+ sFade.addTargetId(R.id.removingButton).addTargetId(R.id.invisibleButton).
+ addTargetId(R.id.goneButton);
}
@Override
@@ -56,17 +58,19 @@ public class FadingTest extends Activity {
}
});
- mScene1 = new Scene(mSceneRoot, R.layout.fading_test, this);
- mScene2 = new Scene(mSceneRoot, R.layout.fading_test_scene_2, this);
+ mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test, this);
+ mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_scene_2, this);
- mSceneRoot.setCurrentScene(mScene1);
+ mCurrentScene = mScene1;
}
public void sendMessage(View view) {
- if (mSceneRoot.getCurrentScene() == mScene1) {
+ if (mCurrentScene == mScene1) {
TransitionManager.go(mScene2);
+ mCurrentScene = mScene2;
} else {
TransitionManager.go(mScene1);
+ mCurrentScene = mScene1;
}
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/HierarchicalMove.java b/tests/TransitionTests/src/com/android/transitiontests/HierarchicalMove.java
index 093d7c1..1146e20 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/HierarchicalMove.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/HierarchicalMove.java
@@ -17,12 +17,12 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Move;
-import android.view.transition.Transition;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Transition;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
import android.widget.Button;
import static android.widget.LinearLayout.LayoutParams;
@@ -59,33 +59,37 @@ public class HierarchicalMove extends Activity {
// group (sequentially)
// Move 3
// Move 4/5
- TransitionGroup rootTransition = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
+ TransitionSet rootTransition = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
// button0
- Transition move0 = new Move();
- move0.setTargets(buttons[0]);
+ Transition move0 = new ChangeBounds();
+ move0.addTarget(buttons[0]);
// buttons 1/2/3/4/5
- TransitionGroup group12345 = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
+ TransitionSet group12345 = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
// buttons 1/2
- TransitionGroup group12 = new TransitionGroup(TransitionGroup.TOGETHER);
- Move move1 = new Move();
- move1.setTargets(buttons[1]);
- Move move2 = new Move();
- move2.setTargets(buttons[2]);
- group12.addTransitions(move1, move2);
-
- TransitionGroup group345 = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
- Move move3 = new Move();
- move3.setTargets(buttons[3]);
- Move move45 = new Move();
- move45.setTargets(buttons[4], buttons[5]);
- group345.addTransitions(move3, move45);
-
- group12345.addTransitions(move0, group12, group345);
-
- rootTransition.addTransitions(group12345);
+ TransitionSet group12 = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_TOGETHER);
+ ChangeBounds changeBounds1 = new ChangeBounds();
+ changeBounds1.addTarget(buttons[1]);
+ ChangeBounds changeBounds2 = new ChangeBounds();
+ changeBounds2.addTarget(buttons[2]);
+ group12.addTransition(changeBounds1).addTransition(changeBounds2);
+
+ TransitionSet group345 = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
+ ChangeBounds changeBounds3 = new ChangeBounds();
+ changeBounds3.addTarget(buttons[3]);
+ ChangeBounds changeBounds45 = new ChangeBounds();
+ changeBounds45.addTarget(buttons[4]).addTarget(buttons[5]);
+ group345.addTransition(changeBounds3).addTransition(changeBounds45);
+
+ group12345.addTransition(move0).addTransition(group12).addTransition(group345);
+
+ rootTransition.addTransition(group12345);
rootTransition.setDuration(1000);
mTransition = rootTransition;
diff --git a/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java b/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java
index cf4ea9a..a06ba8f 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java
@@ -16,16 +16,12 @@
package com.android.transitiontests;
import android.app.Activity;
-import android.content.Context;
import android.os.Bundle;
-import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Move;
-import android.view.transition.Scene;
-import android.view.transition.TransitionManager;
+import android.transition.ChangeBounds;
+import android.transition.TransitionManager;
import android.widget.Button;
-import android.widget.RelativeLayout;
import static android.widget.RelativeLayout.ALIGN_PARENT_LEFT;
import static android.widget.RelativeLayout.ALIGN_PARENT_RIGHT;
@@ -46,23 +42,19 @@ public class InstanceTargets extends Activity {
}
public void sendMessage(final View view) {
- TransitionManager.go(mSceneRoot, new Runnable() {
- @Override
- public void run() {
- for (int i = 0; i < mSceneRoot.getChildCount(); ++i) {
- Button button = (Button) mSceneRoot.getChildAt(i);
- LayoutParams params = (LayoutParams) button.getLayoutParams();
- int rules[] = params.getRules();
- if (rules[ALIGN_PARENT_RIGHT] != 0) {
- params.removeRule(ALIGN_PARENT_RIGHT);
- params.addRule(ALIGN_PARENT_LEFT);
- } else {
- params.removeRule(ALIGN_PARENT_LEFT);
- params.addRule(ALIGN_PARENT_RIGHT);
- }
- button.setLayoutParams(params);
- }
+ TransitionManager.beginDelayedTransition(mSceneRoot, new ChangeBounds().addTarget(view));
+ for (int i = 0; i < mSceneRoot.getChildCount(); ++i) {
+ Button button = (Button) mSceneRoot.getChildAt(i);
+ LayoutParams params = (LayoutParams) button.getLayoutParams();
+ int rules[] = params.getRules();
+ if (rules[ALIGN_PARENT_RIGHT] != 0) {
+ params.removeRule(ALIGN_PARENT_RIGHT);
+ params.addRule(ALIGN_PARENT_LEFT);
+ } else {
+ params.removeRule(ALIGN_PARENT_LEFT);
+ params.addRule(ALIGN_PARENT_RIGHT);
}
- }, new Move().setTargets(view));
+ button.setLayoutParams(params);
+ }
}
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java b/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java
index b380225..70257bb 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java
@@ -17,15 +17,12 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.AutoTransition;
-import android.view.transition.Move;
-import android.view.transition.Scene;
-import android.view.transition.TextChange;
-import android.view.transition.Transition;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
import android.widget.RadioButton;
public class InterruptionTest extends Activity {
@@ -35,7 +32,8 @@ public class InterruptionTest extends Activity {
private Scene mScene2;
private Scene mScene3;
private Scene mScene4;
- TransitionGroup mSequencedMove = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
+ TransitionSet mSequencedMove = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -44,24 +42,22 @@ public class InterruptionTest extends Activity {
ViewGroup sceneRoot = (ViewGroup) findViewById(R.id.sceneRoot);
- mScene1 = new Scene(sceneRoot, R.layout.interruption_inner_1, this);
- mScene2 = new Scene(sceneRoot, R.layout.interruption_inner_2, this);
- mScene3 = new Scene(sceneRoot, R.layout.interruption_inner_3, this);
- mScene4 = new Scene(sceneRoot, R.layout.interruption_inner_4, this);
+ mScene1 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_1, this);
+ mScene2 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_2, this);
+ mScene3 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_3, this);
+ mScene4 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_4, this);
mScene1RB = (RadioButton) findViewById(R.id.scene1RB);
mScene2RB = (RadioButton) findViewById(R.id.scene2RB);
mScene3RB = (RadioButton) findViewById(R.id.scene3RB);
mScene4RB = (RadioButton) findViewById(R.id.scene4RB);
- sceneRoot.setCurrentScene(mScene1);
+ ChangeBounds changeBounds1 = new ChangeBounds();
+ changeBounds1.addTargetId(R.id.button);
+ ChangeBounds changeBounds2 = new ChangeBounds();
+ changeBounds2.addTargetId(R.id.button1);
- Move move1 = new Move();
- move1.setTargetIds(R.id.button);
- Move move2 = new Move();
- move2.setTargetIds(R.id.button1);
-
- mSequencedMove.addTransitions(move1, move2);
+ mSequencedMove.addTransition(changeBounds1).addTransition(changeBounds2);
mSequencedMove.setDuration(1000);
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java b/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java
index 87ee874..6629770 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java
@@ -20,18 +20,18 @@ import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewTreeObserver;
-import android.view.transition.Fade;
-import android.view.transition.Scene;
+import android.transition.Fade;
+import android.transition.Scene;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
-import android.view.transition.AutoTransition;
-import android.view.transition.Move;
-import android.view.transition.Transition;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.AutoTransition;
+import android.transition.ChangeBounds;
+import android.transition.Transition;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
import java.util.ArrayList;
import java.util.HashMap;
@@ -78,10 +78,11 @@ public class ListViewAddRemove extends Activity {
}
});
final Transition myTransition = new AutoTransition();
- final TransitionGroup noFadeIn = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
+ final TransitionSet noFadeIn = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
Fade fadeIn = new Fade(Fade.IN);
fadeIn.setDuration(50);
- noFadeIn.addTransitions(new Fade(Fade.OUT), new Move(), fadeIn);
+ noFadeIn.addTransition(new Fade(Fade.OUT)).addTransition(new ChangeBounds()).addTransition(fadeIn);
myTransition.addListener(new Transition.TransitionListenerAdapter() {
@Override
diff --git a/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java b/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java
index 06fa9f4..34ec6cc 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java
@@ -19,14 +19,14 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
+import android.transition.Scene;
import android.widget.TextView;
-import android.view.transition.Fade;
-import android.view.transition.Recolor;
-import android.view.transition.Slide;
-import android.view.transition.Transition;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.Recolor;
+import android.transition.Slide;
+import android.transition.Transition;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class LoginActivity extends Activity {
@@ -43,32 +43,33 @@ public class LoginActivity extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mLoginScene = new Scene(mSceneRoot, R.layout.activity_login, this);
- mPasswordScene = new Scene(mSceneRoot, R.layout.login_password, this);
- mIncorrectPasswordScene = new Scene(mSceneRoot, R.layout.incorrect_password, this);
- mUsernameTakenScene = new Scene(mSceneRoot, R.layout.username_taken, this);
- mSuccessScene = new Scene(mSceneRoot, R.layout.success, this);
- mNewUserScene = new Scene(mSceneRoot, R.layout.new_user, this);
+ mLoginScene = Scene.getSceneForLayout(mSceneRoot, R.layout.activity_login, this);
+ mPasswordScene = Scene.getSceneForLayout(mSceneRoot, R.layout.login_password, this);
+ mIncorrectPasswordScene = Scene.getSceneForLayout(mSceneRoot, R.layout.incorrect_password, this);
+ mUsernameTakenScene = Scene.getSceneForLayout(mSceneRoot, R.layout.username_taken, this);
+ mSuccessScene = Scene.getSceneForLayout(mSceneRoot, R.layout.success, this);
+ mNewUserScene = Scene.getSceneForLayout(mSceneRoot, R.layout.new_user, this);
mTransitionManager = new TransitionManager();
// Custom transitions in/out of NewUser screen - slide in the 2nd password UI
- TransitionGroup slider = new TransitionGroup();
- slider.addTransitions(new Slide().setTargetIds(R.id.retype, R.id.retypeEdit));
- slider.addTransitions(new Recolor().setTargetIds(R.id.password, R.id.passwordEdit));
- slider.addTransitions(new Fade());
+ TransitionSet slider = new TransitionSet();
+ slider.addTransition(new Slide().addTargetId(R.id.retype).addTargetId(R.id.retypeEdit));
+ slider.addTransition(new Recolor().addTargetId(R.id.password).
+ addTargetId(R.id.passwordEdit));
+ slider.addTransition(new Fade());
mTransitionManager.setTransition(mLoginScene, mNewUserScene, slider);
mTransitionManager.setTransition(mPasswordScene, mNewUserScene, slider);
mTransitionManager.setTransition(mNewUserScene, mLoginScene, slider);
mTransitionManager.setTransition(mNewUserScene, mPasswordScene, slider);
// Custom transitions with recoloring password field
- Transition colorizer = new Recolor().setTargetIds(R.id.password, R.id.passwordEdit);
+ Transition colorizer = new Recolor().addTargetId(R.id.password).
+ addTargetId(R.id.passwordEdit);
mTransitionManager.setTransition(mLoginScene, mPasswordScene, colorizer);
mTransitionManager.setTransition(mPasswordScene, mLoginScene, colorizer);
mCurrentScene = mLoginScene;
- mSceneRoot.setCurrentScene(mLoginScene);
}
public void applyScene(Scene scene) {
diff --git a/tests/TransitionTests/src/com/android/transitiontests/LoginActivityFromResources.java b/tests/TransitionTests/src/com/android/transitiontests/LoginActivityFromResources.java
index ff617aa..600c791 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/LoginActivityFromResources.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/LoginActivityFromResources.java
@@ -19,10 +19,10 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
-import android.view.transition.TransitionInflater;
+import android.transition.Scene;
+import android.transition.TransitionInflater;
import android.widget.TextView;
-import android.view.transition.TransitionManager;
+import android.transition.TransitionManager;
public class LoginActivityFromResources extends Activity {
@@ -36,7 +36,7 @@ public class LoginActivityFromResources extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
- View container = (View) findViewById(R.id.container);
+ View container = findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
}
@@ -50,21 +50,19 @@ public class LoginActivityFromResources extends Activity {
if (mTransitionManager == null) {
TransitionInflater inflater = TransitionInflater.from(this);
- mLoginScene = inflater.inflateScene(R.scene.login_scene, mSceneRoot);
- mPasswordScene = inflater.inflateScene(R.scene.password_scene, mSceneRoot);
- mIncorrectPasswordScene =
- inflater.inflateScene(R.scene.incorrect_password_scene,mSceneRoot);
- mUsernameTakenScene =
- inflater.inflateScene(R.scene.username_taken_scene, mSceneRoot);
- mSuccessScene = inflater.inflateScene(R.scene.success_scene, mSceneRoot);
- mNewUserScene = inflater.inflateScene(R.scene.new_user_scene, mSceneRoot);
+ mLoginScene = Scene.getSceneForLayout(mSceneRoot, R.layout.activity_login, this);
+ mPasswordScene = Scene.getSceneForLayout(mSceneRoot, R.layout.login_password, this);
+ mIncorrectPasswordScene = Scene.getSceneForLayout(mSceneRoot, R.layout
+ .incorrect_password, this);
+ mUsernameTakenScene = Scene.getSceneForLayout(mSceneRoot, R.layout.username_taken, this);
+ mSuccessScene = Scene.getSceneForLayout(mSceneRoot, R.layout.success, this);
+ mNewUserScene = Scene.getSceneForLayout(mSceneRoot, R.layout.new_user, this);
mTransitionManager =
inflater.inflateTransitionManager(R.transition.login_transition_mgr,
mSceneRoot);
mCurrentScene = mLoginScene;
- mSceneRoot.setCurrentScene(mLoginScene);
}
TextView textView = (TextView) view;
CharSequence text = textView.getText();
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java b/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java
index e559c72..1ee8621 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java
@@ -17,11 +17,11 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Move;
-import android.view.transition.Scene;
-import android.view.transition.TransitionManager;
+import android.transition.Scene;
+import android.transition.TransitionManager;
import android.widget.Button;
public class Reparenting extends Activity {
@@ -67,7 +67,7 @@ public class Reparenting extends Activity {
newParent.addView(v);
}
});
- Move reparent = new Move();
+ ChangeBounds reparent = new ChangeBounds();
reparent.setReparent(true);
TransitionManager.go(newScene, reparent);
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java b/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java
index 3d7bd9b..1aee258 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java
@@ -19,10 +19,10 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
-import android.view.transition.TransitionInflater;
-import android.view.transition.Transition;
-import android.view.transition.TransitionManager;
+import android.transition.Scene;
+import android.transition.TransitionInflater;
+import android.transition.Transition;
+import android.transition.TransitionManager;
public class ResourceLoadingTest extends Activity {
@@ -54,7 +54,7 @@ public class ResourceLoadingTest extends Activity {
mTransitionManager =
inflater.inflateTransitionManager(R.transition.my_transition_mgr,
mSceneRoot);
- Scene loadedScene = inflater.inflateScene(R.scene.my_scene, mSceneRoot);
+ Scene loadedScene = new Scene(mSceneRoot);
System.out.println("loadedScene = " + loadedScene);
Transition loadedTransition = inflater.inflateTransition(R.transition.my_transition);
System.out.println("loadedTransition = " + loadedTransition);
@@ -63,11 +63,11 @@ public class ResourceLoadingTest extends Activity {
}
}
if (mCurrentScene == RESULTS_SCREEN) {
- Scene scene = mInflater.inflateScene(R.scene.search_scene, mSceneRoot);
+ Scene scene = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
mTransitionManager.transitionTo(scene);
mCurrentScene = SEARCH_SCREEN;
} else {
- Scene scene = mInflater.inflateScene(R.scene.results_scene, mSceneRoot);
+ Scene scene = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
mTransitionManager.transitionTo(scene);
mCurrentScene = RESULTS_SCREEN;
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java
index 374a9ab..7504058 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java
@@ -18,14 +18,14 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.Recolor;
-import android.view.transition.Scene;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.Recolor;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class ScenesTestAutoTargets extends Activity {
@@ -42,11 +42,11 @@ public class ScenesTestAutoTargets extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mSearchScreen = new Scene(mSceneRoot, R.layout.search_screen, this);
- mResultsScreen = new Scene(mSceneRoot, R.layout.results_screen, this);
+ mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
+ mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
- TransitionGroup transition = new TransitionGroup();
- transition.addTransitions(new Fade(), new Move(), new Recolor());
+ TransitionSet transition = new TransitionSet();
+ transition.addTransition(new Fade()).addTransition(new ChangeBounds()).addTransition(new Recolor());
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transition);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java
index fb1ba07..23b28ec 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java
@@ -20,10 +20,10 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.AutoTransition;
-import android.view.transition.Scene;
-import android.view.transition.Transition;
-import android.view.transition.TransitionManager;
+import android.transition.AutoTransition;
+import android.transition.Scene;
+import android.transition.Transition;
+import android.transition.TransitionManager;
public class ScenesTestAutoTransition extends Activity {
@@ -40,8 +40,8 @@ public class ScenesTestAutoTransition extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mSearchScreen = new Scene(mSceneRoot, R.layout.search_screen, this);
- mResultsScreen = new Scene(mSceneRoot, R.layout.results_screen, this);
+ mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
+ mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
}
public void sendMessage(View view) {
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition2.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition2.java
index c75d419..5a9fa9d 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition2.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition2.java
@@ -20,8 +20,8 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
-import android.view.transition.TransitionManager;
+import android.transition.Scene;
+import android.transition.TransitionManager;
public class ScenesTestAutoTransition2 extends Activity {
@@ -38,8 +38,8 @@ public class ScenesTestAutoTransition2 extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mSearchScreen = new Scene(mSceneRoot, R.layout.search_screen, this);
- mResultsScreen = new Scene(mSceneRoot, R.layout.results_screen, this);
+ mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
+ mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
}
public void sendMessage(View view) {
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java
index 399c2be..c6011f2 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java
@@ -18,14 +18,14 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.Recolor;
-import android.view.transition.Scene;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.Recolor;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
public class ScenesTestv21 extends Activity {
@@ -42,21 +42,22 @@ public class ScenesTestv21 extends Activity {
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
- mSearchScreen = new Scene(mSceneRoot, R.layout.search_screen, this);
- mResultsScreen = new Scene(mSceneRoot, R.layout.results_screen, this);
+ mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
+ mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
- TransitionGroup transitionToResults = new TransitionGroup();
+ TransitionSet transitionToResults = new TransitionSet();
Fade fade = new Fade();
- fade.setTargetIds(R.id.resultsText, R.id.resultsList);
+ fade.addTargetId(R.id.resultsText).addTargetId(R.id.resultsList);
fade.setStartDelay(300);
- transitionToResults.addTransitions(fade);
- transitionToResults.addTransitions(new Move().setTargetIds(R.id.searchContainer));
- transitionToResults.addTransitions(new Recolor().setTargetIds(R.id.container));
+ transitionToResults.addTransition(fade);
+ transitionToResults.addTransition(new ChangeBounds().addTargetId(R.id.searchContainer));
+ transitionToResults.addTransition(new Recolor().addTargetId(R.id.container));
- TransitionGroup transitionToSearch = new TransitionGroup();
- transitionToSearch.addTransitions(new Fade().setTargetIds(R.id.resultsText, R.id.resultsList));
- transitionToSearch.addTransitions(new Move().setTargetIds(R.id.searchContainer));
- transitionToSearch.addTransitions(new Recolor().setTargetIds(R.id.container));
+ TransitionSet transitionToSearch = new TransitionSet();
+ transitionToSearch.addTransition(new Fade().addTargetId(R.id.resultsText).
+ addTargetId(R.id.resultsList));
+ transitionToSearch.addTransition(new ChangeBounds().addTargetId(R.id.searchContainer));
+ transitionToSearch.addTransition(new Recolor().addTargetId(R.id.container));
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transitionToSearch);
mTransitionManager.setTransition(mResultsScreen, transitionToResults);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java b/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java
index 6b34420..ab1dc26 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java
@@ -19,13 +19,13 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
-import android.view.transition.Transition;
+import android.transition.Scene;
+import android.transition.Transition;
+import android.transition.TransitionSet;
import android.widget.Button;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.ChangeBounds;
+import android.transition.TransitionManager;
public class SequenceTest extends Activity {
@@ -33,7 +33,8 @@ public class SequenceTest extends Activity {
Button mRemovingButton, mInvisibleButton, mGoneButton;
Scene mScene1, mScene2;
ViewGroup mSceneRoot;
- TransitionGroup sequencedFade, reverseSequencedFade;
+ TransitionSet sequencedFade, reverseSequencedFade;
+ Scene mCurrentScene;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -47,27 +48,33 @@ public class SequenceTest extends Activity {
mInvisibleButton = (Button) findViewById(R.id.invisibleButton);
mGoneButton = (Button) findViewById(R.id.goneButton);
- mScene1 = new Scene(mSceneRoot, R.layout.fading_test, this);
- mScene2 = new Scene(mSceneRoot, R.layout.fading_test_scene_2, this);
+ mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test, this);
+ mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_scene_2, this);
- Transition fade1 = new Fade().setTargetIds(R.id.removingButton);
- Transition fade2 = new Fade().setTargetIds(R.id.invisibleButton);
- Transition fade3 = new Fade().setTargetIds(R.id.goneButton);
- TransitionGroup fader = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
- fader.addTransitions(fade1, fade2, fade3, new Move());
+ Transition fade1 = new Fade().addTargetId(R.id.removingButton);
+ Transition fade2 = new Fade().addTargetId(R.id.invisibleButton);
+ Transition fade3 = new Fade().addTargetId(R.id.goneButton);
+ TransitionSet fader = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
+ fader.addTransition(fade1).addTransition(fade2).addTransition(fade3).
+ addTransition(new ChangeBounds());
sequencedFade = fader;
- reverseSequencedFade = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
- reverseSequencedFade.addTransitions(new Move(), fade3, fade2, fade1);
+ reverseSequencedFade = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
+ reverseSequencedFade.addTransition(new ChangeBounds()).addTransition(fade3).addTransition(fade2).
+ addTransition(fade1);
- mSceneRoot.setCurrentScene(mScene1);
+ mCurrentScene = mScene1;
}
public void sendMessage(View view) {
- if (mSceneRoot.getCurrentScene() == mScene1) {
+ if (mCurrentScene == mScene1) {
TransitionManager.go(mScene2, sequencedFade);
+ mCurrentScene = mScene2;
} else {
TransitionManager.go(mScene1, reverseSequencedFade);
+ mCurrentScene = mScene1;
}
}
}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java b/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java
index 972d30e..52c21c9 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java
@@ -17,15 +17,15 @@ package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
+import android.transition.ChangeBounds;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
+import android.transition.Scene;
+import android.transition.TransitionSet;
import android.widget.Button;
-import android.view.transition.Fade;
-import android.view.transition.Move;
-import android.view.transition.Transition;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Fade;
+import android.transition.Transition;
+import android.transition.TransitionManager;
public class SequenceTestSimple extends Activity {
@@ -34,7 +34,8 @@ public class SequenceTestSimple extends Activity {
Scene mScene1, mScene2;
ViewGroup mSceneRoot;
Transition sequencedFade;
- TransitionGroup sequencedFadeReverse;
+ TransitionSet sequencedFadeReverse;
+ Scene mCurrentScene;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -46,25 +47,29 @@ public class SequenceTestSimple extends Activity {
mRemovingButton = (Button) findViewById(R.id.removingButton);
- mScene1 = new Scene(mSceneRoot, R.layout.fading_test_simple, this);
- mScene2 = new Scene(mSceneRoot, R.layout.fading_test_simple2, this);
+ mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple, this);
+ mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple2, this);
- TransitionGroup fader = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
- fader.addTransitions(new Fade().setTargetIds(R.id.removingButton));
- fader.addTransitions(new Move().setTargetIds(R.id.sceneSwitchButton));
+ TransitionSet fader = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
+ fader.addTransition(new Fade().addTargetId(R.id.removingButton));
+ fader.addTransition(new ChangeBounds().addTargetId(R.id.sceneSwitchButton));
sequencedFade = fader;
- sequencedFadeReverse = new TransitionGroup(TransitionGroup.SEQUENTIALLY);
- sequencedFadeReverse.addTransitions(new Move().setTargetIds(R.id.sceneSwitchButton));
- sequencedFadeReverse.addTransitions(new Fade().setTargetIds(R.id.removingButton));
+ sequencedFadeReverse = new TransitionSet().
+ setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
+ sequencedFadeReverse.addTransition(new ChangeBounds().addTargetId(R.id.sceneSwitchButton));
+ sequencedFadeReverse.addTransition(new Fade().addTargetId(R.id.removingButton));
- mSceneRoot.setCurrentScene(mScene1);
+ mCurrentScene = mScene1;
}
public void sendMessage(View view) {
- if (mSceneRoot.getCurrentScene() == mScene1) {
+ if (mCurrentScene == mScene1) {
TransitionManager.go(mScene2, sequencedFade);
+ mCurrentScene = mScene2;
} else {
TransitionManager.go(mScene1, sequencedFadeReverse);
+ mCurrentScene = mScene1;
}
}}
diff --git a/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java b/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java
index aa76923..05af044 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java
@@ -27,11 +27,11 @@ import android.view.SurfaceView;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Crossfade;
-import android.view.transition.Move;
-import android.view.transition.Scene;
-import android.view.transition.TransitionGroup;
-import android.view.transition.TransitionManager;
+import android.transition.Crossfade;
+import android.transition.ChangeBounds;
+import android.transition.Scene;
+import android.transition.TransitionSet;
+import android.transition.TransitionManager;
import android.widget.Button;
import static android.widget.LinearLayout.LayoutParams;
@@ -66,8 +66,9 @@ public class SurfaceAndTextureViews extends Activity {
mTextureView.setLayoutParams(new LayoutParams(SMALL_SIZE, SMALL_SIZE));
container.addView(mTextureView);
- final TransitionGroup transition = new TransitionGroup();
- transition.addTransitions(new Move(), new Crossfade().setTargetIds(0, 1, 2));
+ final TransitionSet transition = new TransitionSet();
+ transition.addTransition(new ChangeBounds()).addTransition(new Crossfade().addTargetId(0).
+ addTargetId(1).addTargetId(2));
toggleButton.setOnClickListener(new View.OnClickListener() {
@Override
diff --git a/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java b/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java
index 433a91c..c824956 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java
@@ -20,11 +20,11 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.transition.Scene;
-import android.view.transition.Transition;
+import android.transition.Scene;
+import android.transition.Transition;
import android.widget.Button;
import android.widget.LinearLayout;
-import android.view.transition.TransitionManager;
+import android.transition.TransitionManager;
import java.util.HashMap;