Skip to content

Commit 4b7494e

Browse files
mikejurkaAndroid (Google) Code Review
authored andcommitted
Merge "Updating recent apps visuals on tablet" into ics-mr1
2 parents d968670 + bfd24ac commit 4b7494e

File tree

11 files changed

+171
-127
lines changed

11 files changed

+171
-127
lines changed

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,29 @@
3333
android:clipToPadding="false"
3434
android:clipChildren="false">
3535

36-
<LinearLayout android:id="@+id/recents_glow"
36+
<com.android.systemui.recent.RecentsHorizontalScrollView android:id="@+id/recents_container"
3737
android:layout_width="wrap_content"
3838
android:layout_height="match_parent"
39-
android:layout_gravity="bottom|right"
39+
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
40+
android:divider="@null"
41+
android:stackFromBottom="true"
42+
android:fadingEdge="horizontal"
43+
android:scrollbars="none"
44+
android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
45+
android:layout_gravity="bottom|left"
4046
android:orientation="horizontal"
4147
android:clipToPadding="false"
42-
android:clipChildren="false"
43-
>
44-
<com.android.systemui.recent.RecentsHorizontalScrollView android:id="@+id/recents_container"
48+
android:clipChildren="false">
49+
50+
<LinearLayout android:id="@+id/recents_linear_layout"
4551
android:layout_width="wrap_content"
4652
android:layout_height="match_parent"
47-
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
48-
android:divider="@null"
49-
android:stackFromBottom="true"
50-
android:fadingEdge="horizontal"
51-
android:scrollbars="none"
52-
android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
53-
android:layout_gravity="bottom|left"
5453
android:orientation="horizontal"
5554
android:clipToPadding="false"
5655
android:clipChildren="false">
56+
</LinearLayout>
5757

58-
<LinearLayout android:id="@+id/recents_linear_layout"
59-
android:layout_width="wrap_content"
60-
android:layout_height="match_parent"
61-
android:orientation="horizontal"
62-
android:clipToPadding="false"
63-
android:clipChildren="false">
64-
</LinearLayout>
65-
66-
</com.android.systemui.recent.RecentsHorizontalScrollView>
67-
68-
</LinearLayout>
58+
</com.android.systemui.recent.RecentsHorizontalScrollView>
6959

7060
</FrameLayout>
7161

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

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,29 @@
3131
android:layout_height="match_parent"
3232
android:layout_alignParentBottom="true">
3333

34-
<LinearLayout android:id="@+id/recents_glow"
34+
<com.android.systemui.recent.RecentsVerticalScrollView
35+
android:id="@+id/recents_container"
3536
android:layout_width="match_parent"
3637
android:layout_height="wrap_content"
37-
android:layout_gravity="bottom"
38-
android:orientation="horizontal"
39-
android:clipChildren="false"
40-
android:layout_marginTop="@*android:dimen/status_bar_height">
38+
android:layout_marginRight="0dp"
39+
android:divider="@null"
40+
android:stackFromBottom="true"
41+
android:fadingEdge="vertical"
42+
android:scrollbars="none"
43+
android:fadingEdgeLength="@*android:dimen/status_bar_height"
44+
android:layout_gravity="bottom|left"
45+
android:clipToPadding="false"
46+
android:clipChildren="false">
4147

42-
<com.android.systemui.recent.RecentsVerticalScrollView
43-
android:id="@+id/recents_container"
48+
<LinearLayout android:id="@+id/recents_linear_layout"
4449
android:layout_width="match_parent"
4550
android:layout_height="wrap_content"
46-
android:layout_marginRight="0dp"
47-
android:divider="@null"
48-
android:stackFromBottom="true"
49-
android:fadingEdge="vertical"
50-
android:scrollbars="none"
51-
android:fadingEdgeLength="@*android:dimen/status_bar_height"
52-
android:layout_gravity="bottom|left"
51+
android:orientation="vertical"
5352
android:clipToPadding="false"
5453
android:clipChildren="false">
54+
</LinearLayout>
5555

56-
<LinearLayout android:id="@+id/recents_linear_layout"
57-
android:layout_width="match_parent"
58-
android:layout_height="wrap_content"
59-
android:orientation="vertical"
60-
android:clipToPadding="false"
61-
android:clipChildren="false">
62-
</LinearLayout>
63-
64-
</com.android.systemui.recent.RecentsVerticalScrollView>
65-
66-
</LinearLayout>
56+
</com.android.systemui.recent.RecentsVerticalScrollView>
6757

