diff options
author | Jim Miller <jaggies@google.com> | 2011-11-02 18:32:16 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2011-11-04 17:26:26 -0700 |
commit | d9d09451ccec7c551d5f9c2f1417c9c1de2952a6 (patch) | |
tree | 7f6e5d23f6ab4528a70b9bb7e01b82e0cf65b287 /policy | |
parent | c37f98eab3d6e63f71b1600ea0e4355c6503384b (diff) | |
download | frameworks_base-d9d09451ccec7c551d5f9c2f1417c9c1de2952a6.zip frameworks_base-d9d09451ccec7c551d5f9c2f1417c9c1de2952a6.tar.gz frameworks_base-d9d09451ccec7c551d5f9c2f1417c9c1de2952a6.tar.bz2 |
Fix 5231823: PIN/Password polish on lock screen
Fixes these issues:
- add IME button to switch IMEs on password screen on tablet
- centers '0' on PIN screen for phones and tablets
- tablets now use the same ICS background key asset as phones
- make PIN layout consistent between phones and tablet
- center the I-beam when any button is showing in the password entry field
Change-Id: I4da0173f9b2efeab46617c5a41a8132895b63a97
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java index 3ad716b..06cd69e 100644 --- a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java +++ b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java @@ -35,15 +35,18 @@ import android.text.InputType; import android.text.TextWatcher; import android.text.method.DigitsKeyListener; import android.text.method.TextKeyListener; +import android.view.Gravity; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup.LayoutParams; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodSubtype; import android.widget.EditText; import android.widget.LinearLayout; +import android.widget.Space; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; @@ -114,6 +117,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED, 0) != 0); + boolean imeOrDeleteButtonVisible = false; if (mIsAlpha) { // We always use the system IME for alpha keyboard, so hide lockscreen's soft keyboard mKeyboardHelper.setKeyboardMode(PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA); @@ -129,6 +133,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen View pinDelete = findViewById(R.id.pinDel); if (pinDelete != null) { pinDelete.setVisibility(View.VISIBLE); + imeOrDeleteButtonVisible = true; pinDelete.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -181,6 +186,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen Context.INPUT_METHOD_SERVICE); if (mIsAlpha && switchImeButton != null && hasMultipleEnabledIMEsOrSubtypes(imm, false)) { switchImeButton.setVisibility(View.VISIBLE); + imeOrDeleteButtonVisible = true; switchImeButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { mCallback.pokeWakelock(); // Leave the screen on a bit longer @@ -188,6 +194,16 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen } }); } + + // If no icon is visible, reset the left margin on the password field so the text is + // still centered. + if (!imeOrDeleteButtonVisible) { + android.view.ViewGroup.LayoutParams params = mPasswordEntry.getLayoutParams(); + if (params instanceof MarginLayoutParams) { + ((MarginLayoutParams)params).leftMargin = 0; + mPasswordEntry.setLayoutParams(params); + } + } } /** |