Merge "Update keyguard layouts on phone" into jb-mr1-dev

This commit is contained in:
Jim Miller
2012-09-27 15:52:33 -07:00
committed by Android (Google) Code Review
70 changed files with 359 additions and 142 deletions

View File

@@ -31,6 +31,7 @@ import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewRootImpl;
import com.android.internal.R;
@@ -55,23 +56,56 @@ public class PasswordEntryKeyboardHelper implements OnKeyboardActionListener {
private long[] mVibratePattern;
private boolean mEnableHaptics = false;
private static final int NUMERIC = 0;
private static final int QWERTY = 1;
private static final int QWERTY_SHIFTED = 2;
private static final int SYMBOLS = 3;
private static final int SYMBOLS_SHIFTED = 4;
int mLayouts[] = new int[] {
R.xml.password_kbd_numeric,
R.xml.password_kbd_qwerty,
R.xml.password_kbd_qwerty_shifted,
R.xml.password_kbd_symbols,
R.xml.password_kbd_symbols_shift
};
private boolean mUsingScreenWidth;
public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView) {
this(context, keyboardView, targetView, true);
this(context, keyboardView, targetView, true, null);
}
public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView,
boolean useFullScreenWidth) {
this(context, keyboardView, targetView, useFullScreenWidth, null);
}
public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView,
boolean useFullScreenWidth, int layouts[]) {
mContext = context;
mTargetView = targetView;
mKeyboardView = keyboardView;
if (useFullScreenWidth
|| mKeyboardView.getLayoutParams().width == ViewGroup.LayoutParams.MATCH_PARENT) {
createKeyboards();
} else {
createKeyboardsWithSpecificSize(mKeyboardView.getLayoutParams().width,
mKeyboardView.getLayoutParams().height);
}
mKeyboardView.setOnKeyboardActionListener(this);
mUsingScreenWidth = useFullScreenWidth;
if (layouts != null) {
if (layouts.length != mLayouts.length) {
throw new RuntimeException("Wrong number of layouts");
}
for (int i = 0; i < mLayouts.length; i++) {
mLayouts[i] = layouts[i];
}
}
createKeyboards();
}
public void createKeyboards() {
LayoutParams lp = mKeyboardView.getLayoutParams();
if (mUsingScreenWidth || lp.width == ViewGroup.LayoutParams.MATCH_PARENT) {
createKeyboardsWithDefaultWidth();
} else {
createKeyboardsWithSpecificSize(lp.width, lp.height);
}
}
public void setEnableHaptics(boolean enabled) {
@@ -82,46 +116,40 @@ public class PasswordEntryKeyboardHelper implements OnKeyboardActionListener {
return mKeyboardMode == KEYBOARD_MODE_ALPHA;
}
private void createKeyboardsWithSpecificSize(int viewWidth, int viewHeight) {
mNumericKeyboard = new PasswordEntryKeyboard(mContext, R.xml.password_kbd_numeric,
viewWidth, viewHeight);
mQwertyKeyboard = new PasswordEntryKeyboard(mContext,
R.xml.password_kbd_qwerty, R.id.mode_normal, viewWidth, viewHeight);
private void createKeyboardsWithSpecificSize(int width, int height) {
mNumericKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[NUMERIC], width, height);
mQwertyKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[QWERTY], R.id.mode_normal,
width, height);
mQwertyKeyboard.enableShiftLock();
mQwertyKeyboardShifted = new PasswordEntryKeyboard(mContext,
R.xml.password_kbd_qwerty_shifted,
R.id.mode_normal, viewWidth, viewHeight);
mQwertyKeyboardShifted = new PasswordEntryKeyboard(mContext, mLayouts[QWERTY_SHIFTED],
R.id.mode_normal, width, height);
mQwertyKeyboardShifted.enableShiftLock();
mQwertyKeyboardShifted.setShifted(true); // always shifted.
mSymbolsKeyboard = new PasswordEntryKeyboard(mContext, R.xml.password_kbd_symbols,
viewWidth, viewHeight);
mSymbolsKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[SYMBOLS], width, height);
mSymbolsKeyboard.enableShiftLock();
mSymbolsKeyboardShifted = new PasswordEntryKeyboard(mContext,
R.xml.password_kbd_symbols_shift, viewWidth, viewHeight);
mSymbolsKeyboardShifted = new PasswordEntryKeyboard(mContext, mLayouts[SYMBOLS_SHIFTED],
width, height);
mSymbolsKeyboardShifted.enableShiftLock();
mSymbolsKeyboardShifted.setShifted(true); // always shifted
}
private void createKeyboards() {
mNumericKeyboard = new PasswordEntryKeyboard(mContext, R.xml.password_kbd_numeric);
mQwertyKeyboard = new PasswordEntryKeyboard(mContext,
R.xml.password_kbd_qwerty, R.id.mode_normal);
private void createKeyboardsWithDefaultWidth() {
mNumericKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[NUMERIC]);
mQwertyKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[QWERTY], R.id.mode_normal);
mQwertyKeyboard.enableShiftLock();
mQwertyKeyboardShifted = new PasswordEntryKeyboard(mContext,
R.xml.password_kbd_qwerty_shifted,
mQwertyKeyboardShifted = new PasswordEntryKeyboard(mContext, mLayouts[QWERTY_SHIFTED],
R.id.mode_normal);
mQwertyKeyboardShifted.enableShiftLock();
mQwertyKeyboardShifted.setShifted(true); // always shifted.
mSymbolsKeyboard = new PasswordEntryKeyboard(mContext, R.xml.password_kbd_symbols);
mSymbolsKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[SYMBOLS]);
mSymbolsKeyboard.enableShiftLock();
mSymbolsKeyboardShifted = new PasswordEntryKeyboard(mContext,
R.xml.password_kbd_symbols_shift);
mSymbolsKeyboardShifted = new PasswordEntryKeyboard(mContext, mLayouts[SYMBOLS_SHIFTED]);
mSymbolsKeyboardShifted.enableShiftLock();
mSymbolsKeyboardShifted.setShifted(true); // always shifted
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

