Skip to content

Commit d5895a7

Browse files
committed
Improve transition out of recents
- During the transition, fade the bg to black - Exiting activity fades to black - Recents background no longer fades away, because then it would fight against the fade to black happening behind it
1 parent 0891a89 commit d5895a7

File tree

5 files changed

+30
-33
lines changed

5 files changed

+30
-33
lines changed

packages/SystemUI/res/layout-land/status_bar_recent_panel.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
systemui:recentItemLayout="@layout/status_bar_recent_item"
2828
>
2929

30-
<ImageView
31-
android:id="@+id/recents_transition_placeholder_icon"
32-
android:layout_width="wrap_content"
33-
android:layout_height="wrap_content"
34-
android:visibility="invisible" />
35-
3630
<FrameLayout
3731
android:id="@+id/recents_bg_protect"
3832
android:background="@drawable/status_bar_recents_background"
@@ -42,6 +36,12 @@
4236
android:clipToPadding="false"
4337
android:clipChildren="false">
4438

39+
<ImageView
40+
android:id="@+id/recents_transition_placeholder_icon"
41+
android:layout_width="wrap_content"
42+
android:layout_height="wrap_content"
43+
android:visibility="invisible" />
44+
4545
<com.android.systemui.recent.RecentsHorizontalScrollView android:id="@+id/recents_container"
4646
android:layout_width="wrap_content"
4747
android:layout_height="match_parent"

packages/SystemUI/res/layout-port/status_bar_recent_panel.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@
2727
systemui:recentItemLayout="@layout/status_bar_recent_item"
2828
>
2929

30-
<ImageView
31-
android:id="@+id/recents_transition_placeholder_icon"
32-
android:layout_width="wrap_content"
33-
android:layout_height="wrap_content"
34-
android:visibility="invisible" />
35-
3630
<FrameLayout
3731
android:id="@+id/recents_bg_protect"
3832
android:background="@drawable/status_bar_recents_background"
3933
android:layout_width="match_parent"
4034
android:layout_height="match_parent"
4135
android:layout_alignParentBottom="true">
4236

37+
<ImageView
38+
android:id="@+id/recents_transition_placeholder_icon"
39+
android:layout_width="wrap_content"
40+
android:layout_height="wrap_content"
41+
android:visibility="invisible" />
42+
4343
<com.android.systemui.recent.RecentsVerticalScrollView
4444
android:id="@+id/recents_container"
4545
android:layout_width="match_parent"

packages/SystemUI/src/com/android/systemui/recent/Choreographer.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ void createAnimation(boolean appearing) {
102102
builder.with(noRecentAppsFadeAnim);
103103
}
104104

105-
Drawable background = mScrimView.getBackground();
106-
if (background != null) {
107-
Animator bgAnim = ObjectAnimator.ofInt(background,
108-
"alpha", appearing ? 0 : 255, appearing ? 255 : 0);
109-
bgAnim.setDuration(appearing ? SCRIM_DURATION : CLOSE_DURATION);
110-
builder.with(bgAnim);
105+
if (appearing) {
106+
Drawable background = mScrimView.getBackground();
107+
if (background != null) {
108+
Animator bgAnim = ObjectAnimator.ofInt(background,
109+
"alpha", appearing ? 0 : 255, appearing ? 255 : 0);
110+
bgAnim.setDuration(appearing ? SCRIM_DURATION : CLOSE_DURATION);
111+
builder.with(bgAnim);
112+
}
111113
}
112114
mContentAnim.addListener(this);
113115
if (mListener != null) {

packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ protected void onFinishInflate() {
469469
Display d = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))
470470
.getDefaultDisplay();
471471
if (!ActivityManager.isHighEndGfx(d)) {
472-
mRecentsScrim.setBackgroundDrawable(null);
472+
mRecentsScrim.setBackground(null);
473473
} else if (mRecentsScrim.getBackground() instanceof BitmapDrawable) {
474474
// In order to save space, we make the background texture repeat in the Y direction
475475
((BitmapDrawable) mRecentsScrim.getBackground()).setTileModeY(TileMode.REPEAT);

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3222,28 +3222,23 @@ private Animation createThumbnailAnimationLocked(int transit,
32223222
// Entering app zooms out from the center of the thumbnail.
32233223
float scaleW = thumbWidth / mAppDisplayWidth;
32243224
float scaleH = thumbHeight / mAppDisplayHeight;
3225-
AnimationSet set = new AnimationSet(true);
32263225
Animation scale = new ScaleAnimation(scaleW, 1, scaleH, 1,
32273226
computePivot(mNextAppTransitionStartX, scaleW),
32283227
computePivot(mNextAppTransitionStartY, scaleH));
32293228
scale.setDuration(duration);
32303229
scale.setFillBefore(true);
3231-
set.addAnimation(scale);
3232-
// Need to set an alpha animation on the entering app window
3233-
// in case it appears one frame before the thumbnail window
3234-
// (this solves flicker)
3235-
Animation alpha = new AlphaAnimation(0, 1);
3236-
alpha.setDuration(1);
3237-
alpha.setFillAfter(true);
3238-
set.addAnimation(alpha);
3239-
a = set;
32403230
if (delayDuration > 0) {
3241-
a.setStartOffset(delayDuration);
3231+
scale.setStartOffset(delayDuration);
32423232
}
3233+
a = scale;
32433234
} else {
3244-
a = createExitAnimationLocked(transit, duration);
3245-
if (delayDuration > 0) {
3246-
a.setStartOffset(delayDuration);
3235+
if (delayed) {
3236+
a = new AlphaAnimation(1, 0);
3237+
a.setStartOffset(0);
3238+
a.setDuration(delayDuration - 50);
3239+
a.setBackgroundColor(0xFF000000);
3240+
} else {
3241+
a = createExitAnimationLocked(transit, duration);
32473242
}
32483243
}
32493244
a.setFillAfter(true);

0 commit comments

Comments
 (0)