Skip to content

Commit bf6e0ba

Browse files
committed
Don't show rotation lock on phone-sized devices.
Bug: 6476409 Change-Id: Ife4476ab08a96337fe78ef2892ac5d73f90b3e8c
1 parent bec154c commit bf6e0ba

File tree

3 files changed

+145
-55
lines changed

3 files changed

+145
-55
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
** Copyright 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+
<LinearLayout
19+
xmlns:android="http://schemas.android.com/apk/res/android"
20+
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
android:paddingTop="@dimen/notification_panel_header_padding_top"
24+
android:background="@drawable/notification_header_bg"
25+
android:orientation="horizontal"
26+
android:gravity="center_vertical"
27+
android:baselineAligned="false"
28+
>
29+
<com.android.systemui.statusbar.policy.Clock
30+
android:id="@+id/clock"
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:layout_marginLeft="8dp"
34+
android:singleLine="true"
35+
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
36+
/>
37+
38+
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
39+
android:layout_width="wrap_content"
40+
android:layout_height="wrap_content"
41+
android:layout_marginLeft="8dp"
42+
android:layout_marginRight="8dp"
43+
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
44+
/>
45+
46+
<com.android.systemui.statusbar.RotationToggle android:id="@+id/rotation_lock_button"
47+
android:layout_width="32dp"
48+
android:layout_height="32dp"
49+
android:layout_margin="8dp"
50+
android:button="@drawable/ic_notify_rotation"
51+
android:contentDescription="@string/accessibility_rotation_lock_off"
52+
/>
53+
54+
<ImageView android:id="@+id/settings_button"
55+
android:layout_width="48dp"
56+
android:layout_height="48dp"
57+
android:scaleType="center"
58+
android:src="@drawable/ic_notify_quicksettings"
59+
android:contentDescription="@string/accessibility_settings_button"
60+
/>
61+
62+
<Space
63+
android:layout_width="0dp"
64+
android:layout_height="0dp"
65+
android:layout_weight="1"
66+
/>
67+
68+
<ImageView android:id="@+id/clear_all_button"
69+
android:layout_width="48dp"
70+
android:layout_height="48dp"
71+
android:scaleType="center"
72+
android:src="@drawable/ic_notify_clear"
73+
android:contentDescription="@string/accessibility_clear_all"
74+
/>
75+
</LinearLayout>

packages/SystemUI/res/layout/status_bar_expanded.xml

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -30,63 +30,11 @@
3030
android:layout_marginLeft="@dimen/notification_panel_margin_left"
3131
>
3232

33-
<LinearLayout
33+
<include layout="@layout/status_bar_expanded_header"
3434
android:layout_width="match_parent"
3535
android:layout_height="wrap_content"
36-
android:paddingTop="@dimen/notification_panel_header_padding_top"
37-
android:background="@drawable/notification_header_bg"
38-
android:orientation="horizontal"
39-
android:gravity="center_vertical"
40-
android:baselineAligned="false"
41-
>
42-
<com.android.systemui.statusbar.policy.Clock
43-
android:id="@+id/clock"
44-
android:layout_width="wrap_content"
45-
android:layout_height="wrap_content"
46-
android:layout_marginLeft="8dp"
47-
android:singleLine="true"
48-
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
49-
/>
50-
51-
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
52-
android:layout_width="wrap_content"
53-
android:layout_height="wrap_content"
54-
android:layout_marginLeft="8dp"
55-
android:layout_marginRight="8dp"
56-
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
57-
/>
58-
59-
<com.android.systemui.statusbar.RotationToggle android:id="@+id/rotation_lock_button"
60-
android:layout_width="32dp"
61-
android:layout_height="32dp"
62-
android:layout_margin="8dp"
63-
android:button="@drawable/ic_notify_rotation"
64-
android:contentDescription="@string/accessibility_rotation_lock_off"
65-
/>
66-
67-
<ImageView android:id="@+id/settings_button"
68-
android:layout_width="48dp"
69-
android:layout_height="48dp"
70-
android:scaleType="center"
71-
android:src="@drawable/ic_notify_quicksettings"
72-
android:contentDescription="@string/accessibility_settings_button"
73-
/>
74-
75-
<Space
76-
android:layout_width="0dp"
77-
android:layout_height="0dp"
78-
android:layout_weight="1"
79-
/>
80-
81-
<ImageView android:id="@+id/clear_all_button"
82-
android:layout_width="48dp"
83-
android:layout_height="48dp"
84-
android:scaleType="center"
85-
android:src="@drawable/ic_notify_clear"
86-
android:contentDescription="@string/accessibility_clear_all"
87-
/>
88-
</LinearLayout>
89-
36+
/>
37+
9038
<ScrollView
9139
android:id="@+id/scroll"
9240
android:layout_width="match_parent"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
** Copyright 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+
<LinearLayout
19+
xmlns:android="http://schemas.android.com/apk/res/android"
20+
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
android:paddingTop="@dimen/notification_panel_header_padding_top"
24+
android:background="@drawable/notification_header_bg"
25+
android:orientation="horizontal"
26+
android:gravity="center_vertical"
27+
android:baselineAligned="false"
28+
>
29+
<com.android.systemui.statusbar.policy.Clock
30+
android:id="@+id/clock"
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:layout_marginLeft="8dp"
34+
android:singleLine="true"
35+
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
36+
/>
37+
38+
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
39+
android:layout_width="wrap_content"
40+
android:layout_height="wrap_content"
41+
android:layout_marginLeft="8dp"
42+
android:layout_marginRight="8dp"
43+
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
44+
/>
45+
46+
<ImageView android:id="@+id/settings_button"
47+
android:layout_width="48dp"
48+
android:layout_height="48dp"
49+
android:scaleType="center"
50+
android:src="@drawable/ic_notify_quicksettings"
51+
android:contentDescription="@string/accessibility_settings_button"
52+
/>
53+
54+
<Space
55+
android:layout_width="0dp"
56+
android:layout_height="0dp"
57+
android:layout_weight="1"
58+
/>
59+
60+
<ImageView android:id="@+id/clear_all_button"
61+
android:layout_width="48dp"
62+
android:layout_height="48dp"
63+
android:scaleType="center"
64+
android:src="@drawable/ic_notify_clear"
65+
android:contentDescription="@string/accessibility_clear_all"
66+
/>
67+
</LinearLayout>

0 commit comments

Comments
 (0)