diff options
author | George Mount <mount@google.com> | 2014-06-12 16:35:35 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2014-06-18 20:21:47 +0000 |
commit | 3cc716c445688228311bead8641c467e91effab9 (patch) | |
tree | 33f1a5fcf94fe6b433ea5719da9f4feed11dbf4c | |
parent | 17982084432886af7dea8fc4dc2c309cef18169e (diff) | |
download | frameworks_base-3cc716c445688228311bead8641c467e91effab9.zip frameworks_base-3cc716c445688228311bead8641c467e91effab9.tar.gz frameworks_base-3cc716c445688228311bead8641c467e91effab9.tar.bz2 |
Don't make translucent window opaque during activity transition.
Bug 15535332
Returning transitions will continue to not work until
Bug 14869070 is fixed.
Change-Id: If0128b58eb852b037924ae6dea8e975fedbe5be7
-rw-r--r-- | core/java/android/app/Activity.java | 5 | ||||
-rw-r--r-- | core/java/android/app/EnterTransitionCoordinator.java | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 90615d3..9132883 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -5323,13 +5323,15 @@ public class Activity extends ContextThemeWrapper * drawn and it is safe to make this Activity translucent again. * @param options activity options delivered to the activity below this one. The options * are retrieved using {@link #getActivityOptions}. + * @return <code>true</code> if Window was opaque and will become translucent or + * <code>false</code> if window was translucent and no change needed to be made. * * @see #convertFromTranslucent() * @see TranslucentConversionListener * * @hide */ - public void convertToTranslucent(TranslucentConversionListener callback, + public boolean convertToTranslucent(TranslucentConversionListener callback, ActivityOptions options) { boolean drawComplete; try { @@ -5346,6 +5348,7 @@ public class Activity extends ContextThemeWrapper // Window is already translucent. mTranslucentCallback.onTranslucentConversionComplete(drawComplete); } + return mChangeCanvasToTranslucent; } /** @hide */ diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java index 365cc8e..1d7a0ec 100644 --- a/core/java/android/app/EnterTransitionCoordinator.java +++ b/core/java/android/app/EnterTransitionCoordinator.java @@ -55,6 +55,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator { private boolean mIsExitTransitionComplete; private boolean mIsReadyForTransition; private Bundle mSharedElementsBundle; + private boolean mWasOpaque; public EnterTransitionCoordinator(Activity activity, ResultReceiver resultReceiver, ArrayList<String> sharedElementNames, boolean isReturning) { @@ -191,7 +192,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator { protected void prepareEnter() { mActivity.overridePendingTransition(0, 0); if (!mIsReturning) { - mActivity.convertToTranslucent(null, null); + mWasOpaque = mActivity.convertToTranslucent(null, null); Drawable background = getDecor().getBackground(); if (background != null) { getWindow().setBackgroundDrawable(null); @@ -376,7 +377,9 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator { private void makeOpaque() { if (!mHasStopped && mActivity != null) { - mActivity.convertFromTranslucent(); + if (mWasOpaque) { + mActivity.convertFromTranslucent(); + } mActivity = null; } } |