summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2014-06-18 22:58:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-18 22:47:18 +0000
commit52cd83e6cfc3559a5b6fbe62e17359211482f0a8 (patch)
treebdb418420a5abf920196c434421497931268410c
parente48df005750549b5531a916368f168189e370acc (diff)
parent3cc716c445688228311bead8641c467e91effab9 (diff)
downloadframeworks_base-52cd83e6cfc3559a5b6fbe62e17359211482f0a8.zip
frameworks_base-52cd83e6cfc3559a5b6fbe62e17359211482f0a8.tar.gz
frameworks_base-52cd83e6cfc3559a5b6fbe62e17359211482f0a8.tar.bz2
Merge "Don't make translucent window opaque during activity transition."
-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;
}
}