diff options
author | George Mount <mount@google.com> | 2014-07-01 22:10:35 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-01 14:40:15 +0000 |
commit | 009edbb2769135dbab9ab6615354de288c5d47f5 (patch) | |
tree | 56148304d141f5390b2945a4f2533d55aaa5bf0a /core | |
parent | 9d9f70329942569013d9f121e138f3fcc57f19f8 (diff) | |
parent | 0b6f3e1afa78467cfe166c222295df1f7ed7d4c0 (diff) | |
download | frameworks_base-009edbb2769135dbab9ab6615354de288c5d47f5.zip frameworks_base-009edbb2769135dbab9ab6615354de288c5d47f5.tar.gz frameworks_base-009edbb2769135dbab9ab6615354de288c5d47f5.tar.bz2 |
Merge "Don't return null from ActivityOptions.makeSceneTransitionAnimation."
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/ActivityOptions.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java index 6b5549d..f9c2c8b 100644 --- a/core/java/android/app/ActivityOptions.java +++ b/core/java/android/app/ActivityOptions.java @@ -124,6 +124,8 @@ public class ActivityOptions { public static final int ANIM_THUMBNAIL_SCALE_DOWN = 4; /** @hide */ public static final int ANIM_SCENE_TRANSITION = 5; + /** @hide */ + public static final int ANIM_DEFAULT = 6; private String mPackageName; private int mAnimationType = ANIM_NONE; @@ -344,10 +346,9 @@ public class ActivityOptions { * enabled on the calling Activity to cause an exit transition. The same must be in * the called Activity to get an entering transition.</p> * @param activity The Activity whose window contains the shared elements. - * @param sharedElement The View to transition to the started Activity. sharedElement must - * have a non-null sharedElementName. - * @param sharedElementName The shared element name as used in the target Activity. This may - * be null if it has the same name as sharedElement. + * @param sharedElement The View to transition to the started Activity. + * @param sharedElementName The shared element name as used in the target Activity. This + * must not be null. * @return Returns a new ActivityOptions object that you can use to * supply these options as the options Bundle when starting an activity. * @see android.transition.Transition#setEpicenterCallback( @@ -374,16 +375,16 @@ public class ActivityOptions { * a unique shared element name. * @return Returns a new ActivityOptions object that you can use to * supply these options as the options Bundle when starting an activity. - * Returns null if the Window does not have {@link Window#FEATURE_CONTENT_TRANSITIONS}. * @see android.transition.Transition#setEpicenterCallback( * android.transition.Transition.EpicenterCallback) */ public static ActivityOptions makeSceneTransitionAnimation(Activity activity, Pair<View, String>... sharedElements) { + ActivityOptions opts = new ActivityOptions(); if (!activity.getWindow().hasFeature(Window.FEATURE_CONTENT_TRANSITIONS)) { - return null; + opts.mAnimationType = ANIM_DEFAULT; + return opts; } - ActivityOptions opts = new ActivityOptions(); opts.mAnimationType = ANIM_SCENE_TRANSITION; ArrayList<String> names = new ArrayList<String>(); @@ -642,6 +643,9 @@ public class ActivityOptions { * methods that take an options Bundle. */ public Bundle toBundle() { + if (mAnimationType == ANIM_DEFAULT) { + return null; + } Bundle b = new Bundle(); if (mPackageName != null) { b.putString(KEY_PACKAGE_NAME, mPackageName); |