diff options
| author | Chet Haase <chet@google.com> | 2012-05-18 14:17:57 -0700 |
|---|---|---|
| committer | Chet Haase <chet@google.com> | 2013-04-18 13:33:13 -0700 |
| commit | faebd8f0795b7d275fb4e503533c8c0c4a9acc21 (patch) | |
| tree | 464de8bb5dcd9ae99402ebb630d329dc8ce953cc /core/java/android/view/View.java | |
| parent | b3caa9200a61cde1178a2c83419de56579d3c5a5 (diff) | |
| download | frameworks_base-faebd8f0795b7d275fb4e503533c8c0c4a9acc21.zip frameworks_base-faebd8f0795b7d275fb4e503533c8c0c4a9acc21.tar.gz frameworks_base-faebd8f0795b7d275fb4e503533c8c0c4a9acc21.tar.bz2 | |
First draft of Scenes & Transitions feature
This checkin has preliminary API (in flux, definitely changes still
to be made) and implementation for a new "Scenes & Transitions" feature.
The current implementation allows you to define different Scenes
(via layout resource IDs or callbacks) and Transitions to be used when
changing to those scenes. By default, scene changes will use AutoTransition,
which generally does the right thing.
There are no overview docs or tutorials yet. The best way to learn how things
work is to see the code for the various tests in
frameworks/base/tests/TransitionTests.
Expect the API to change. Expect the implementation to change (mostly to add
more functionality). Expect bugs, but tell me if things do not work
as expected.
Change-Id: Ib025a9f565678b225afa4759325cf6d496cc7215
Diffstat (limited to 'core/java/android/view/View.java')
| -rw-r--r-- | core/java/android/view/View.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 2903b6f..7aa2cbf 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -73,6 +73,7 @@ import android.view.animation.Transformation; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; +import android.view.transition.Scene; import android.widget.ScrollBarDrawable; import static android.os.Build.VERSION_CODES.*; @@ -1572,6 +1573,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ protected Object mTag; + private Scene mCurrentScene = null; + // for mPrivateFlags: /** {@hide} */ static final int PFLAG_WANTS_FOCUS = 0x00000001; @@ -12037,6 +12040,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mCurrentAnimation = null; + mCurrentScene = null; + resetAccessibilityStateChanged(); } @@ -17758,6 +17763,31 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** + * Set the current Scene that this view is in. The current scene is set only + * on the root view of a scene, not for every view in that hierarchy. This + * information is used by Scene to determine whether there is a previous + * scene which should be exited before the new scene is entered. + * + * @param scene The new scene being set on the view + * + * @hide + */ + public void setCurrentScene(Scene scene) { + mCurrentScene = scene; + } + + /** + * Gets the current {@link Scene} set on this view. A scene is set on a view + * only if that view is the scene root. + * + * @return The current Scene set on this view. A value of null indicates that + * no Scene is current set. + */ + public Scene getCurrentScene() { + return mCurrentScene; + } + + /** * Interface definition for a callback to be invoked when a hardware key event is * dispatched to this view. The callback will be invoked before the key event is * given to the view. This is only useful for hardware keyboards; a software input |
