From 8171b5182f5f07d33c9dfdf2dd8f0f6ae9588039 Mon Sep 17 00:00:00 2001 From: Jae Yong Sung Date: Thu, 5 Aug 2010 10:44:27 -0700 Subject: lock screen for xlarge Change-Id: Iab9f53609bf24be774752a9960aaaa654d7a614f --- core/java/android/inputmethodservice/Keyboard.java | 25 ++- .../internal/widget/PasswordEntryKeyboard.java | 14 ++ .../widget/PasswordEntryKeyboardHelper.java | 35 +++- .../res/res/drawable-xlarge/ic_lock_idle_alarm.png | Bin 0 -> 2831 bytes .../res/drawable-xlarge/ic_lock_idle_charging.png | Bin 0 -> 1762 bytes core/res/res/drawable-xlarge/ic_lock_idle_lock.png | Bin 0 -> 1554 bytes .../drawable-xlarge/ic_lock_idle_low_battery.png | Bin 0 -> 1782 bytes core/res/res/layout-xlarge/keyguard.xml | 40 ++++ .../keyguard_screen_glogin_unlock.xml | 126 ++++++++++++ .../res/res/layout-xlarge/keyguard_screen_lock.xml | 220 +++++++++++++++++++++ .../keyguard_screen_password_landscape.xml | 90 +++++++++ .../keyguard_screen_password_portrait.xml | 89 +++++++++ .../keyguard_screen_sim_pin_landscape.xml | 122 ++++++++++++ .../keyguard_screen_sim_pin_portrait.xml | 119 +++++++++++ .../layout-xlarge/keyguard_screen_status_land.xml | 127 ++++++++++++ .../layout-xlarge/keyguard_screen_status_port.xml | 127 ++++++++++++ .../layout-xlarge/keyguard_screen_tab_unlock.xml | 100 ++++++++++ .../keyguard_screen_tab_unlock_land.xml | 96 +++++++++ .../keyguard_screen_unlock_landscape.xml | 106 ++++++++++ .../keyguard_screen_unlock_portrait.xml | 102 ++++++++++ .../layout/keyguard_screen_password_landscape.xml | 2 +- .../layout/keyguard_screen_password_portrait.xml | 2 +- core/res/res/values-xlarge/config.xml | 5 + core/res/res/values-xlarge/dimens.xml | 5 + core/res/res/values/config.xml | 6 + core/res/res/values/dimens.xml | 6 +- core/res/res/xml-land/password_kbd_qwerty.xml | 2 +- .../res/xml-land/password_kbd_qwerty_shifted.xml | 2 +- core/res/res/xml-mdpi/password_kbd_qwerty.xml | 2 +- .../res/xml-mdpi/password_kbd_qwerty_shifted.xml | 2 +- core/res/res/xml-xlarge/password_kbd_qwerty.xml | 102 ++++++++++ .../res/xml-xlarge/password_kbd_qwerty_shifted.xml | 101 ++++++++++ core/res/res/xml/password_kbd_extension.xml | 2 +- core/res/res/xml/password_kbd_numeric.xml | 3 +- core/res/res/xml/password_kbd_popup_template.xml | 2 +- core/res/res/xml/password_kbd_qwerty.xml | 2 +- core/res/res/xml/password_kbd_qwerty_shifted.xml | 2 +- core/res/res/xml/password_kbd_symbols.xml | 2 +- core/res/res/xml/password_kbd_symbols_shift.xml | 2 +- 39 files changed, 1772 insertions(+), 18 deletions(-) create mode 100644 core/res/res/drawable-xlarge/ic_lock_idle_alarm.png create mode 100644 core/res/res/drawable-xlarge/ic_lock_idle_charging.png create mode 100644 core/res/res/drawable-xlarge/ic_lock_idle_lock.png create mode 100644 core/res/res/drawable-xlarge/ic_lock_idle_low_battery.png create mode 100644 core/res/res/layout-xlarge/keyguard.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_glogin_unlock.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_lock.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_sim_pin_landscape.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_sim_pin_portrait.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_status_land.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_status_port.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml create mode 100644 core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml create mode 100755 core/res/res/xml-xlarge/password_kbd_qwerty.xml create mode 100755 core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml (limited to 'core') diff --git a/core/java/android/inputmethodservice/Keyboard.java b/core/java/android/inputmethodservice/Keyboard.java index 4814b0a..885a6b8 100755 --- a/core/java/android/inputmethodservice/Keyboard.java +++ b/core/java/android/inputmethodservice/Keyboard.java @@ -500,7 +500,30 @@ public class Keyboard { public Keyboard(Context context, int xmlLayoutResId) { this(context, xmlLayoutResId, 0); } - + + /** + * Creates a keyboard from the given xml key layout file. Weeds out rows + * that have a keyboard mode defined but don't match the specified mode. + * @param context the application or service context + * @param xmlLayoutResId the resource file that contains the keyboard layout and keys. + * @param modeId keyboard mode identifier + * @param width sets width of keyboard + * @param height sets height of keyboard + */ + public Keyboard(Context context, int xmlLayoutResId, int modeId, int width, int height) { + mDisplayWidth = width; + mDisplayHeight = height; + + mDefaultHorizontalGap = 0; + mDefaultWidth = mDisplayWidth / 10; + mDefaultVerticalGap = 0; + mDefaultHeight = mDefaultWidth; + mKeys = new ArrayList(); + mModifierKeys = new ArrayList(); + mKeyboardMode = modeId; + loadKeyboard(context, context.getResources().getXml(xmlLayoutResId)); + } + /** * Creates a keyboard from the given xml key layout file. Weeds out rows * that have a keyboard mode defined but don't match the specified mode. diff --git a/core/java/com/android/internal/widget/PasswordEntryKeyboard.java b/core/java/com/android/internal/widget/PasswordEntryKeyboard.java index e1a6737..facda36 100644 --- a/core/java/com/android/internal/widget/PasswordEntryKeyboard.java +++ b/core/java/com/android/internal/widget/PasswordEntryKeyboard.java @@ -67,8 +67,22 @@ public class PasswordEntryKeyboard extends Keyboard { this(context, xmlLayoutResId, 0); } + public PasswordEntryKeyboard(Context context, int xmlLayoutResId, int width, int height) { + this(context, xmlLayoutResId, 0, width, height); + } + public PasswordEntryKeyboard(Context context, int xmlLayoutResId, int mode) { super(context, xmlLayoutResId, mode); + init(context); + } + + public PasswordEntryKeyboard(Context context, int xmlLayoutResId, int mode, + int width, int height) { + super(context, xmlLayoutResId, mode, width, height); + init(context); + } + + private void init(Context context) { final Resources res = context.getResources(); mRes = res; mShiftIcon = res.getDrawable(R.drawable.sym_keyboard_shift); diff --git a/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java b/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java index 53720e4..384f7bc 100644 --- a/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java +++ b/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java @@ -54,10 +54,20 @@ public class PasswordEntryKeyboardHelper implements OnKeyboardActionListener { private Vibrator mVibrator; public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView) { + this(context, keyboardView, targetView, true); + } + + public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView, + boolean useFullScreenWidth) { mContext = context; mTargetView = targetView; mKeyboardView = keyboardView; - createKeyboards(); + if (useFullScreenWidth || mKeyboardView.getLayoutParams().width == -1) { + createKeyboards(); + } else { + createKeyboardsWithSpecificSize(mKeyboardView.getLayoutParams().width, + mKeyboardView.getLayoutParams().height); + } mKeyboardView.setOnKeyboardActionListener(this); mVibrator = new Vibrator(); } @@ -66,6 +76,29 @@ 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); + mQwertyKeyboard.enableShiftLock(); + + mQwertyKeyboardShifted = new PasswordEntryKeyboard(mContext, + R.xml.password_kbd_qwerty_shifted, + R.id.mode_normal, viewWidth, viewHeight); + mQwertyKeyboardShifted.enableShiftLock(); + mQwertyKeyboardShifted.setShifted(true); // always shifted. + + mSymbolsKeyboard = new PasswordEntryKeyboard(mContext, R.xml.password_kbd_symbols, + viewWidth, viewHeight); + mSymbolsKeyboard.enableShiftLock(); + + mSymbolsKeyboardShifted = new PasswordEntryKeyboard(mContext, + R.xml.password_kbd_symbols_shift, viewWidth, viewHeight); + mSymbolsKeyboardShifted.enableShiftLock(); + mSymbolsKeyboardShifted.setShifted(true); // always shifted + } + private void createKeyboards() { mNumericKeyboard = new PasswordEntryKeyboard(mContext, R.xml.password_kbd_numeric); mQwertyKeyboard = new PasswordEntryKeyboard(mContext, diff --git a/core/res/res/drawable-xlarge/ic_lock_idle_alarm.png b/core/res/res/drawable-xlarge/ic_lock_idle_alarm.png new file mode 100644 index 0000000..336a820 Binary files /dev/null and b/core/res/res/drawable-xlarge/ic_lock_idle_alarm.png differ diff --git a/core/res/res/drawable-xlarge/ic_lock_idle_charging.png b/core/res/res/drawable-xlarge/ic_lock_idle_charging.png new file mode 100644 index 0000000..ebef531 Binary files /dev/null and b/core/res/res/drawable-xlarge/ic_lock_idle_charging.png differ diff --git a/core/res/res/drawable-xlarge/ic_lock_idle_lock.png b/core/res/res/drawable-xlarge/ic_lock_idle_lock.png new file mode 100644 index 0000000..405e218 Binary files /dev/null and b/core/res/res/drawable-xlarge/ic_lock_idle_lock.png differ diff --git a/core/res/res/drawable-xlarge/ic_lock_idle_low_battery.png b/core/res/res/drawable-xlarge/ic_lock_idle_low_battery.png new file mode 100644 index 0000000..f349b63 Binary files /dev/null and b/core/res/res/drawable-xlarge/ic_lock_idle_low_battery.png differ diff --git a/core/res/res/layout-xlarge/keyguard.xml b/core/res/res/layout-xlarge/keyguard.xml new file mode 100644 index 0000000..ca629f8 --- /dev/null +++ b/core/res/res/layout-xlarge/keyguard.xml @@ -0,0 +1,40 @@ + + + + + + + + diff --git a/core/res/res/layout-xlarge/keyguard_screen_glogin_unlock.xml b/core/res/res/layout-xlarge/keyguard_screen_glogin_unlock.xml new file mode 100644 index 0000000..8a46546 --- /dev/null +++ b/core/res/res/layout-xlarge/keyguard_screen_glogin_unlock.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + +