From 0b6e239532fb261f6b9eb26c2ca8c85b07656a51 Mon Sep 17 00:00:00 2001 From: Danilo Ercoli Date: Mon, 2 May 2016 12:43:53 +0200 Subject: [PATCH 1/4] Set the input content type of TYPE_NULL on the pin_field. This is the only way I know to completely hide a soft keyboard, even when the user force the focus on it by tapping the field. --- .../passcodelock/AbstractPasscodeKeyboardActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java b/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java index 1695335..934f5a1 100644 --- a/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java +++ b/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java @@ -6,6 +6,7 @@ import android.support.v4.hardware.fingerprint.FingerprintManagerCompat; import android.support.v4.os.CancellationSignal; import android.text.InputFilter; +import android.text.InputType; import android.text.Spanned; import android.view.Gravity; import android.view.View; @@ -51,6 +52,7 @@ protected void onCreate(Bundle savedInstanceState) { filters[1] = onlyNumber; mPinCodeField = (EditText)findViewById(R.id.pin_field); + mPinCodeField.setInputType(InputType.TYPE_NULL); //setup the keyboard findViewById(R.id.button0).setOnClickListener(defaultButtonListener); From 5f373236a1cbce70c5bda65bdd963297bd196773 Mon Sep 17 00:00:00 2001 From: Danilo Ercoli Date: Thu, 19 May 2016 16:10:26 +0200 Subject: [PATCH 2/4] Revert "Set the input content type of TYPE_NULL on the pin_field. This is the only way I know to completely hide a soft keyboard, even when the user force the focus on it by tapping the field." This reverts commit 0b6e239532fb261f6b9eb26c2ca8c85b07656a51. --- .../passcodelock/AbstractPasscodeKeyboardActivity.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java b/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java index 934f5a1..1695335 100644 --- a/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java +++ b/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java @@ -6,7 +6,6 @@ import android.support.v4.hardware.fingerprint.FingerprintManagerCompat; import android.support.v4.os.CancellationSignal; import android.text.InputFilter; -import android.text.InputType; import android.text.Spanned; import android.view.Gravity; import android.view.View; @@ -52,7 +51,6 @@ protected void onCreate(Bundle savedInstanceState) { filters[1] = onlyNumber; mPinCodeField = (EditText)findViewById(R.id.pin_field); - mPinCodeField.setInputType(InputType.TYPE_NULL); //setup the keyboard findViewById(R.id.button0).setOnClickListener(defaultButtonListener); From edb3fe1b9a89f8998f9e61e0a597abae079e229e Mon Sep 17 00:00:00 2001 From: Danilo Ercoli Date: Thu, 19 May 2016 16:21:56 +0200 Subject: [PATCH 3/4] Revert "Revert "Set the input content type of TYPE_NULL on the pin_field. This is the only way I know to completely hide a soft keyboard, even when the user force the focus on it by tapping the field."" This reverts commit 5f373236a1cbce70c5bda65bdd963297bd196773. --- .../passcodelock/AbstractPasscodeKeyboardActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java b/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java index 1695335..934f5a1 100644 --- a/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java +++ b/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java @@ -6,6 +6,7 @@ import android.support.v4.hardware.fingerprint.FingerprintManagerCompat; import android.support.v4.os.CancellationSignal; import android.text.InputFilter; +import android.text.InputType; import android.text.Spanned; import android.view.Gravity; import android.view.View; @@ -51,6 +52,7 @@ protected void onCreate(Bundle savedInstanceState) { filters[1] = onlyNumber; mPinCodeField = (EditText)findViewById(R.id.pin_field); + mPinCodeField.setInputType(InputType.TYPE_NULL); //setup the keyboard findViewById(R.id.button0).setOnClickListener(defaultButtonListener); From c5cb0f56f074bf2d087ab70e81ff5d03f5314e68 Mon Sep 17 00:00:00 2001 From: Danilo Ercoli Date: Thu, 19 May 2016 16:47:09 +0200 Subject: [PATCH 4/4] Do not use `InputType.TYPE_NULL`, instead set the password field as non focusable, non clickable. Props @tonyr59h --- library/res/layout/app_passcode_keyboard.xml | 2 ++ .../passcodelock/AbstractPasscodeKeyboardActivity.java | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/res/layout/app_passcode_keyboard.xml b/library/res/layout/app_passcode_keyboard.xml index 333f741..dd957c3 100644 --- a/library/res/layout/app_passcode_keyboard.xml +++ b/library/res/layout/app_passcode_keyboard.xml @@ -48,6 +48,8 @@ android:layout_height="wrap_content" android:layout_marginRight="38dp" android:hint="@string/passcodelock_hint" + android:focusable="false" + android:clickable="false" android:maxLength="4" android:inputType="numberPassword" android:background="@color/white" /> diff --git a/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java b/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java index 934f5a1..ffc2137 100644 --- a/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java +++ b/library/src/org/wordpress/passcodelock/AbstractPasscodeKeyboardActivity.java @@ -6,7 +6,6 @@ import android.support.v4.hardware.fingerprint.FingerprintManagerCompat; import android.support.v4.os.CancellationSignal; import android.text.InputFilter; -import android.text.InputType; import android.text.Spanned; import android.view.Gravity; import android.view.View; @@ -52,8 +51,7 @@ protected void onCreate(Bundle savedInstanceState) { filters[1] = onlyNumber; mPinCodeField = (EditText)findViewById(R.id.pin_field); - mPinCodeField.setInputType(InputType.TYPE_NULL); - + //setup the keyboard findViewById(R.id.button0).setOnClickListener(defaultButtonListener); findViewById(R.id.button1).setOnClickListener(defaultButtonListener);