BIN
core/res/res/drawable-hdpi/sym_keyboard_delete.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
core/res/res/drawable-hdpi/sym_keyboard_num1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

After

Width:  |  Height:  |  Size: 626 B

BIN
core/res/res/drawable-hdpi/sym_keyboard_num2.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
core/res/res/drawable-hdpi/sym_keyboard_num3.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
core/res/res/drawable-hdpi/sym_keyboard_num4.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
core/res/res/drawable-hdpi/sym_keyboard_num5.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
core/res/res/drawable-hdpi/sym_keyboard_num6.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
core/res/res/drawable-hdpi/sym_keyboard_num7.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
core/res/res/drawable-hdpi/sym_keyboard_num8.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
core/res/res/drawable-hdpi/sym_keyboard_num9.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 829 B

After

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -24,13 +24,15 @@
android:id="@+id/keyguard_host_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
android:id="@+id/app_widget_container"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_height="230dip"
android:gravity="center"
android:layout_weight=".45"
android:visibility="gone">
<!-- TODO: Remove this once supported as a widget -->
@@ -44,7 +46,9 @@
android:id="@+id/view_flipper"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_weight="0.55"
android:layout_marginLeft="8dip"
android:layout_marginRight="8dip"
android:gravity="center">
<!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->

View File

@@ -0,0 +1,52 @@
<?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.
*/
-->
<!-- This contains emergency call button and carrier as shared by pin/pattern/password screens -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true">
<com.android.internal.policy.impl.keyguard.CarrierText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/kg_status_line_font_size"
android:layout_marginLeft="@dimen/kg_emergency_button_shift"
android:textColor="?android:attr/textColorSecondary"/>
<com.android.internal.policy.impl.keyguard.EmergencyButton
android:id="@+id/emergency_call_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@*android:drawable/lockscreen_emergency_button"
android:text="@string/kg_emergency_call_label"
style="?android:attr/buttonBarButtonStyle"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/kg_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginLeft="@dimen/kg_emergency_button_shift"
android:drawablePadding="8dip" />
</LinearLayout>

View File

