Skip to content

Commit 071316e

Browse files
committed
Use black bg in recents if using live wallpaper
Bug: 7282784 Change-Id: I686f8f0e36e3414ad30d23de80cbbfb2868069d4
1 parent 957b27f commit 071316e

File tree

10 files changed

+149
-63
lines changed

10 files changed

+149
-63
lines changed

packages/SystemUI/res/anim/recent_app_enter.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/SystemUI/res/anim/recent_app_leave.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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:detachWallpaper="true"
22+
android:shareInterpolator="false"
23+
android:zAdjustment="normal">
24+
<!--scale android:fromXScale="2.0" android:toXScale="1.0"
25+
android:fromYScale="2.0" android:toYScale="1.0"
26+
android:interpolator="@android:interpolator/decelerate_cubic"
27+
android:fillEnabled="true"
28+
android:fillBefore="true" android:fillAfter="true"
29+
android:pivotX="50%p" android:pivotY="50%p"
30+
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"/>
36+
</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="normal">
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>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
24+
android:interpolator="@android:interpolator/decelerate_cubic"
25+
android:duration="250"/>
26+
</set>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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="1.0" android:toXScale="2.0"
24+
android:fromYScale="1.0" android:toYScale="2.0"
25+
android:interpolator="@android:interpolator/decelerate_cubic"
26+
android:pivotX="50%p" android:pivotY="50%p"
27+
android:duration="250" /-->
28+
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
29+
android:interpolator="@android:interpolator/decelerate_cubic"
30+
android:duration="250"/>
31+
</set>

packages/SystemUI/res/values/dimens.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<dimen name="status_bar_recents_item_padding">0dip</dimen>
5353
<!-- When recents first appears, how far the icon and label of the primary activity
5454
travel -->
55-
<dimen name="status_bar_recents_app_icon_translate_distance">100dp</dimen>
55+
<dimen name="status_bar_recents_app_icon_translate_distance">35dip</dimen>
5656

5757
<!-- Where to place the app icon over the thumbnail -->
5858
<dimen name="status_bar_recents_app_icon_left_margin">0dp</dimen>

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

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

1919
import android.app.Activity;
2020
import android.app.ActivityManager;
21+
import android.app.WallpaperManager;
2122
import android.content.BroadcastReceiver;
2223
import android.content.Context;
2324
import android.content.Intent;
@@ -26,6 +27,7 @@
2627
import android.os.UserHandle;
2728
import android.view.MotionEvent;
2829
import android.view.View;
30+
import android.view.WindowManager;
2931

3032
import com.android.systemui.R;
3133
import com.android.systemui.SystemUIApplication;
@@ -42,6 +44,7 @@ public class RecentsActivity extends Activity {
4244
private IntentFilter mIntentFilter;
4345
private boolean mShowing;
4446
private boolean mForeground;
47+
4548
private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
4649
@Override
4750
public void onReceive(Context context, Intent intent) {
@@ -79,6 +82,9 @@ public boolean onTouch(View v, MotionEvent ev) {
7982

8083
@Override
8184
public void onPause() {
85+
overridePendingTransition(
86+
R.anim.recents_return_to_launcher_enter,
87+
R.anim.recents_return_to_launcher_exit);
8288
mForeground = false;
8389
super.onPause();
8490
}
@@ -92,8 +98,23 @@ public void onStop() {
9298
super.onStop();
9399
}
94100

101+
private void updateWallpaperVisibility(boolean visible) {
102+
int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0;
103+
int curflags = getWindow().getAttributes().flags
104+
& WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
105+
if (wpflags != curflags) {
106+
getWindow().setFlags(wpflags, WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER);
107+
}
108+
}
109+
95110
@Override
96111
public void onStart() {
112+
// Hide wallpaper if it's not a static image
113+
if (WallpaperManager.getInstance(this).getWallpaperInfo() != null) {
114+
updateWallpaperVisibility(false);
115+
} else {
116+
updateWallpaperVisibility(true);
117+
}
97118
mShowing = true;
98119
if (mRecentsPanel != null) {
99120
mRecentsPanel.refreshViews();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ void onTaskThumbnailLoaded(TaskDescription td) {
520520

521521
public void onWindowAnimationStart() {
522522
if (mItemToAnimateInWhenWindowAnimationIsFinished != null) {
523-
final int startDelay = 100;
523+
final int startDelay = 150;
524524
final int duration = 250;
525525
final ViewHolder holder = mItemToAnimateInWhenWindowAnimationIsFinished;
526526
final TimeInterpolator cubic = new DecelerateInterpolator(1.5f);

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,11 @@ protected void toggleRecentsActivity() {
485485
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
486486

487487
if (firstTask == null) {
488-
mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
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(
492+
UserHandle.USER_CURRENT));
489493
} else {
490494
Bitmap first = firstTask.getThumbnail();
491495
final Resources res = mContext.getResources();

0 commit comments

Comments
 (0)