Skip to content

Commit 70bc9f2

Browse files
committed
Fix keyguard dimensions; IME state for password view; layouts
Fix a bug where ordering during inflation caused us not to set a keyguard callback early enough to properly modify window flags. Add a gross hack to work around this for now. Fix status layouts to scale a bit more gracefully in the presence of an IME. Fix password layouts to scale more gracefully in the presence of an IME Bug 7343312 Bug 7341795 Bug 7342963 Bug 7343089 Change-Id: Ifb2c06defef11e8f7f9d0e09855632ed491bb31c
1 parent 28dc64b commit 70bc9f2

File tree

11 files changed

+54
-42
lines changed

11 files changed

+54
-42
lines changed

core/res/res/layout-port/keyguard_host_view.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@
2929

3030
<include layout="@layout/keyguard_widget_region"
3131
android:layout_width="match_parent"
32-
android:layout_height="0dip"
33-
android:layout_weight="27" />
32+
android:layout_height="153dp" />
3433

3534
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
3635
android:id="@+id/view_flipper"
3736
android:layout_height="0dp"
3837
android:clipChildren="false"
3938
android:clipToPadding="false"
40-
android:layout_weight="73"
39+
android:layout_weight="1"
4140
android:paddingLeft="@dimen/keyguard_security_view_margin"
4241
android:paddingTop="@dimen/keyguard_security_view_margin"
4342
android:paddingRight="@dimen/keyguard_security_view_margin"

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
android:layout_weight="1"
9090
android:gravity="center"
9191
android:layout_gravity="center"
92-
android:layout_marginStart="@dimen/keyguard_lockscreen_pin_margin_left"
9392
android:singleLine="true"
9493
android:textStyle="normal"
9594
android:inputType="textPassword"

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
android:inputType="textPassword"
9494
android:gravity="center"
9595
android:layout_gravity="center"
96-
android:layout_marginStart="@dimen/keyguard_lockscreen_pin_margin_left"
9796
android:textSize="24sp"
9897
android:textAppearance="?android:attr/textAppearanceMedium"
9998
android:background="@null"

core/res/res/layout/keyguard_glow_pad_container.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
android:layout_width="wrap_content"
2323
android:layout_height="wrap_content"
2424
android:layout_gravity="bottom|center_horizontal"
25-
android:layout_marginBottom="-96dp"/>
25+
android:layout_marginBottom="-80dp"/>
2626
</merge>

core/res/res/layout/keyguard_password_view.xml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626

2727
<FrameLayout
2828
android:layout_width="match_parent"
29-
android:layout_height="match_parent">
29+
android:layout_height="0dp"
30+
android:layout_weight="1">
3031

3132
<LinearLayout
3233
android:layout_height="wrap_content"
33-
android:layout_width="wrap_content"
34+
android:layout_width="match_parent"
3435
android:orientation="vertical"
3536
android:layout_gravity="center">
3637

@@ -114,14 +115,14 @@
114115
android:clickable="true"
115116
/>
116117
</LinearLayout>
117-
118-
<include layout="@layout/keyguard_emergency_carrier_area"
119-
android:id="@+id/keyguard_selector_fade_container"
120-
android:layout_width="match_parent"
121-
android:layout_height="wrap_content"
122-
android:orientation="vertical"
123-
android:layout_gravity="bottom|center_horizontal"
124-
android:gravity="center_horizontal" />
125118
</LinearLayout>
126119
</FrameLayout>
120+
<include layout="@layout/keyguard_emergency_carrier_area"
121+
android:id="@+id/keyguard_selector_fade_container"
122+
android:layout_width="match_parent"
123+
android:layout_height="wrap_content"
124+
android:orientation="vertical"
125+
android:layout_gravity="bottom|center_horizontal"
126+
android:gravity="center_horizontal" />
127+
127128
</com.android.internal.policy.impl.keyguard.KeyguardPasswordView>

core/res/res/layout/keyguard_screen_password_landscape.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@
143143
android:layout_width="0dip"
144144
android:layout_weight="1"
145145
android:gravity="center"
146-
android:layout_marginStart="@dimen/keyguard_lockscreen_pin_margin_left"
147146
android:layout_gravity="center_vertical"
148147
android:singleLine="true"
149148
android:textStyle="normal"

