Skip to content

Commit 21b274e

Browse files
committed
Large-screen notification panel size + positioning.
On sw600 devices we show the notification panel in a smaller rectangle, centered in portrait and left-aligned in landscape. Also remove a bunch of -large resources that shouldn't be used anymore. Bug: 6297838 Change-Id: I8ed3445ccb7df16e30870a4322d89786467c54df
1 parent 22930da commit 21b274e

File tree

13 files changed

+248
-376
lines changed

13 files changed

+248
-376
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
<!-- This is the combined status bar / notification panel window. -->
21+
<FrameLayout
22+
xmlns:android="http://schemas.android.com/apk/res/android"
23+
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
24+
android:fitsSystemWindows="true"
25+
>
26+
27+
<include layout="@layout/status_bar_expanded"
28+
android:layout_width="@dimen/notification_panel_width"
29+
android:layout_height="match_parent"
30+
android:layout_gravity="center_horizontal|top"
31+
/>
32+
33+
<include layout="@layout/status_bar"
34+
android:layout_width="match_parent"
35+
android:layout_height="@*android:dimen/status_bar_height"
36+
/>
37+
38+
</FrameLayout>

packages/SystemUI/res/layout/status_bar_expanded.xml

Lines changed: 99 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -21,120 +21,114 @@
2121
<FrameLayout
2222
xmlns:android="http://schemas.android.com/apk/res/android"
2323
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
24-
android:focusable="true"
25-
android:descendantFocusability="afterDescendants"
24+
android:id="@+id/notification_panel"
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:orientation="vertical"
28+
android:background="@drawable/notification_tracking_bg"
29+
android:paddingTop="@*android:dimen/status_bar_height"
30+
android:layout_marginLeft="@dimen/notification_panel_margin_left"
2631
>
2732

28-
<FrameLayout
33+
<RelativeLayout
2934
android:layout_width="match_parent"
30-
android:layout_height="wrap_content"
31-
android:orientation="vertical"
32-
android:id="@+id/notification_panel"
33-
android:background="@drawable/notification_tracking_bg"
34-
android:paddingTop="@*android:dimen/status_bar_height"
35+
android:layout_height="52dp"
36+
android:paddingTop="3dp"
37+
android:paddingBottom="5dp"
38+
android:paddingRight="3dp"
39+
android:background="@drawable/notification_header_bg"
3540
>
41+
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
42+
android:textAppearance="@style/TextAppearance.StatusBar.Date"
43+
android:layout_width="wrap_content"
44+
android:layout_height="match_parent"
45+
android:layout_alignParentLeft="true"
46+
android:singleLine="true"
47+
android:gravity="center_vertical|left"
48+
android:paddingLeft="16dp"
49+
/>
50+
<!--
51+
<com.android.systemui.statusbar.phone.CarrierLabel
52+
android:layout_width="0dp"
53+
android:layout_height="wrap_content"
54+
android:layout_weight="1"
55+
android:layout_marginTop="1dp"
56+
android:layout_marginLeft="5dp"
57+
android:layout_gravity="center_vertical"
58+
android:paddingBottom="1dp"
59+
android:paddingLeft="4dp"
60+
android:textAppearance="?android:attr/textAppearanceLarge"
61+
android:textColor="?android:attr/textColorSecondary"
62+
/>
63+
-->
3664