@@ -17,39 +17,19 @@
*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left">
android:id="@+id/keyguard_click_area"
android:gravity="center">
<LinearLayout
android:id="@+id/keyguard_click_area"
android:layout_width="match_parent"
<!-- message area for security screen -->
<TextView
android:id="@+id/keyguard_message_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
style="?android:attr/buttonBarButtonStyle"
android:padding="10dip"
android:clickable="true">
<ImageView
android:src="?android:attr/homeAsUpIndicator"
android:layout_gravity="center_vertical|start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<!-- message area for security screen -->
<TextView
android:id="@+id/keyguard_message_area"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="end"
android:singleLine="true"
android:ellipsize="marquee"
android:layout_marginEnd="6dip"
android:layout_marginStart="6dip"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
android:layout_gravity="start"
android:ellipsize="marquee"
android:layout_marginEnd="4dip"
android:layout_marginStart="4dip"
android:textSize="22dip"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>

View File

@@ -24,7 +24,16 @@
android:layout_height="match_parent"
android:gravity="center_horizontal">
<include layout="@layout/keyguard_navigation"/>
<LinearLayout
android:layout_height="0dip"
android:layout_width="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<include layout="@layout/keyguard_navigation"/>
</LinearLayout>
<!-- Password entry field -->
<!-- Note: the entire container is styled to look like the edit field,
@@ -33,9 +42,9 @@
android:layout_gravity="center_vertical|fill_horizontal"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="@*android:drawable/lockscreen_password_field_dark"
android:layout_marginStart="16dip"
android:layout_marginEnd="16dip">
android:background="#70000000"
android:layout_marginStart="4dip"
android:layout_marginEnd="4dip">
<EditText android:id="@+id/passwordEntry"
android:layout_width="0dip"
@@ -79,11 +88,6 @@
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"/>
<!-- Numeric keyboard -->
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
android:layout_width="match_parent"
@@ -97,4 +101,9 @@
android:clickable="true"
/>
<Space
android:layout_width="match_parent"
android:layout_height="@dimen/kg_secure_padding_height"
android:background="@drawable/lockscreen_protection_pattern" />
</com.android.internal.policy.impl.keyguard.KeyguardPasswordView>

View File

@@ -28,18 +28,22 @@
android:layout_height="match_parent"
android:gravity="center_horizontal">
<include layout="@layout/keyguard_navigation"/>
<LinearLayout
android:layout_height="0dip"
android:layout_width="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<Space android:layout_gravity="fill" />
<include layout="@layout/keyguard_navigation"/>
<Button android:id="@+id/forgot_password_button"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@*android:dimen/keyguard_lockscreen_status_line_font_size"
android:drawableLeft="@*android:drawable/lockscreen_forgot_password_button"
android:drawablePadding="0dip"
android:visibility="gone"/>
<Button android:id="@+id/forgot_password_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/kg_status_line_font_size"
android:visibility="gone"/>
</LinearLayout>
<!-- We need MATCH_PARENT here only to force the size of the parent to be passed to
the pattern view for it to compute its size. This is an unusual case, caused by
@@ -52,7 +56,11 @@
android:layout_marginEnd="8dip"
android:layout_marginBottom="4dip"
android:layout_marginStart="8dip"
android:layout_gravity="center_horizontal"
/>
android:layout_gravity="center_horizontal" />
<Space
android:layout_width="match_parent"
android:layout_height="@dimen/kg_secure_padding_height"
android:background="@drawable/lockscreen_protection_pattern" />
</com.android.internal.policy.impl.keyguard.KeyguardPatternView>

View File

@@ -31,6 +31,9 @@
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="0.45"
android:layout_marginTop="35dip"
android:layout_marginLeft="33dip"
android:layout_marginRight="33dip"
android:visibility="gone">
<!-- TODO: Remove this when supported as a widget -->
<include layout="@layout/keyguard_status_view"/>
@@ -50,6 +53,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:gravity="@integer/kg_selector_gravity"
prvandroid:targetDrawables="@*android:array/lockscreen_targets_with_camera"
prvandroid:targetDescriptions="@*android:array/lockscreen_target_descriptions_with_camera"
@@ -64,34 +68,13 @@
prvandroid:glowRadius="@*android:dimen/glowpadview_glow_radius"
prvandroid:pointDrawable="@*android:drawable/ic_lockscreen_glowdot"/>
<LinearLayout
<include layout="@layout/keyguard_emergency_carrier_area"
android:id="@+id/keyguard_selector_fade_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true">
<com.android.internal.policy.impl.keyguard.CarrierText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@*android:dimen/keyguard_lockscreen_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
/>
<com.android.internal.policy.impl.keyguard.EmergencyButton
android:id="@+id/emergency_call_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@*android:drawable/lockscreen_emergency_button"
android:text="@string/kg_emergency_call_label"
style="?android:attr/buttonBarButtonStyle"
android:drawablePadding="8dip" />
</LinearLayout>
android:layout_alignParentBottom="true" />
</RelativeLayout>

