From f3dbdc66d784a007a51b8d40c3ab89e21f1fbd8c Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Thu, 5 Sep 2013 12:57:33 -0700 Subject: [PATCH] Minor fixes to animation ApiDemos Many of the original animation demos still had hardwareAccelerated="false" in their activity tag. This was originally necessary due to the state of the hw renderer in 3.0, but is no longer necessary. Also, added documentation to the new Transitions demo. Issue #7902583 Update animation ApiDemos to use hw acceleration Change-Id: I7add3acc10d8fa36648e1869a3ec91088b2e199d --- samples/ApiDemos/AndroidManifest.xml | 8 -------- .../android/apis/animation/Transitions.java | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml index a24af29e2..bbb01b49b 100644 --- a/samples/ApiDemos/AndroidManifest.xml +++ b/samples/ApiDemos/AndroidManifest.xml @@ -1254,7 +1254,6 @@ @@ -1264,7 +1263,6 @@ @@ -1274,7 +1272,6 @@ @@ -1284,7 +1281,6 @@ @@ -1294,7 +1290,6 @@ @@ -1304,7 +1299,6 @@ @@ -1323,7 +1317,6 @@ @@ -1333,7 +1326,6 @@ diff --git a/samples/ApiDemos/src/com/example/android/apis/animation/Transitions.java b/samples/ApiDemos/src/com/example/android/apis/animation/Transitions.java index b2983cdb7..4878c5f19 100644 --- a/samples/ApiDemos/src/com/example/android/apis/animation/Transitions.java +++ b/samples/ApiDemos/src/com/example/android/apis/animation/Transitions.java @@ -24,6 +24,12 @@ import android.transition.TransitionInflater; import android.transition.TransitionManager; import com.example.android.apis.R; +/** + * This application demonstrates some of the capabilities and uses of the + * {@link android.transition transitions} APIs. Scenes and a TransitionManager + * are loaded from resource files and transitions are run between those scenes + * as well as a dynamically-configured scene. + */ public class Transitions extends Activity { Scene mScene1, mScene2, mScene3; @@ -39,6 +45,11 @@ public class Transitions extends Activity { TransitionInflater inflater = TransitionInflater.from(this); + // Note that this is not the only way to create a Scene object, but that + // loading them from layout resources cooperates with the + // TransitionManager that we are also loading from resources, and which + // uses the same layout resource files to determine the scenes to transition + // from/to. mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_scene1, this); mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_scene2, this); mScene3 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_scene3, this); @@ -58,7 +69,10 @@ public class Transitions extends Activity { mTransitionManager.transitionTo(mScene3); break; case R.id.scene4: - TransitionManager.beginDelayedTransition(mSceneRoot, null); + // scene4 is not an actual 'Scene', but rather a dynamic change in the UI, + // transitioned to using beginDelayedTransition() to tell the TransitionManager + // to get ready to run a transition at the next frame + TransitionManager.beginDelayedTransition(mSceneRoot); setNewSize(R.id.view1, 150, 25); setNewSize(R.id.view2, 150, 25); setNewSize(R.id.view3, 150, 25);