summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/app/Activity.java5
-rw-r--r--core/java/android/app/EnterTransitionCoordinator.java7
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;
}
}