View File

@@ -25,12 +25,21 @@
android:layout_height="match_parent"
android:gravity="center_horizontal">
<include layout="@layout/keyguard_navigation"/>
<Space
android:layout_width="match_parent"
<LinearLayout
android:layout_height="0dip"
android:layout_weight="1"/>
android:layout_width="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_lockscreen_sim"/>
<include layout="@layout/keyguard_navigation"/>
</LinearLayout>
<!-- Password entry field -->
<!-- Note: the entire container is styled to look like the edit field,
@@ -39,8 +48,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginEnd="6dip"
android:layout_marginStart="6dip"
android:layout_marginEnd="4dip"
android:layout_marginStart="4dip"
android:gravity="center_vertical"
android:background="@android:drawable/edit_text">
@@ -74,9 +83,14 @@
android:layout_marginEnd="4dip"
android:paddingTop="4dip"
android:paddingBottom="4dip"
android:background="#80ffffff"
android:background="#40000000"
android:keyBackground="@*android:drawable/btn_keyboard_key_ics"
android:clickable="true"
/>
<Space
android:layout_width="match_parent"
android:layout_height="@dimen/kg_secure_padding_height"
android:background="@drawable/lockscreen_protection_pattern" />
</com.android.internal.policy.impl.keyguard.KeyguardSimPinView>

View File

@@ -35,6 +35,7 @@
android:id="@+id/clock_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-15.5dip"
android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
android:layout_gravity="end">
@@ -46,6 +47,7 @@
android:textSize="@dimen/kg_status_clock_font_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffffff"
android:drawablePadding="2dip"
/>
</com.android.internal.policy.impl.keyguard.ClockView>
@@ -64,19 +66,21 @@
/>
<TextView
android:id="@+id/owner_info"
android:id="@+id/alarm_status"
android:layout_gravity="end"
android:layout_marginTop="16dp"
android:layout_marginTop="28dp"
android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/kg_status_line_font_size"
android:drawablePadding="4dip"
/>
<TextView
android:id="@+id/alarm_status"
android:id="@+id/owner_info"
android:layout_gravity="end"
android:layout_marginTop="4dp"
android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
android:singleLine="true"
android:ellipsize="marquee"
@@ -87,6 +91,7 @@
<TextView
android:id="@+id/status1"
android:layout_gravity="end"
android:layout_marginTop="4dp"
android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
android:singleLine="true"
android:ellipsize="marquee"

View File

@@ -22,16 +22,16 @@
<!-- Resources for GlowPadView in LockScreen -->
<array name="lockscreen_targets_when_silent">
<item>@null</item>"
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_soundon</item>
<item>@drawable/ic_lockscreen_unlock</item>
</array>
<array name="lockscreen_target_descriptions_when_silent">
<item>@null</item>
<item>@string/description_target_unlock</item>
<item>@string/description_target_search</item>
<item>@string/description_target_soundon</item>
<item>@string/description_target_unlock</item>
</array>
<array name="lockscreen_direction_descriptions">
@@ -43,30 +43,30 @@
<array name="lockscreen_targets_when_soundon">
<item>@null</item>
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_silent</item>
<item>@drawable/ic_lockscreen_unlock</item>
</array>
<array name="lockscreen_target_descriptions_when_soundon">
<item>@null</item>
<item>@string/description_target_unlock</item>
<item>@string/description_target_search</item>
<item>@string/description_target_silent</item>
<item>@string/description_target_unlock</item>
</array>
<array name="lockscreen_targets_with_camera">
<item>@null</item>
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@drawable/ic_lockscreen_unlock</item>
</array>
<array name="lockscreen_target_descriptions_with_camera">
<item>@null</item>
<item>@string/description_target_unlock</item>
<item>@string/description_target_search</item>
<item>@string/description_target_camera</item>
<item>@string/description_target_unlock</item>
</array>
</resources>

