Skip to content

Commit 738cfc9

Browse files
committed
Fixing wallpaper flash when going in/out of Recents
Bug: 7372516 Bug: 7216872 Change-Id: I2a2308a85caf9f2ad2d382c709e5f8867bd060be
1 parent a1f739e commit 738cfc9

File tree

8 files changed

+94
-14
lines changed

8 files changed

+94
-14
lines changed

packages/SystemUI/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109

110110
<activity android:name=".recent.RecentsActivity"
111111
android:label="@string/accessibility_desc_recent_apps"
112-
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar"
112+
android:theme="@style/RecentsStyle"
113113
android:excludeFromRecents="true"
114114
android:launchMode="singleInstance"
115115
android:exported="true">

packages/SystemUI/res/anim/recents_launch_from_launcher_enter.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
-->
1919

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
21-
android:detachWallpaper="true"
2221
android:shareInterpolator="false"
2322
android:zAdjustment="normal">
2423
<!--scale android:fromXScale="2.0" android:toXScale="1.0"
@@ -28,9 +27,4 @@
2827
android:fillBefore="true" android:fillAfter="true"
2928
android:pivotX="50%p" android:pivotY="50%p"
3029
android:duration="250" /-->
31-
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
32-
android:fillEnabled="true"
33-
android:fillBefore="true" android:fillAfter="true"
34-
android:interpolator="@android:interpolator/decelerate_cubic"
35-
android:duration="250"/>
3630
</set>

packages/SystemUI/res/anim/recents_launch_from_launcher_exit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false"
22-
android:zAdjustment="normal">
22+
android:zAdjustment="top">
2323
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
2424
android:fillEnabled="true"
2525
android:fillBefore="true" android:fillAfter="true"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false"
22+
android:zAdjustment="normal">
23+
<!--scale android:fromXScale="2.0" android:toXScale="1.0"
24+
android:fromYScale="2.0" android:toYScale="1.0"
25+
android:interpolator="@android:interpolator/decelerate_cubic"
26+
android:fillEnabled="true"
27+
android:fillBefore="true" android:fillAfter="true"
28+
android:pivotX="50%p" android:pivotY="50%p"
29+
android:duration="250" /-->
30+
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
31+
android:fillEnabled="true"
32+
android:fillBefore="true" android:fillAfter="true"
33+
android:interpolator="@android:interpolator/decelerate_cubic"
34+
android:duration="250"/>
35+
</set>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false"
22+
android:zAdjustment="top">
23+
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
24+
android:fillEnabled="true"
25+
android:fillBefore="true" android:fillAfter="true"
26+
android:interpolator="@android:interpolator/decelerate_cubic"
27+
android:duration="250"/>
28+
</set>

packages/SystemUI/res/values/styles.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@
1616

1717
<resources xmlns:android="http://schemas.android.com/apk/res/android">
1818

19+
<style name="RecentsStyle" parent="@android:style/Theme.Holo.Wallpaper.NoTitleBar">
20+
<item name="android:windowAnimationStyle">@style/Animation.RecentsActivity</item>
21+
</style>
22+
23+
<!-- Animations for a non-full-screen window or activity. -->
24+
<style name="Animation.RecentsActivity" parent="@android:style/Animation.Activity">
25+
<item name="android:activityOpenEnterAnimation">@anim/recents_launch_from_launcher_enter</item>
26+
<item name="android:activityOpenExitAnimation">@anim/recents_launch_from_launcher_exit</item>
27+
<item name="android:taskOpenEnterAnimation">@anim/recents_launch_from_launcher_enter</item>
28+
<item name="android:taskOpenExitAnimation">@anim/recents_launch_from_launcher_exit</item>
29+
<item name="android:taskToFrontEnterAnimation">@anim/recents_launch_from_launcher_enter</item>
30+
<item name="android:taskToFrontExitAnimation">@anim/recents_launch_from_launcher_exit</item>
31+
<item name="android:wallpaperOpenEnterAnimation">@anim/recents_launch_from_launcher_enter</item>
32+
<item name="android:wallpaperOpenExitAnimation">@anim/recents_launch_from_launcher_exit</item>
33+
<item name="android:wallpaperIntraOpenEnterAnimation">@anim/wallpaper_recents_launch_from_launcher_enter</item>
34+
<item name="android:wallpaperIntraOpenExitAnimation">@anim/wallpaper_recents_launch_from_launcher_exit</item>
35+
</style>
36+
1937
<style name="TextAppearance.StatusBar.IntruderAlert"
2038
parent="@*android:style/TextAppearance.StatusBar">
2139
</style>

packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,8 @@ protected void toggleRecentsActivity() {
485485
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
486486

487487
if (firstTask == null) {
488-
ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext,
489-
R.anim.recents_launch_from_launcher_enter,
490-
R.anim.recents_launch_from_launcher_exit);
491-
mContext.startActivityAsUser(intent, opts.toBundle(), new UserHandle(
488+
// The correct window animation will be applied via the activity's style
489+
mContext.startActivityAsUser(intent, new UserHandle(
492490
UserHandle.USER_CURRENT));
493491
} else {
494492
Bitmap first = firstTask.getThumbnail();

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3385,8 +3385,15 @@ private Animation createThumbnailAnimationLocked(int transit,
33853385
} else {
33863386
// Exiting app
33873387
if (scaleUp) {
3388-
// noop animation
3389-
a = new AlphaAnimation(1, 0);
3388+
if (transit == WindowManagerPolicy.TRANSIT_WALLPAPER_INTRA_OPEN) {
3389+
// Fade out while bringing up selected activity. This keeps the
3390+
// current activity from showing through a launching wallpaper
3391+
// activity.
3392+
a = new AlphaAnimation(1, 0);
3393+
} else {
3394+
// noop animation
3395+
a = new AlphaAnimation(1, 1);
3396+
}
33903397
a.setDuration(duration);
33913398
} else {
33923399
float scaleW = thumbWidth / displayInfo.appWidth;

0 commit comments

Comments
 (0)