Skip to content

Commit 8b2e37e

Browse files
committed
Improve recents on sw600dp devices
Bug: 6405276 - Make thumbnails bigger - Make thumbnails higher-res - In landscape, start the thumbnails on the right - Fix issue where you'd sometimes see "No recent apps" flash before the thumbnails appeared - Fix issue where the first time recents was run you'd see double the amount of thumbnails Change-Id: I878caf57a955cb6a0c1b4f0a72b5b993609047f2
1 parent 6367b16 commit 8b2e37e

File tree

8 files changed

+74
-20
lines changed

8 files changed

+74
-20
lines changed

core/res/res/values-sw600dp/dimens.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
*/
1919
-->
2020
<resources>
21+
<!-- The width that is used when creating thumbnails of applications. -->
22+
<dimen name="thumbnail_width">200dp</dimen>
23+
<!-- The height that is used when creating thumbnails of applications. -->
24+
<dimen name="thumbnail_height">177dp</dimen>
2125
<!-- The maximum number of action buttons that should be permitted within
2226
an action bar/action mode. This will be used to determine how many
2327
showAsAction="ifRoom" items can fit. "always" items can override this. -->

core/res/res/values/dimens.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
-->
2020
<resources>
2121
<!-- The width that is used when creating thumbnails of applications. -->
22-
<dimen name="thumbnail_width">120dp</dimen>
22+
<dimen name="thumbnail_width">164dp</dimen>
2323
<!-- The height that is used when creating thumbnails of applications. -->
24-
<dimen name="thumbnail_height">120dp</dimen>
24+
<dimen name="thumbnail_height">145dp</dimen>
2525
<!-- The standard size (both width and height) of an application icon that
2626
will be displayed in the app launcher and elsewhere. -->
2727
<dimen name="app_icon_size">48dip</dimen>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
android:fadingEdge="horizontal"
4646
android:scrollbars="none"
4747
android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length"
48-
android:layout_gravity="bottom|left"
48+
android:layout_gravity="bottom|right"
4949
android:orientation="horizontal"
5050
android:clipToPadding="false"
5151
android:clipChildren="false">
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
* Copyright (c) 2012, The Android Open Source Project
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
-->
18+
<resources>
19+
<!-- Recent Applications parameters -->
20+
<dimen name="status_bar_recents_app_label_width">190dip</dimen>
21+
</resources>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
* Copyright (c) 2012, The Android Open Source Project
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
-->
18+
<resources>
19+
<!-- Recent Applications parameters -->
20+
<dimen name="status_bar_recents_app_label_width">140dip</dimen>
21+
</resources>

packages/SystemUI/res/values-sw600dp/dimens.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@
3939
<!-- Extra space above the clock in the panel; on this device, zero -->
4040
<dimen name="notification_panel_header_padding_top">0dp</dimen>
4141

42+
<!-- Size of application thumbnail -->
43+
<dimen name="status_bar_recents_thumbnail_width">200dp</dimen>
44+
<dimen name="status_bar_recents_thumbnail_height">177dp</dimen>
4245
</resources>

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
9191
private int mThumbnailWidth;
9292
private boolean mFitThumbnailToXY;
9393
private int mRecentItemLayoutId;
94+
private boolean mFirstScreenful = true;
9495

9596
public static interface OnRecentsPanelVisibilityChangedListener {
9697
public void onRecentsPanelVisibilityChanged(boolean visible);
@@ -206,6 +207,22 @@ public void recycleView(View v) {
206207
}
207208
}
208209

210+
public RecentsPanelView(Context context, AttributeSet attrs) {
211+
this(context, attrs, 0);
212+
}
213+
214+
public RecentsPanelView(Context context, AttributeSet attrs, int defStyle) {
215+
super(context, attrs, defStyle);
216+
mContext = context;
217+
updateValuesFromResources();
218+
219+
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RecentsPanelView,
220+
defStyle, 0);
221+
222+
mRecentItemLayoutId = a.getResourceId(R.styleable.RecentsPanelView_recentItemLayout, 0);
223+
a.recycle();
224+
}
225+
209226
public int numItemsInOneScreenful() {
210227
if (mRecentsContainer instanceof RecentsScrollView){
211228
RecentsScrollView scrollView
@@ -297,6 +314,7 @@ public void show(boolean show, boolean animate,
297314
mRecentTasksDirty = true;
298315
mWaitingToShow = false;
299316
mReadyToShow = false;
317+
mRecentsNoApps.setVisibility(View.INVISIBLE);
300318
}
301319
if (animate) {
302320
if (mShowing != show) {
@@ -415,21 +433,6 @@ public void setVisibility(int visibility) {
415433
super.setVisibility(visibility);
416434
}
417435

418-
public RecentsPanelView(Context context, AttributeSet attrs) {
419-
this(context, attrs, 0);
420-
}
421-
422-
public RecentsPanelView(Context context, AttributeSet attrs, int defStyle) {
423-
super(context, attrs, defStyle);
424-
mContext = context;
425-
updateValuesFromResources();
426-
427-
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RecentsPanelView,
428-
defStyle, 0);
429-
430-
mRecentItemLayoutId = a.getResourceId(R.styleable.RecentsPanelView_recentItemLayout, 0);
431-
}
432-
433436
public void updateValuesFromResources() {
434437
final Resources res = mContext.getResources();
435438
mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width));
@@ -572,7 +575,7 @@ void onTaskThumbnailLoaded(TaskDescription td) {
572575
showIfReady();
573576
}
574577

575-
// additional optimization when we have sofware system buttons - start loading the recent
578+
// additional optimization when we have software system buttons - start loading the recent
576579
// tasks on touch down
577580
@Override
578581
public boolean onTouch(View v, MotionEvent ev) {
@@ -631,7 +634,6 @@ private void refreshRecentTasksList(
631634
}
632635
}
633636

634-
boolean mFirstScreenful;
635637
public void onTasksLoaded(ArrayList<TaskDescription> tasks) {
636638
if (!mFirstScreenful && tasks.size() == 0) {
637639
return;

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ protected void updateRecentsPanel() {
467467
// .03, the item disappears entirely (as if alpha = 0) and that discontinuity looks
468468
// a bit jarring
469469
mRecentsPanel.setMinSwipeAlpha(0.03f);
470+
if (mNavigationBarView != null) {
471+
mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
472+
}
470473
}
471474

472475
@Override

0 commit comments

Comments
 (0)