View File

@@ -43,4 +43,11 @@
<!-- Size of clock font in LockScreen on Unsecure unlock screen. -->
<dimen name="keyguard_lockscreen_clock_font_size">70sp</dimen>
<!-- Shift emergency button from the left edge by this amount. Used by landscape layout on
phones -->
<dimen name="kg_emergency_button_shift">30dp</dimen>
<!-- Space reserved at the bottom of secure views (pin/pattern/password/SIM pin/SIM puk) -->
<dimen name="kg_secure_padding_height">0dp</dimen>
</resources>

View File

@@ -0,0 +1,26 @@
<?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>
<integer name="kg_security_flip_duration">150</integer>
<integer name="kg_security_fade_duration">150</integer>
<!-- Gravity to make KeyguardSelectorView work in multiple orientations
0x13 == "left|center_vertical" -->
<integer name="kg_selector_gravity">0x13</integer>
</resources>

View File

@@ -261,12 +261,28 @@
<dimen name="kg_status_clock_font_size">94dp</dimen>
<!-- Size of the date font in keyguard's status view -->
<dimen name="kg_status_date_font_size">24dp</dimen>
<dimen name="kg_status_date_font_size">17dp</dimen>
<!-- Size of the generic status lines keyguard's status view -->
<dimen name="kg_status_line_font_size">12sp</dimen>
<dimen name="kg_status_line_font_size">14sp</dimen>
<!-- Size of margin on the right of keyguard's status view -->
<dimen name="kg_status_line_font_right_margin">32dp</dimen>
<dimen name="kg_status_line_font_right_margin">0dp</dimen>
<!-- Horizontal gap between keys in PIN and SIM PIN numeric keyboards in keyguard -->
<dimen name="kg_key_horizontal_gap">0dp</dimen>
<!-- Horizontal gap between keys in PIN and SIM PIN numeric keyboards in keyguard -->
<dimen name="kg_key_vertical_gap">0dp</dimen>
<!-- Horizontal gap between keys in PIN and SIM PIN numeric keyboards in keyguard -->
<dimen name="kg_pin_key_height">60dp</dimen>
<!-- Shift emergency button from the left edge by this amount. Used by landscape layout on
phones -->
<dimen name="kg_emergency_button_shift">0dp</dimen>
<!-- Space reserved at the bottom of secure views (pin/pattern/password/SIM pin/SIM puk) -->
<dimen name="kg_secure_padding_height">46dp</dimen>
</resources>

View File

@@ -57,5 +57,4 @@
<string name="full_wday_month_day_no_year">EEEE, MMMM d</string>
<string name="abbrev_wday_month_day_no_year">EEE, MMMM d</string>
<string name="abbrev_wday_month_day_year">EEE, MMM d, yyyy</string>
<string name="keyguard_wday_day_month">EEE <b>d</b> MMM</string>
</resources>

View File

@@ -19,4 +19,8 @@
<resources>
<integer name="kg_security_flip_duration">75</integer>
<integer name="kg_security_fade_duration">75</integer>
<!-- Gravity to make KeyguardSelectorView work in multiple orientations
0x31 == "top|center_horizontal" -->
<integer name="kg_selector_gravity">0x31</integer>
</resources>

View File

@@ -3902,6 +3902,5 @@
"Raise volume above safe level?\nListening at high volume for long periods may damage your hearing."
</string>
<string name="kg_temp_back_string"> &lt; </string> <!-- TODO: remove this -->
</resources>

View File

