Skip to content

Commit faed160

Browse files
author
Jim Miller
committed
Fix 5579440: Add transport control view to tablet unlock screens
This updated tablet layouts to support showing album art and transport control views in PIN, pattern and password screens of lock screen. It also allows the addition of a background protect asset and the ability to show the system wallpaper on layouts that define a transport_bg_protect view. Also updated layout to use new ICS-style buttons on lock screen and fixed bug with "forgot pattern" button where we were showing the emergency call icon. To avoid problems with leading ones in the mono-space clock font, we now right-justify status text on tablet and remove the AM/PM indicator. Status font size adjusted by UX. Added background protection drop shadow to transport control. Fixed portrait mode to be right-justified when transport is showing. Change-Id: I790292fc39f4588f87adc9d9241706817ae6baab
1 parent 258576a commit faed160

15 files changed

+392
-159
lines changed

core/java/com/android/internal/widget/DigitalClock.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ static class AmPm {
106106
private String mAmString, mPmString;
107107

108108
AmPm(View parent, Typeface tf) {
109-
mAmPmTextView = (TextView) parent.findViewById(R.id.am_pm);
109+
// No longer used, uncomment if we decide to use AM/PM indicator again
110+
// mAmPmTextView = (TextView) parent.findViewById(R.id.am_pm);
110111
if (mAmPmTextView != null && tf != null) {
111112
mAmPmTextView.setTypeface(tf);
112113
}
4.11 KB
Loading
2.4 KB
Loading
6.5 KB
Loading

core/res/res/layout-sw600dp/keyguard_screen_password_landscape.xml

Lines changed: 67 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,69 @@
1717
*/
1818
-->
1919

20-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
20+
<LinearLayout
21+
xmlns:android="http://schemas.android.com/apk/res/android"
22+
android:orientation="horizontal"
2123
android:layout_width="match_parent"
22-
android:layout_height="match_parent"
23-
android:orientation="vertical">
24-
25-
<View
26-
android:layout_width="match_parent"
27-
android:layout_height="0dip"
28-
android:layout_weight="1"
29-
/>
24+
android:layout_height="match_parent">
3025

26+
<!-- left side: status and music -->
3127
<RelativeLayout
32-
android:layout_width="match_parent"
33-
android:layout_height="wrap_content">
28+
android:layout_height="match_parent"
29+
android:layout_weight="1"
30+
android:layout_width="0dip"
31+
android:gravity="center">
3432

35-
<!-- left side: status -->
36-
<include layout="@layout/keyguard_screen_status_land"
37-
android:layout_width="wrap_content"
33+
<RelativeLayout android:id="@+id/transport_bg_protect"
34+
android:layout_width="512dip"
3835
android:layout_height="wrap_content"
39-
android:layout_marginLeft="102dip"
40-
android:paddingTop="50dip"
41-
android:layout_centerVertical="true"
42-
android:layout_alignParentLeft="true"/>
36+
android:layout_marginBottom="24dip">
37+
38+
<!-- Music transport control underneath -->
39+
<include android:id="@+id/transport"
40+
layout="@layout/keyguard_transport_control"
41+
android:layout_row="0"
42+
android:layout_column="0"
43+
android:layout_rowSpan="3"
44+
android:layout_columnSpan="1"
45+
android:layout_gravity="fill"
46+
android:layout_width="match_parent"
47+
android:layout_height="512dip"
48+
/>
49+
50+
<!-- Status -->
51+
<include layout="@layout/keyguard_screen_status_land"
52+
android:layout_width="match_parent"
53+
android:layout_height="wrap_content"
54+
android:layout_marginLeft="50dip"
55+
android:layout_marginTop="50dip"
56+
android:layout_marginBottom="50dip"
57+
android:layout_marginRight="64dip"
58+
android:layout_alignParentTop="true"
59+
android:layout_alignParentLeft="true"/>
60+
61+
</RelativeLayout>
62+
63+
</RelativeLayout>
64+
65+
<!-- right side: password -->
66+
<LinearLayout
67+
android:layout_width="0dip"
68+
android:layout_weight="1"
69+
android:layout_height="match_parent"
70+
android:orientation="vertical"
71+
android:gravity="center">
4372

44-
<!-- right side: password -->
4573
<LinearLayout
46-
android:layout_width="330dip"
47-
android:layout_height="wrap_content"
4874
android:orientation="vertical"
49-
android:layout_alignParentRight="true"
50-
android:layout_centerVertical="true"
51-
android:layout_marginRight="155dip">
52-
75+
android:layout_width="330dip"
76+
android:layout_height="wrap_content">
5377

5478
<LinearLayout
5579
android:orientation="horizontal"
5680
android:layout_width="match_parent"
5781
android:layout_height="wrap_content"
58-
android:layout_gravity="center_vertical"
82+
android:layout_gravity="center"
5983
android:background="@drawable/lockscreen_password_field_dark">
6084

6185
<EditText android:id="@+id/passwordEntry"
@@ -88,6 +112,7 @@
88112
android:visibility="gone"
89113
/>
90114

115+
<!-- The IME switcher button is only shown in ASCII password mode (not PIN) -->
91116
<ImageView android:id="@+id/switch_ime_button"
92117
android:layout_width="wrap_content"
93118
android:layout_height="wrap_content"
@@ -103,33 +128,29 @@
103128

104129
<!-- Numeric keyboard -->
105130
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
106-
android:layout_width="330dip"
131+
android:layout_width="match_parent"
107132
android:layout_height="330dip"
108133
android:background="#40000000"
109134
android:layout_marginTop="5dip"
110135
android:keyBackground="@drawable/btn_keyboard_key_ics"
111136
android:visibility="gone"
112137
/>
113-
</LinearLayout>
114138

115-
</RelativeLayout>
139+
<!-- Emergency call button. Generally not used on tablet devices. -->
140+
<Button
141+
android:id="@+id/emergencyCallButton"
142+
android:layout_width="wrap_content"
143+
android:layout_height="wrap_content"
144+
android:layout_gravity="center_horizontal"
145+
android:drawableLeft="@drawable/ic_emergency"
146+
android:drawablePadding="8dip"
147+
android:text="@string/lockscreen_emergency_call"
148+
android:visibility="gone"
149+
style="@style/Widget.Button.Transparent"
150+
/>
116151

117-
<View
118-
android:layout_width="match_parent"
119-
android:layout_height="0dip"
120-
android:layout_weight="1"
121-
/>
122-
123-
<!-- emergency call button NOT CURRENTLY USED -->
124-
<Button
125-
android:id="@+id/emergencyCallButton"
126-
android:layout_width="wrap_content"
127-
android:layout_height="wrap_content"
128-
android:drawableLeft="@drawable/ic_emergency"
129-
android:drawablePadding="8dip"
130-
android:text="@string/lockscreen_emergency_call"
131-
android:visibility="gone"
132-
style="@style/Widget.Button.Transparent"
133-
/>
152+
</LinearLayout>
153+
154+
</LinearLayout>
134155

135156
</LinearLayout>

core/res/res/layout-sw600dp/keyguard_screen_password_portrait.xml

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,48 @@
1616
** limitations under the License.
1717
*/
1818
-->
19-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
19+
<LinearLayout
20+
xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:orientation="vertical"
2022
android:layout_width="match_parent"
21-
android:layout_height="match_parent"
22-
android:orientation="vertical">
23+
android:layout_height="match_parent">
2324

24-
<!-- top: status -->
25+
<!-- top: status and emergency/forgot pattern buttons -->
2526
<RelativeLayout
26-
android:layout_width="match_parent"
27-
android:layout_height="0dip"
28-
android:layout_weight="1">
29-
<include layout="@layout/keyguard_screen_status_port"
30-
android:layout_width="wrap_content"
27+
android:layout_height="0dip"
28+
android:layout_weight="1"
29+
android:layout_width="match_parent"
30+
android:gravity="center">
31+
32+
<RelativeLayout android:id="@+id/transport_bg_protect"
33+
android:layout_width="512dip"
3134
android:layout_height="wrap_content"
32-
android:layout_marginTop="134dip"
33-
android:layout_marginLeft="266dip"
34-
android:layout_alignParentTop="true"
35-
android:layout_alignParentLeft="true"/>
35+
android:gravity="center">
36+
37+
<!-- Music transport control -->
38+
<include android:id="@+id/transport"
39+
layout="@layout/keyguard_transport_control"
40+
android:layout_row="0"
41+
android:layout_column="0"
42+
android:layout_rowSpan="3"
43+
android:layout_columnSpan="1"
44+
android:layout_gravity="fill"
45+
android:layout_width="match_parent"
46+
android:layout_height="512dip"
47+
/>
48+
49+
<include layout="@layout/keyguard_screen_status_port"
50+
android:layout_width="match_parent"
51+
android:layout_height="wrap_content"
52+
android:layout_marginLeft="50dip"
53+
android:layout_marginTop="50dip"
54+
android:layout_marginBottom="100dip"
55+
android:layout_marginRight="64dip"
56+
android:layout_alignParentTop="true"
57+
android:layout_alignParentLeft="true"/>
58+
59+
</RelativeLayout>
60+
3661
</RelativeLayout>
3762

3863
<!-- bottom: password -->

core/res/res/layout-sw600dp/keyguard_screen_status_land.xml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@
2323
android:orientation="vertical"
2424
android:layout_width="wrap_content"
2525
android:layout_height="wrap_content"
26-
android:gravity="left"
27-
>
26+
android:gravity="right">
2827

2928
<TextView
3029
android:id="@+id/carrier"
3130
android:layout_width="wrap_content"
3231
android:layout_height="wrap_content"
3332
android:textAppearance="?android:attr/textAppearanceMedium"
34-
android:textSize="17sp"
33+
android:textSize="16sp"
3534
android:drawablePadding="4dip"
3635
android:layout_marginTop="32dip"
3736
android:singleLine="true"
@@ -72,19 +71,6 @@
7271
android:layout_marginBottom="6dip"
7372
/>
7473

75-
<TextView android:id="@+id/am_pm"
76-
android:layout_width="wrap_content"
77-
android:layout_height="wrap_content"
78-
android:layout_toRightOf="@id/timeDisplayBackground"
79-
android:layout_alignBaseline="@id/timeDisplayBackground"
80-
android:singleLine="true"
81-
android:ellipsize="none"
82-
android:textSize="30sp"
83-
android:layout_marginLeft="8dip"
84-
android:textAppearance="?android:attr/textAppearanceMedium"
85-
android:textColor="@color/lockscreen_clock_am_pm"
86-
/>
87-
8874
</com.android.internal.widget.DigitalClock>
8975

9076
<LinearLayout
@@ -99,15 +85,16 @@
9985
android:layout_width="wrap_content"
10086
android:layout_height="wrap_content"
10187
android:textAppearance="?android:attr/textAppearanceMedium"
102-
android:textSize="17sp"/>
88+
android:textSize="16sp"/>
10389

10490
<TextView
10591
android:id="@+id/alarm_status"
10692
android:layout_width="wrap_content"
10793
android:layout_height="wrap_content"
108-
android:layout_marginLeft="30dip"
94+
android:layout_marginLeft="16dip"
10995
android:textAppearance="?android:attr/textAppearanceMedium"
110-
android:textSize="17sp"/>
96+
android:drawablePadding="4dip"
97+
android:textSize="16sp"/>
11198

11299
</LinearLayout>
113100

@@ -117,7 +104,7 @@
117104
android:layout_width="wrap_content"
118105
android:layout_height="wrap_content"
119106
android:layout_marginTop="10dip"
120-
android:textSize="17sp"
107+
android:textSize="16sp"
121108
android:textAppearance="?android:attr/textAppearanceMedium"
122109
/>
123110

@@ -127,7 +114,7 @@
127114
android:layout_width="wrap_content"
128115
android:layout_height="wrap_content"
129116
android:textAppearance="?android:attr/textAppearanceMedium"
130-
android:textSize="17sp"
117+
android:textSize="16sp"
131118
android:layout_marginTop="20dip"
132119
android:singleLine="false"
133120
android:textColor="@color/lockscreen_owner_info"

core/res/res/layout-sw600dp/keyguard_screen_status_port.xml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@
2323
android:orientation="vertical"
2424
android:layout_width="wrap_content"
2525
android:layout_height="wrap_content"
26-
android:layout_marginLeft="140dip"
2726
android:layout_marginTop="20dip"
28-
android:gravity="left"
27+
android:gravity="right"
2928
>
3029

3130
<TextView
3231
android:id="@+id/carrier"
3332
android:layout_width="wrap_content"
3433
android:layout_height="wrap_content"
3534
android:textAppearance="?android:attr/textAppearanceMedium"
36-
android:textSize="17sp"
35+
android:textSize="16sp"
3736
android:drawablePadding="4dip"
3837
android:layout_marginTop="32dip"
3938
android:singleLine="true"
@@ -73,19 +72,6 @@
7372
android:layout_alignTop="@id/timeDisplayBackground"
7473
/>
7574

76-
<TextView android:id="@+id/am_pm"
77-
android:layout_width="wrap_content"
78-
android:layout_height="wrap_content"
79-
android:layout_toRightOf="@id/timeDisplayBackground"
80-
android:layout_alignBaseline="@id/timeDisplayBackground"
81-
android:singleLine="true"
82-
android:ellipsize="none"
83-
android:textSize="30sp"
84-
android:layout_marginLeft="8dip"
85-
android:textAppearance="?android:attr/textAppearanceMedium"
86-
android:textColor="@color/lockscreen_clock_am_pm"
87-
/>
88-
8975
</com.android.internal.widget.DigitalClock>
9076

9177
<LinearLayout
@@ -100,15 +86,16 @@
10086
android:layout_width="wrap_content"
10187
android:layout_height="wrap_content"
10288
android:textAppearance="?android:attr/textAppearanceMedium"
103-
android:textSize="17sp"/>
89+
android:textSize="16sp"/>
10490

10591
<TextView
10692
android:id="@+id/alarm_status"
10793
android:layout_width="wrap_content"
10894
android:layout_height="wrap_content"
109-
android:layout_marginLeft="30dip"
95+
android:layout_marginLeft="16dip"
11096
android:textAppearance="?android:attr/textAppearanceMedium"
111-
android:textSize="17sp"/>
97+
android:drawablePadding="4dip"
98+
android:textSize="16sp"/>
11299

113100
</LinearLayout>
114101

@@ -117,7 +104,7 @@
117104
android:layout_width="wrap_content"
118105
android:layout_height="wrap_content"
119106
android:layout_marginTop="10dip"
120-
android:textSize="17sp"
107+
android:textSize="16sp"
121108
android:textAppearance="?android:attr/textAppearanceMedium"
122109
/>
123110

@@ -128,7 +115,7 @@
128115
android:layout_height="wrap_content"
129116
android:layout_marginTop="20dip"
130117
android:textAppearance="?android:attr/textAppearanceMedium"
131-
android:textSize="17sp"
118+
android:textSize="16sp"
132119
android:singleLine="false"
133120
android:visibility="invisible"
134121
android:textColor="@color/lockscreen_owner_info"

0 commit comments

Comments
 (0)