Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c26c9db authored by Tony Mak's avatar Tony Mak
Browse files

Remove KeyboardView in ChooseLockPassword

1. We actually use user installed keyboard
2. Request focus on the edittext instead of the keyboard

Bug: 24900754

Change-Id: I6257a592ad34875d46c5c05349098b891ef37d98
parent 0bbcdccd
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -89,21 +89,6 @@
                    android:text="@string/lockpassword_continue_label" />
            </LinearLayout>
        </LinearLayout>

        <!-- Spacer between password entry and keyboard -->
        <View
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="1"/>

        <!-- Alphanumeric keyboard -->
        <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#00000000"
            android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
            android:visibility="gone"/>

    </LinearLayout>

</com.android.setupwizardlib.GlifLayout>
+2 −15
Original line number Diff line number Diff line
@@ -150,10 +150,6 @@ public class ChooseLockPassword extends SettingsActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO: Fix on phones
        // Disable IME on our window since we provide our own keyboard
        //getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
                //WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
        super.onCreate(savedInstanceState);
        CharSequence msg = getText(R.string.lockpassword_choose_your_password_header);
        setTitle(msg);
@@ -200,8 +196,6 @@ public class ChooseLockPassword extends SettingsActivity {
        private TextView mHeaderText;
        private String mFirstPin;
        private RecyclerView mPasswordRestrictionView;
        private KeyboardView mKeyboardView;
        private PasswordEntryKeyboardHelper mKeyboardHelper;
        private boolean mIsAlphaMode;
        private Button mCancelButton;
        private Button mNextButton;
@@ -313,22 +307,15 @@ public class ChooseLockPassword extends SettingsActivity {

            setupPasswordRequirementsView(view);

            mKeyboardView = (PasswordEntryKeyboardView) view.findViewById(R.id.keyboard);
            mPasswordRestrictionView.setLayoutManager(new LinearLayoutManager(getActivity()));
            mPasswordEntry = (EditText) view.findViewById(R.id.password_entry);
            mPasswordEntry.setOnEditorActionListener(this);
            mPasswordEntry.addTextChangedListener(this);
            mPasswordEntry.requestFocus();
            mPasswordEntryInputDisabler = new TextViewInputDisabler(mPasswordEntry);

            final Activity activity = getActivity();
            mKeyboardHelper = new PasswordEntryKeyboardHelper(activity,
                    mKeyboardView, mPasswordEntry);
            mKeyboardHelper.setKeyboardMode(mIsAlphaMode ?
                    PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA
                    : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);

            mHeaderText = (TextView) view.findViewById(R.id.headerText);
            mKeyboardView.requestFocus();

            int currentType = mPasswordEntry.getInputType();
            mPasswordEntry.setInputType(mIsAlphaMode ? currentType
@@ -454,7 +441,7 @@ public class ChooseLockPassword extends SettingsActivity {
            if (mSaveAndFinishWorker != null) {
                mSaveAndFinishWorker.setListener(this);
            } else {
                mKeyboardView.requestFocus();
                mPasswordEntry.requestFocus();
            }
        }