@@ -957,6 +957,7 @@
<java-symbol type="drawable" name="ic_lockscreen_silent" />
<java-symbol type="drawable" name="ic_lockscreen_unlock" />
<java-symbol type="drawable" name="ic_action_assist_generic" />
<java-symbol type="drawable" name="ic_lockscreen_alarm" />
<java-symbol type="drawable" name="notification_bg" />
<java-symbol type="drawable" name="notification_bg_low" />
<java-symbol type="drawable" name="notification_template_icon_bg" />
@@ -1079,6 +1080,7 @@
<java-symbol type="xml" name="password_kbd_qwerty_shifted" />
<java-symbol type="xml" name="password_kbd_symbols" />
<java-symbol type="xml" name="password_kbd_symbols_shift" />
<java-symbol type="xml" name="kg_password_kbd_numeric" />
<java-symbol type="xml" name="power_profile" />
<java-symbol type="xml" name="time_zones_by_country" />
<java-symbol type="xml" name="sms_short_codes" />
@@ -1362,7 +1364,6 @@
<java-symbol type="string" name="lockscreen_too_many_failed_pin_attempts_dialog_message" />
<java-symbol type="string" name="lockscreen_unlock_label" />
<java-symbol type="string" name="status_bar_device_locked" />
<java-symbol type="string" name="keyguard_wday_day_month" />
<java-symbol type="style" name="Animation.LockScreen" />
<java-symbol type="style" name="Theme.Dialog.RecentApplications" />
<java-symbol type="style" name="Theme.ExpandedMenu" />

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2008, 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.
*/
-->
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:keyWidth="33.33%p"
android:horizontalGap="@dimen/kg_key_horizontal_gap"
android:verticalGap="@dimen/kg_key_vertical_gap"
android:keyHeight="@dimen/kg_pin_key_height">
<Row android:rowEdgeFlags="top">
<Key android:codes="49" android:keyIcon="@*android:drawable/sym_keyboard_num1"
android:keyEdgeFlags="left"/>
<Key android:codes="50" android:keyIcon="@*android:drawable/sym_keyboard_num2"/>
<Key android:codes="51" android:keyIcon="@*android:drawable/sym_keyboard_num3"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="52" android:keyIcon="@*android:drawable/sym_keyboard_num4"
android:keyEdgeFlags="left"/>
<Key android:codes="53" android:keyIcon="@*android:drawable/sym_keyboard_num5"/>
<Key android:codes="54" android:keyIcon="@*android:drawable/sym_keyboard_num6"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="55" android:keyIcon="@*android:drawable/sym_keyboard_num7"
android:keyEdgeFlags="left"/>
<Key android:codes="56" android:keyIcon="@*android:drawable/sym_keyboard_num8"/>
<Key android:codes="57" android:keyIcon="@*android:drawable/sym_keyboard_num9"
android:keyEdgeFlags="right"/>
</Row>
<Row android:rowEdgeFlags="bottom">
<Key android:codes="48" android:keyIcon="@*android:drawable/sym_keyboard_num0_no_plus"
android:keyWidth="33.33%p"
android:keyEdgeFlags="left"/>
<Key android:codes="10" android:keyIcon="@*android:drawable/sym_keyboard_enter"
android:keyWidth="66.67%p"
android:keyEdgeFlags="right"/>
</Row>
</Keyboard>

View File

@@ -51,7 +51,7 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="48" android:keyIcon="@drawable/sym_keyboard_num0_no_plus"
android:keyWidth="66.66%p" android:keyEdgeFlags="left"/>
<Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok"
<Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_enter"
android:keyEdgeFlags="right"/>
</Row>

View File

@@ -122,7 +122,15 @@ public class KeyguardPasswordView extends LinearLayout
mPasswordEntry = (EditText) findViewById(R.id.passwordEntry);
mPasswordEntry.setOnEditorActionListener(this);
mKeyboardHelper = new PasswordEntryKeyboardHelper(mContext, mKeyboardView, this, false);
mKeyboardHelper = new PasswordEntryKeyboardHelper(mContext, mKeyboardView, this, false,
new int[] {
R.xml.kg_password_kbd_numeric,
com.android.internal.R.xml.password_kbd_qwerty,
com.android.internal.R.xml.password_kbd_qwerty_shifted,
com.android.internal.R.xml.password_kbd_symbols,
com.android.internal.R.xml.password_kbd_symbols_shift
}
);
mKeyboardHelper.setEnableHaptics(mLockPatternUtils.isTactileFeedbackEnabled());
boolean imeOrDeleteButtonVisible = false;

View File

