Additional fixes for "back" with translucent windows.

Ensure background is mutated before changing its alpha.
Ensure resetViews is called when activity options is set.

Bug 16215650

Change-Id: I8482532777652a93b2c0d05c1b902516d281baf0
This commit is contained in:
George Mount
2014-09-03 07:27:47 -07:00
parent 6906771d76
commit 99c82fd1de
3 changed files with 4 additions and 0 deletions

View File

@@ -151,6 +151,7 @@ class ActivityTransitionState {
mEnterActivityOptions = options;
mIsEnterTriggered = false;
if (mEnterActivityOptions.isReturning()) {
restoreExitedViews();
int result = mEnterActivityOptions.getResultCode();
if (result != 0) {
activity.onActivityReenter(result, mEnterActivityOptions.getResultData());

View File

@@ -466,6 +466,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
Drawable background = getDecor().getBackground();
if (background != null) {
background = background.mutate();
getWindow().setBackgroundDrawable(background);
mBackgroundAnimator = ObjectAnimator.ofInt(background, "alpha", 255);
mBackgroundAnimator.setDuration(getFadeDuration());
mBackgroundAnimator.addListener(new AnimatorListenerAdapter() {

View File

@@ -259,6 +259,8 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator {
ViewGroup decor = getDecor();
Drawable background;
if (decor != null && (background = decor.getBackground()) != null) {
background = background.mutate();
getWindow().setBackgroundDrawable(background);
mBackgroundAnimator = ObjectAnimator.ofInt(background, "alpha", 0);
mBackgroundAnimator.addListener(new AnimatorListenerAdapter() {
@Override