core/res/res/layout/keyguard_screen_password_portrait.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,10 @@
106106
android:layout_marginEnd="16dip">
107107

108108
<EditText android:id="@+id/passwordEntry"
109-
android:layout_width="0dip"
109+
android:layout_width="match_parent"
110110
android:layout_height="wrap_content"
111-
android:layout_weight="1"
112111
android:gravity="center_horizontal"
113112
android:layout_gravity="center_vertical"
114-
android:layout_marginStart="@dimen/keyguard_lockscreen_pin_margin_left"
115113
android:singleLine="true"
116114
android:textStyle="normal"
117115
android:inputType="textPassword"

core/res/res/layout/keyguard_status_view.xml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,32 @@
3333
android:gravity="center_horizontal|top"
3434
android:contentDescription="@*android:string/keyguard_accessibility_status">
3535

36-
<com.android.internal.policy.impl.keyguard.ClockView
37-
android:id="@+id/clock_view"
38-
android:layout_width="wrap_content"
39-
android:layout_height="wrap_content"
40-
android:layout_marginTop="@dimen/kg_clock_top_margin"
41-
android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
42-
android:layout_gravity="right">
43-
44-
<TextView android:id="@+id/clock_text"
36+
<LinearLayout android:layout_width="match_parent"
37+
android:layout_height="wrap_content"
38+
android:layout_gravity="center_vertical"
39+
android:orientation="vertical">
40+
<com.android.internal.policy.impl.keyguard.ClockView
41+
android:id="@+id/clock_view"
4542
android:layout_width="wrap_content"
4643
android:layout_height="wrap_content"
47-
android:singleLine="true"
48-
android:ellipsize="none"
49-
android:textSize="@dimen/kg_status_clock_font_size"
50-
android:textAppearance="?android:attr/textAppearanceMedium"
51-
android:textColor="#ffffffff"
52-
android:drawablePadding="2dip"
53-
/>
44+
android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
45+
android:layout_gravity="right">
46+
47+
<TextView android:id="@+id/clock_text"
48+
android:layout_width="wrap_content"
49+
android:layout_height="wrap_content"
50+
android:singleLine="true"
51+
android:ellipsize="none"
52+
android:textSize="@dimen/kg_status_clock_font_size"
53+
android:textAppearance="?android:attr/textAppearanceMedium"
54+
android:textColor="#ffffffff"
55+
android:drawablePadding="2dip"
56+
/>
5457

55-
</com.android.internal.policy.impl.keyguard.ClockView>
58+
</com.android.internal.policy.impl.keyguard.ClockView>
5659

57-
<include layout="@layout/keyguard_status_area" />
60+
<include layout="@layout/keyguard_status_area" />
61+
</LinearLayout>
5862

5963
</com.android.internal.policy.impl.keyguard.KeyguardStatusView>
6064
</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>

core/res/res/values/dimens.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@
291291
<dimen name="kg_widget_pager_horizontal_padding">16dp</dimen>
292292

293293
<!-- Top padding for the widget pager -->
294-
<dimen name="kg_widget_pager_top_padding">16dp</dimen>
294+
<dimen name="kg_widget_pager_top_padding">0dp</dimen>
295295

296296
<!-- Bottom padding for the widget pager -->
297-
<dimen name="kg_widget_pager_bottom_padding">6dp</dimen>
297+
<dimen name="kg_widget_pager_bottom_padding">0dp</dimen>
298298

299299
<!-- Top margin for the runway lights. We add a negative margin in large
300300
devices to account for the widget pager padding -->

policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,13 @@ public void onClick(View v) {
207207
});
208208
}
209209

210-
// If no icon is visible, reset the left margin on the password field so the text is
210+
// If no icon is visible, reset the start margin on the password field so the text is
211211
// still centered.
212212
if (!imeOrDeleteButtonVisible) {
213213
android.view.ViewGroup.LayoutParams params = mPasswordEntry.getLayoutParams();
214214
if (params instanceof MarginLayoutParams) {
215-
((MarginLayoutParams)params).leftMargin = 0;
215+
final MarginLayoutParams mlp = (MarginLayoutParams) params;
216+
mlp.setMarginStart(0);
216217
mPasswordEntry.setLayoutParams(params);
217218
}
218219
}

0 commit comments

Comments
 (0)