Merge "Impose a height & width downward on challenge views." into jb-mr1-lockscreen-dev

This commit is contained in:
Daniel Sandler
2012-10-30 12:11:50 -07:00
committed by Android (Google) Code Review
11 changed files with 114 additions and 80 deletions

View File

@@ -50,14 +50,14 @@
<com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/keyguard_security_width"
android:layout_height="@dimen/keyguard_security_height"
androidprv:layout_childType="challenge"
androidprv:layout_centerWithinArea="0.55">
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingLeft="@dimen/keyguard_security_view_margin"

View File

@@ -51,8 +51,8 @@
<com.android.internal.policy.impl.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/keyguard_security_width"
android:layout_height="@dimen/keyguard_security_height"
androidprv:layout_childType="challenge"
android:layout_marginLeft="@dimen/kg_edge_swipe_region_size"
android:layout_marginRight="@dimen/kg_edge_swipe_region_size"
@@ -60,8 +60,8 @@
android:gravity="bottom|center_horizontal">
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingLeft="@dimen/keyguard_security_view_margin"

View File

@@ -22,73 +22,61 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">
android:gravity="bottom"
>
<FrameLayout
<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
android:layout_weight="1"
/>
<include layout="@layout/keyguard_message_area"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<include layout="@layout/keyguard_message_area"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_gravity="center">
<!-- Password entry field -->
<!-- Note: the entire container is styled to look like the edit field,
since the backspace/IME switcher looks better inside -->
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#70000000"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText android:id="@+id/passwordEntry"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:layout_gravity="center_vertical"
android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
android:singleLine="true"
android:textStyle="normal"
android:inputType="textPassword"
android:textSize="36sp"
android:background="@null"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffffff"
android:imeOptions="flagForceAscii|actionDone"
/>
<!-- Password entry field -->
<!-- Note: the entire container is styled to look like the edit field,
since the backspace/IME switcher looks better inside -->
<LinearLayout
android:layout_gravity="center_vertical|fill_horizontal"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#70000000"
android:layout_marginStart="4dip"
android:layout_marginEnd="4dip">
<ImageView android:id="@+id/switch_ime_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@*android:drawable/ic_lockscreen_ime"
android:clickable="true"
android:padding="8dip"
android:layout_gravity="center"
android:background="?android:attr/selectableItemBackground"
android:visibility="gone"
/>
<EditText android:id="@+id/passwordEntry"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:layout_gravity="center_vertical"
android:layout_marginStart="@*android:dimen/keyguard_lockscreen_pin_margin_left"
android:singleLine="true"
android:textStyle="normal"
android:inputType="textPassword"
android:textSize="36sp"
android:background="@null"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffffff"
android:imeOptions="flagForceAscii|actionDone"
/>
<ImageView android:id="@+id/switch_ime_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@*android:drawable/ic_lockscreen_ime"
android:clickable="true"
android:padding="8dip"
android:layout_gravity="center"
android:background="?android:attr/selectableItemBackground"
android:visibility="gone"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
<include layout="@layout/keyguard_emergency_carrier_area"
android:id="@+id/keyguard_selector_fade_container"
android:layout_width="match_parent"

View File

@@ -21,8 +21,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/res/android"
android:id="@+id/keyguard_pin_view"
android:layout_width="350dp"
android:layout_height="350dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<include layout="@layout/keyguard_message_area"
@@ -35,7 +35,7 @@
android:orientation="horizontal"
android:layout_weight="1"
>
<TextView android:id="@+id/passwordEntry"
<TextView android:id="@+id/pinEntry"
android:editable="true"
android:layout_width="0dip"
android:layout_height="match_parent"
@@ -78,7 +78,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="1"
/>
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -87,7 +87,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="2"
/>
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -96,7 +96,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="3"
/>
</LinearLayout>
@@ -112,7 +112,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="4"
/>
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -121,7 +121,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="5"
/>
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -130,7 +130,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="6"
/>
</LinearLayout>
@@ -146,7 +146,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="7"
/>
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -155,7 +155,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="8"
/>
<view class="com.android.internal.policy.impl.keyguard.NumPadKey"
@@ -164,7 +164,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="9"
/>
</LinearLayout>
@@ -185,7 +185,7 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
androidprv:textView="@+id/passwordEntry"
androidprv:textView="@+id/pinEntry"
androidprv:digit="0"
/>
<ImageButton

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License")
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources>
<!-- Width of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
<dimen name="keyguard_security_width">340dp</dimen>
</resources>

View File

@@ -112,4 +112,9 @@
<!-- Size of the text under the avator on the multiuser lockscreen. -->
<dimen name="keyguard_avatar_name_size">12sp</dimen>
<!-- Width of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
<dimen name="keyguard_security_width">420dp</dimen>
<!-- Height of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
<dimen name="keyguard_security_height">420dp</dimen>
</resources>

View File

@@ -303,6 +303,12 @@
<!-- Touch slop for the global toggle accessibility gesture -->
<dimen name="accessibility_touch_slop">80dip</dimen>
<!-- Width of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
<dimen name="keyguard_security_width">320dp</dimen>
<!-- Height of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
<dimen name="keyguard_security_height">400dp</dimen>
<!-- Margin around the various security views -->
<dimen name="keyguard_security_view_margin">8dp</dimen>

View File

@@ -1269,6 +1269,7 @@
<java-symbol type="id" name="option3" />
<java-symbol type="id" name="password" />
<java-symbol type="id" name="passwordEntry" />
<java-symbol type="id" name="pinEntry" />
<java-symbol type="id" name="pinDel" />
<java-symbol type="id" name="pinDisplay" />
<java-symbol type="id" name="owner_info" />

View File

@@ -87,13 +87,14 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
}
}
protected abstract int getPasswordTextViewId();
protected abstract void resetState();
@Override
protected void onFinishInflate() {
mLockPatternUtils = new LockPatternUtils(mContext);
mPasswordEntry = (TextView) findViewById(R.id.passwordEntry);
mPasswordEntry = (TextView) findViewById(getPasswordTextViewId());
mPasswordEntry.setOnEditorActionListener(this);
mPasswordEntry.addTextChangedListener(this);

View File

@@ -46,6 +46,11 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView
mPasswordEntry.setEnabled(true);
}
@Override
protected int getPasswordTextViewId() {
return R.id.pinEntry;
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();

View File

@@ -59,6 +59,11 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
mPasswordEntry.setEnabled(true);
}
@Override
protected int getPasswordTextViewId() {
return R.id.passwordEntry;
}
@Override
public boolean needsInput() {
return true;