Fixed that for non optical TAN procedures entering TAN options haven't been set

This commit is contained in:
dankito 2020-09-10 16:10:24 +02:00
parent bb0a2f9713
commit 2b0a1e9e14
1 changed files with 17 additions and 18 deletions

View File

@ -86,11 +86,9 @@ open class EnterTanDialog : DialogFragment() {
setupTanView(rootView)
rootView.txtvwCollapsibleText.text = tanChallenge.messageToShowToUser.getSpannedFromHtml()
setupEnteringTan(rootView)
if (tanChallenge.tanProcedure.allowedTanFormat == AllowedTanFormat.Numeric) {
rootView.edtxtEnteredTan.inputType = InputType.TYPE_CLASS_NUMBER
}
rootView.txtvwCollapsibleText.text = tanChallenge.messageToShowToUser.getSpannedFromHtml()
rootView.btnCancel.setOnClickListener { enteringTanDone(null) }
@ -156,23 +154,24 @@ open class EnterTanDialog : DialogFragment() {
else if (tanChallenge is ImageTanChallenge) {
setupImageTanView(rootView)
}
}
}
protected open fun setupEnteringTan(rootView: View) {
if (tanChallenge.tanProcedure.isNumericTan) {
rootView.edtxtEnteredTan.inputType = InputType.TYPE_CLASS_NUMBER
}
if (tanChallenge.tanProcedure.isNumericTan) {
rootView.edtxtEnteredTan.inputType = InputType.TYPE_CLASS_NUMBER
}
tanChallenge.tanProcedure.maxTanInputLength?.let { maxInputLength ->
rootView.edtxtEnteredTan.filters = arrayOf<InputFilter>(InputFilter.LengthFilter(maxInputLength))
}
rootView.edtxtEnteredTan.setOnKeyListener { _, keyCode, _ ->
if (keyCode == KeyEvent.KEYCODE_ENTER) {
enteringTanDone(rootView.edtxtEnteredTan.text.toString())
return@setOnKeyListener true
}
false
tanChallenge.tanProcedure.maxTanInputLength?.let { maxInputLength ->
rootView.edtxtEnteredTan.filters = arrayOf<InputFilter>(InputFilter.LengthFilter(maxInputLength))
}
rootView.edtxtEnteredTan.setOnKeyListener { _, keyCode, _ ->
if (keyCode == KeyEvent.KEYCODE_ENTER) {
enteringTanDone(rootView.edtxtEnteredTan.text.toString())
return@setOnKeyListener true
}
false
}
}