6858
</FrameLayout>
6959

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+
/* apps/common/assets/default/default/skins/StatusBar.xml
4+
**
5+
** Copyright 2011, 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+
<FrameLayout
22+
xmlns:android="http://schemas.android.com/apk/res/android"
23+
android:layout_height="match_parent"
24+
android:layout_width="match_parent"
25+
>
26+
27+
<TextView
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content"
30+
android:textSize="20dp"
31+
android:textColor="@android:color/holo_blue_light"
32+
android:text="@string/status_bar_no_recent_apps"
33+
android:gravity="left"
34+
android:layout_gravity="bottom|left"
35+
/>
36+
</FrameLayout>

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

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,26 @@
2323
android:layout_height="wrap_content"
2424
android:layout_width="wrap_content">
2525

26-
<FrameLayout android:id="@+id/app_thumbnail"
27-
android:layout_width="wrap_content"
26+
<TextView android:id="@+id/app_label"
27+
android:layout_width="@dimen/status_bar_recents_app_label_width"
2828
android:layout_height="wrap_content"
29+
android:textSize="@dimen/status_bar_recents_app_label_text_size"
30+
android:fadingEdge="horizontal"
31+
android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
32+
android:scrollHorizontally="true"
2933
android:layout_alignParentLeft="true"
3034
android:layout_alignParentTop="true"
35+
android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
36+
android:layout_marginTop="32dip"
37+
android:singleLine="true"
38+
android:ellipsize="marquee"
39+
android:textColor="@color/status_bar_recents_app_label_color"
40+
/>
41+
42+
<FrameLayout android:id="@+id/app_thumbnail"
43+
android:layout_width="wrap_content"
44+
android:layout_height="wrap_content"
45+
android:layout_toRightOf="@id/app_label"
3146
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
3247
android:scaleType="center"
3348
android:background="@drawable/recents_thumbnail_bg"
@@ -37,33 +52,22 @@
3752
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
3853
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
3954
/>
40-
<ImageView android:id="@+id/app_icon"
41-
android:layout_width="wrap_content"
42-
android:layout_height="wrap_content"
43-
android:layout_marginLeft="@dimen/status_bar_recents_app_icon_left_margin"
44-
android:layout_marginTop="@dimen/status_bar_recents_app_icon_top_margin"
45-
android:maxWidth="@dimen/status_bar_recents_app_icon_max_width"
46-
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
47-
android:adjustViewBounds="true"
48-
/>
4955
</FrameLayout>
5056

51-
<TextView android:id="@+id/app_label"
52-
android:layout_width="@dimen/status_bar_recents_app_label_width"
57+
58+
<ImageView android:id="@+id/app_icon"
59+
android:layout_width="wrap_content"
5360
android:layout_height="wrap_content"
54-
android:textSize="@dimen/status_bar_recents_app_label_text_size"
55-
android:fadingEdge="horizontal"
56-
android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
57-
android:scrollHorizontally="true"
58-
android:layout_alignParentLeft="true"
59-
android:layout_alignParentTop="true"
60-
android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
61-
android:layout_marginTop="32dip"
62-
android:singleLine="true"
63-
android:ellipsize="marquee"
64-
android:textColor="@color/status_bar_recents_app_label_color"
61+
android:layout_toRightOf="@id/app_label"
62+
android:layout_marginLeft="@dimen/status_bar_recents_app_icon_left_margin"
63+
android:layout_marginTop="@dimen/status_bar_recents_app_icon_top_margin"
64+
android:maxWidth="@dimen/status_bar_recents_app_icon_max_width"
65+
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
66+
android:scaleType="centerInside"
67+
android:adjustViewBounds="true"
6568
/>
6669

70+
6771
<View android:id="@+id/recents_callout_line"
6872
android:layout_width="@dimen/status_bar_recents_app_label_width"
6973
android:layout_height="1dip"

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

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,40 +36,36 @@
3636
android:clipToPadding="false"
3737
android:clipChildren="false">
3838

39-
<LinearLayout android:id="@+id/recents_glow"
39+
<com.android.systemui.recent.RecentsVerticalScrollView android:id="@+id/recents_container"
4040
android:layout_width="wrap_content"
4141
android:layout_height="wrap_content"
42-
android:layout_marginBottom="-49dip"
43-
android:layout_gravity="bottom"
44-
android:background="@drawable/recents_blue_glow"
45-
android:orientation="horizontal"
42+
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
43+
android:divider="@null"
44+
android:stackFromBottom="true"
45+
android:fadingEdge="vertical"
46+
android:scrollbars="none"
47+
android:fadingEdgeLength="20dip"
48+
android:layout_gravity="bottom|left"
4649
android:clipToPadding="false"
47-
android:clipChildren="false"
48-
>
49-
<com.android.systemui.recent.RecentsVerticalScrollView android:id="@+id/recents_container"
50+
android:clipChildren="false">
51+
52+
<LinearLayout android:id="@+id/recents_linear_layout"
5053
android:layout_width="wrap_content"
5154
android:layout_height="wrap_content"
52-
android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
53-
android:divider="@null"
54-
android:stackFromBottom="true"
55-
android:fadingEdge="vertical"
56-
android:scrollbars="none"
57-
android:fadingEdgeLength="20dip"
58-
android:layout_gravity="bottom|left"
55+
android:orientation="vertical"
5956
android:clipToPadding="false"
6057
android:clipChildren="false">
58+
</LinearLayout>
6159

62-
<LinearLayout android:id="@+id/recents_linear_layout"
63-
android:layout_width="wrap_content"
64-
android:layout_height="wrap_content"
65-
android:orientation="vertical"
66-
android:clipToPadding="false"
67-
android:clipChildren="false">
68-
</LinearLayout>
69-
70-
</com.android.systemui.recent.RecentsVerticalScrollView>
60+
</com.android.systemui.recent.RecentsVerticalScrollView>
7161

72-
</LinearLayout>
62+
<include layout="@layout/status_bar_no_recent_apps"
63+
android:id="@+id/recents_no_apps"
64+
android:layout_width="match_parent"
65+
android:layout_height="match_parent"
66+
android:layout_marginLeft="58dip"
67+
android:layout_marginBottom="36dip"
68+
android:visibility="invisible" />
7369

7470
</FrameLayout>
7571

@@ -82,4 +78,5 @@
8278
android:contentDescription="@string/status_bar_accessibility_dismiss_recents"
8379
/>
8480

81+
8582
</com.android.systemui.recent.RecentsPanelView>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
-->
1919

2020
<resources>
21-
2221
<!-- Whether we're using the tablet-optimized recents interface (we use this
2322
value at runtime for some things) -->
2423
<bool name="config_recents_interface_for_tablets">true</bool>
24+
25+
<!-- Whether recents thumbnails should stretch in both x and y to fill their
26+
ImageView -->
27+
<bool name="config_recents_thumbnail_image_fits_to_xy">true</bool>
2528
</resources>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131

3232
<!-- Recent Applications parameters -->
3333
<!-- How far the thumbnail for a recent app appears from left edge -->
34-
<dimen name="status_bar_recents_thumbnail_left_margin">121dp</dimen>
34+
<dimen name="status_bar_recents_thumbnail_left_margin">28dp</dimen>
3535
<!-- Upper width limit for application icon -->
3636
<dimen name="status_bar_recents_app_icon_max_width">64dp</dimen>
3737
<!-- Upper height limit for application icon -->
3838
<dimen name="status_bar_recents_app_icon_max_height">64dp</dimen>
3939

4040
<!-- Size of application icon -->
41-
<dimen name="status_bar_recents_thumbnail_width">245dp</dimen>
42-
<dimen name="status_bar_recents_thumbnail_height">144dp</dimen>
41+
<dimen name="status_bar_recents_thumbnail_width">208dp</dimen>
42+
<dimen name="status_bar_recents_thumbnail_height">130dp</dimen>
4343

4444
<!-- Width of recents panel -->
4545
<dimen name="status_bar_recents_width">600dp</dimen>
@@ -59,8 +59,8 @@
5959
<dimen name="status_bar_recents_right_glow_margin">100dip</dimen>
6060

6161
<!-- Where to place the app icon over the thumbnail -->
62-
<dimen name="status_bar_recents_app_icon_left_margin">13dp</dimen>
63-
<dimen name="status_bar_recents_app_icon_top_margin">13dp</dimen>
62+
<dimen name="status_bar_recents_app_icon_left_margin">0dp</dimen>
63+
<dimen name="status_bar_recents_app_icon_top_margin">8dp</dimen>
6464

6565
<!-- size at which Notification icons will be drawn in the status bar -->
6666
<dimen name="status_bar_icon_drawing_size">24dip</dimen>

packages/SystemUI/res/values/config.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
value at runtime for some things) -->
2626
<bool name="config_recents_interface_for_tablets">false</bool>
2727

28+
<!-- Whether recents thumbnails should stretch in both x and y to fill their
29+
ImageView -->
30+
<bool name="config_recents_thumbnail_image_fits_to_xy">false</bool>
31+
2832
<!-- Control whether status bar should distinguish HSPA data icon form UMTS
2933
data icon on devices -->
3034
<bool name="config_hspa_data_distinguishable">false</bool>

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,13 @@ void startAnimation(boolean appearing) {
120120

121121
createAnimation(appearing);
122122

123-
mContentView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
124-
mContentView.buildLayer();
123+
// isHardwareAccelerated() checks if we're attached to a window and if that
124+
// window is HW accelerated-- we were sometimes not attached to a window
125+
// and buildLayer was throwing an IllegalStateException
126+
if (mContentView.isHardwareAccelerated()) {
127+
mContentView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
128+
mContentView.buildLayer();
129+
}
125130
mContentAnim.start();
126131

127132
mVisible = appearing;

0 commit comments

Comments
 (0)