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:
@@ -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());
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user