@@ -31,7 +31,7 @@ import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.GridLayout;
import android.widget.LinearLayout;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockPatternView;
@@ -40,7 +40,7 @@ import com.android.internal.R;
import java.io.IOException;
import java.util.List;
public class KeyguardPatternView extends GridLayout implements KeyguardSecurityView {
public class KeyguardPatternView extends LinearLayout implements KeyguardSecurityView {
private static final String TAG = "SecurityPatternView";
private static final boolean DEBUG = false;

View File

@@ -82,7 +82,14 @@ public class KeyguardSimPinView extends LinearLayout
mPinEntry.setOnEditorActionListener(this);
mKeyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard);
mKeyboardHelper = new PasswordEntryKeyboardHelper(mContext, mKeyboardView, this, false);
mKeyboardHelper = new PasswordEntryKeyboardHelper(mContext, mKeyboardView, this, false,
new int[] {
R.xml.kg_password_kbd_numeric,
com.android.internal.R.xml.password_kbd_qwerty,
com.android.internal.R.xml.password_kbd_qwerty_shifted,
com.android.internal.R.xml.password_kbd_symbols,
com.android.internal.R.xml.password_kbd_symbols_shift
});
mKeyboardHelper.setKeyboardMode(PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
mKeyboardHelper.setEnableHaptics(mLockPatternUtils.isTactileFeedbackEnabled());

View File

@@ -96,7 +96,14 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList
mDelPinButton.setOnClickListener(this);
mKeyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard);
mKeyboardHelper = new PasswordEntryKeyboardHelper(mContext, mKeyboardView, this, false);
mKeyboardHelper = new PasswordEntryKeyboardHelper(mContext, mKeyboardView, this, false,
new int[] {
R.xml.kg_password_kbd_numeric,
com.android.internal.R.xml.password_kbd_qwerty,
com.android.internal.R.xml.password_kbd_qwerty_shifted,
com.android.internal.R.xml.password_kbd_symbols,
com.android.internal.R.xml.password_kbd_symbols_shift
});
mKeyboardHelper.setKeyboardMode(PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
mKeyboardHelper.setEnableHaptics(mLockPatternUtils.isTactileFeedbackEnabled());

View File

@@ -102,7 +102,8 @@ class KeyguardStatusViewManager {
public KeyguardStatusViewManager(View view) {
if (DEBUG) Log.v(TAG, "KeyguardStatusViewManager()");
mContainer = view;
mDateFormatString = getContext().getResources().getText(R.string.keyguard_wday_day_month);
mDateFormatString = getContext().getResources().getText(
com.android.internal.R.string.abbrev_wday_month_day_no_year);
mLockPatternUtils = new LockPatternUtils(view.getContext());
mUpdateMonitor = KeyguardUpdateMonitor.getInstance(view.getContext());
@@ -113,7 +114,7 @@ class KeyguardStatusViewManager {
mClockView = (ClockView) view.findViewById(R.id.clock_view);
// Use custom font in mDateView
mDateView.setTypeface(Typeface.create("sans-serif-thin", Typeface.NORMAL));
mDateView.setTypeface(Typeface.SANS_SERIF);
// Required to get Marquee to work.
final View marqueeViews[] = { mDateView, mStatus1View, mOwnerInfoView, mAlarmStatusView };
@@ -183,6 +184,7 @@ class KeyguardStatusViewManager {
Settings.Secure.LOCK_SCREEN_OWNER_INFO_ENABLED, 1, UserHandle.USER_CURRENT) != 0;
String text = Settings.Secure.getStringForUser(res, Settings.Secure.LOCK_SCREEN_OWNER_INFO,
UserHandle.USER_CURRENT);
text = text.trim(); // Remove trailing newlines
if (ownerInfoEnabled && !TextUtils.isEmpty(text)) {
maybeSetUpperCaseText(mOwnerInfoView, text);
mOwnerInfoView.setVisibility(View.VISIBLE);
@@ -228,8 +230,7 @@ class KeyguardStatusViewManager {
}
private void maybeSetUpperCaseText(TextView textView, CharSequence text) {
if (KeyguardViewManager.USE_UPPER_CASE
&& (textView == mDateView)) { // currently only required for date view
if (KeyguardViewManager.USE_UPPER_CASE) { // currently only required for date view
textView.setText(text != null ? text.toString().toUpperCase() : null);
} else {
textView.setText(text);

View File

@@ -46,7 +46,7 @@ import com.android.internal.R;
public class KeyguardViewManager {
private final static boolean DEBUG = false;
private static String TAG = "KeyguardViewManager";
public static boolean USE_UPPER_CASE = false;
public static boolean USE_UPPER_CASE = true;
private final Context mContext;
private final ViewManager mViewManager;