37-
<RelativeLayout
38-
android:layout_width="match_parent"
39-
android:layout_height="52dp"
40-
android:paddingTop="3dp"
41-
android:paddingBottom="5dp"
42-
android:paddingRight="3dp"
43-
android:background="@drawable/notification_header_bg"
44-
>
45-
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
46-
android:textAppearance="@style/TextAppearance.StatusBar.Date"
47-
android:layout_width="wrap_content"
48-
android:layout_height="match_parent"
49-
android:layout_alignParentLeft="true"
50-
android:singleLine="true"
51-
android:gravity="center_vertical|left"
52-
android:paddingLeft="16dp"
53-
/>
54-
<!--
55-
<com.android.systemui.statusbar.phone.CarrierLabel
56-
android:layout_width="0dp"
57-
android:layout_height="wrap_content"
58-
android:layout_weight="1"
59-
android:layout_marginTop="1dp"
60-
android:layout_marginLeft="5dp"
61-
android:layout_gravity="center_vertical"
62-
android:paddingBottom="1dp"
63-
android:paddingLeft="4dp"
64-
android:textAppearance="?android:attr/textAppearanceLarge"
65-
android:textColor="?android:attr/textColorSecondary"
66-
/>
67-
-->
68-
69-
<ImageView android:id="@+id/settings_button"
70-
android:layout_width="wrap_content"
71-
android:layout_height="match_parent"
72-
android:layout_toRightOf="@id/date"
73-
android:paddingLeft="8dp"
74-
android:paddingRight="8dp"
75-
android:src="@drawable/ic_notify_quicksettings"
76-
android:contentDescription="@string/accessibility_settings_button"
77-
/>
78-
79-
<ImageView android:id="@+id/clear_all_button"
80-
android:layout_width="wrap_content"
81-
android:layout_height="match_parent"
82-
android:layout_alignParentRight="true"
83-
android:paddingLeft="8dp"
84-
android:paddingRight="8dp"
85-
android:src="@drawable/ic_notify_clear"
86-
android:contentDescription="@string/accessibility_clear_all"
87-
/>
88-
</RelativeLayout>
89-
90-
<View
91-
android:layout_width="match_parent"
92-
android:layout_height="2dp"
93-
android:layout_marginTop="52dp"
94-
android:background="@drawable/status_bar_hr"
65+
<ImageView android:id="@+id/settings_button"
66+
android:layout_width="wrap_content"
67+
android:layout_height="match_parent"
68+
android:layout_toRightOf="@id/date"
69+
android:paddingLeft="8dp"
70+
android:paddingRight="8dp"
71+
android:src="@drawable/ic_notify_quicksettings"
72+
android:contentDescription="@string/accessibility_settings_button"
9573
/>
96-
97-
<ScrollView
98-
android:id="@+id/scroll"
99-
android:layout_width="match_parent"
74+
75+
<ImageView android:id="@+id/clear_all_button"
76+
android:layout_width="wrap_content"
10077
android:layout_height="match_parent"
101-
android:fadingEdge="none"
102-
android:overScrollMode="ifContentScrolls"
103-
android:layout_marginTop="54dp"
104-
android:layout_marginBottom="34dp"
105-
>
106-
<com.android.systemui.statusbar.policy.NotificationRowLayout
107-
android:id="@+id/latestItems"
108-
android:layout_width="match_parent"
109-
android:layout_height="wrap_content"
110-
systemui:rowHeight="@dimen/notification_height"
111-
/>
112-
</ScrollView>
113-
114-
<ImageView
78+
android:layout_alignParentRight="true"
79+
android:paddingLeft="8dp"
80+
android:paddingRight="8dp"
81+
android:src="@drawable/ic_notify_clear"
82+
android:contentDescription="@string/accessibility_clear_all"
83+
/>
84+
</RelativeLayout>
85+
86+
<View
87+
android:layout_width="match_parent"
88+
android:layout_height="2dp"
89+
android:layout_marginTop="52dp"
90+
android:background="@drawable/status_bar_hr"
91+
/>
92+
93+
<ScrollView
94+
android:id="@+id/scroll"
95+
android:layout_width="match_parent"
96+
android:layout_height="match_parent"
97+
android:fadingEdge="none"
98+
android:overScrollMode="ifContentScrolls"
99+
android:layout_marginTop="54dp"
100+
android:layout_marginBottom="34dp"
101+
>
102+
<com.android.systemui.statusbar.policy.NotificationRowLayout
103+
android:id="@+id/latestItems"
115104
android:layout_width="match_parent"
116105
android:layout_height="wrap_content"
117-
android:src="@drawable/title_bar_shadow"
118-
android:layout_marginTop="54dp"
119-
android:scaleType="fitXY"
120-
/>
121-
122-
<com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close"
106+
systemui:rowHeight="@dimen/notification_height"
107+
/>
108+
</ScrollView>
109+
110+
<ImageView
111+
android:layout_width="match_parent"
112+
android:layout_height="wrap_content"
113+
android:src="@drawable/title_bar_shadow"
114+
android:layout_marginTop="54dp"
115+
android:scaleType="fitXY"
116+
/>
117+
118+
<com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close"
119+
android:layout_width="match_parent"
120+
android:layout_height="@dimen/close_handle_height"
121+
android:layout_gravity="bottom"
122+
android:orientation="vertical"
123+
>
124+
<ImageView
123125
android:layout_width="match_parent"
124-
android:layout_height="@dimen/close_handle_height"
126+
android:layout_height="34dp"
125127
android:layout_gravity="bottom"
126-
android:orientation="vertical"
127-
>
128-
<ImageView
129-
android:layout_width="match_parent"
130-
android:layout_height="34dp"
131-
android:layout_gravity="bottom"
132-
android:scaleType="fitXY"
133-
android:src="@drawable/status_bar_close_on"
134-
/>
135-
136-
</com.android.systemui.statusbar.phone.CloseDragHandle>
137-
138-
</FrameLayout><!-- end of sliding panel -->
128+
android:scaleType="fitXY"
129+
android:src="@drawable/status_bar_close_on"
130+
/>
131+
132+
</com.android.systemui.statusbar.phone.CloseDragHandle>
139133

140-
</FrameLayout><!-- end of window -->
134+
</FrameLayout><!-- end of sliding panel -->

packages/SystemUI/res/values-large-port/dimens.xml

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

packages/SystemUI/res/values-large/colors.xml

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

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

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

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

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

packages/SystemUI/res/values-large/strings.xml

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

0 commit comments

Comments
 (0)