From d20183e36ff8eea85620de809dd627feb81507c3 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Thu, 21 Feb 2019 10:27:15 -0600 Subject: [PATCH] Forced to focus the EditText field and show the keyboard in the PINSecurityLockDialog as soon as it opens. --- .../bitsybitshareswallet/fragments/PINSecurityLockDialog.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PINSecurityLockDialog.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PINSecurityLockDialog.kt index fb27195..5e834b6 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PINSecurityLockDialog.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PINSecurityLockDialog.kt @@ -5,6 +5,7 @@ import android.preference.PreferenceManager import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.view.WindowManager import android.view.inputmethod.EditorInfo import com.jakewharton.rxbinding3.widget.textChanges import cy.agorise.bitsybitshareswallet.R @@ -33,6 +34,10 @@ class PINSecurityLockDialog : BaseSecurityLockDialog() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + // Request focus to the PIN EditText and automatically show the keyboard when the dialog appears. + tietPIN.requestFocus() + dialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) + setupScreen() // Listens to the event when the user clicks the 'Enter' button in the keyboard and acts accordingly