Skip to content

Commit a17a795

Browse files
mikejurkaAndroid (Google) Code Review
authored andcommitted
Merge "Making recents faster"
2 parents 0599d6e + 99a9655 commit a17a795

File tree

15 files changed

+571
-222
lines changed

15 files changed

+571
-222
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* //device/apps/common/res/anim/recents_fade_in.xml
4+
**
5+
** Copyright 2012, The Android Open Source Project
6+
**
7+
** Licensed under the Apache License, Version 2.0 (the "License");
8+
** you may not use this file except in compliance with the License.
9+
** You may obtain a copy of the License at
10+
**
11+
** http://www.apache.org/licenses/LICENSE-2.0
12+
**
13+
** Unless required by applicable law or agreed to in writing, software
14+
** distributed under the License is distributed on an "AS IS" BASIS,
15+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
** See the License for the specific language governing permissions and
17+
** limitations under the License.
18+
*/
19+
-->
20+
21+
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
22+
android:interpolator="@interpolator/decelerate_quad"
23+
android:fromAlpha="0.0" android:toAlpha="1.0"
24+
android:duration="150" />
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* //device/apps/common/res/anim/recents_fade_out.xml
4+
**
5+
** Copyright 2012, The Android Open Source Project
6+
**
7+
** Licensed under the Apache License, Version 2.0 (the "License");
8+
** you may not use this file except in compliance with the License.
9+
** You may obtain a copy of the License at
10+
**
11+
** http://www.apache.org/licenses/LICENSE-2.0
12+
**
13+
** Unless required by applicable law or agreed to in writing, software
14+
** distributed under the License is distributed on an "AS IS" BASIS,
15+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
** See the License for the specific language governing permissions and
17+
** limitations under the License.
18+
*/
19+
-->
20+
21+
<alpha xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@interpolator/accelerate_quad"
22+
android:fromAlpha="1.0"
23+
android:toAlpha="0.0"
24+
android:duration="150" />

core/res/res/values/public.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@
10831083
<java-symbol type="style" name="ActiveWallpaperSettings" />
10841084
<java-symbol type="style" name="Animation.InputMethodFancy" />
10851085
<java-symbol type="style" name="Animation.Wallpaper" />
1086+
<java-symbol type="style" name="Animation.RecentApplications" />
10861087
<java-symbol type="style" name="Animation.ZoomButtons" />
10871088
<java-symbol type="style" name="PreviewWallpaperSettings" />
10881089
<java-symbol type="style" name="TextAppearance.SlidingTabActive" />

core/res/res/values/styles.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ please see styles_device_defaults.xml.
198198
<!-- A special animation we can use for recent applications,
199199
for devices that can support it (do alpha transformations). -->
200200
<style name="Animation.RecentApplications">
201-
<item name="windowEnterAnimation">@anim/fade_in</item>
202-
<item name="windowExitAnimation">@anim/fade_out</item>
201+
<item name="windowEnterAnimation">@anim/recents_fade_in</item>
202+
<item name="windowShowAnimation">@anim/recents_fade_in</item>
203+
<item name="windowExitAnimation">@anim/recents_fade_out</item>
204+
<item name="windowHideAnimation">@anim/recents_fade_out</item>
203205
</style>
204206

205207
<!-- A special animation value used internally for popup windows. -->

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
5959
android:scaleType="centerInside"
6060
android:adjustViewBounds="true"
61+
android:visibility="invisible"
6162
/>
6263

6364
<TextView android:id="@+id/app_label"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
8282
android:scaleType="centerInside"
8383
android:adjustViewBounds="true"
84+
android:visibility="invisible"
8485
/>
8586

8687
<TextView android:id="@+id/app_description"

packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
6666
android:scaleType="centerInside"
6767
android:adjustViewBounds="true"
68+
android:visibility="invisible"
6869
/>
6970

7071

packages/SystemUI/src/com/android/systemui/SwipeHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ public void dismissChild(final View view, float velocity) {
236236
public void onAnimationEnd(Animator animation) {
237237
mCallback.onChildDismissed(view);
238238
animView.setLayerType(View.LAYER_TYPE_NONE, null);
239+
// Restore the alpha/translation parameters to what they were before swiping
240+
// (for when these items are recycled)
241+
animView.setAlpha(1f);
242+
setTranslation(animView, 0f);
239243
}
240244
});
241245
anim.addUpdateListener(new AnimatorUpdateListener() {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ void startAnimation(boolean appearing) {
134134

135135
void jumpTo(boolean appearing) {
136136
mContentView.setTranslationY(appearing ? 0 : mPanelHeight);
137+
mScrimView.getBackground().setAlpha(appearing ? 255 : 0);
137138
}
138139

139140
public void setPanelHeight(int h) {

0 commit comments

Comments
 (0)