Forced to focus the EditText field and show the keyboard in the PINSecurityLockDialog as soon as it opens.

This commit is contained in:
Severiano Jaramillo 2019-02-21 10:27:15 -06:00
parent 2a869d7fe8
commit d20183e36f

View file

@ -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