Implemented displaying formatted TAN challenges (that is challenges contains html tags)
This commit is contained in:
parent
e86b17d08b
commit
11adc132aa
|
@ -12,6 +12,7 @@ import kotlinx.android.synthetic.main.dialog_enter_atc.view.*
|
||||||
import net.dankito.banking.ui.android.R
|
import net.dankito.banking.ui.android.R
|
||||||
import net.dankito.banking.ui.model.tan.EnterTanGeneratorAtcResult
|
import net.dankito.banking.ui.model.tan.EnterTanGeneratorAtcResult
|
||||||
import net.dankito.banking.ui.model.tan.TanMedium
|
import net.dankito.banking.ui.model.tan.TanMedium
|
||||||
|
import net.dankito.utils.android.extensions.getSpannedFromHtml
|
||||||
|
|
||||||
|
|
||||||
open class EnterAtcDialog : DialogFragment() {
|
open class EnterAtcDialog : DialogFragment() {
|
||||||
|
@ -49,7 +50,7 @@ open class EnterAtcDialog : DialogFragment() {
|
||||||
|
|
||||||
protected open fun setupUI(rootView: View) {
|
protected open fun setupUI(rootView: View) {
|
||||||
val explanationHtml = rootView.context.getString(R.string.dialog_enter_atc_explanation, tanMedium.displayName)
|
val explanationHtml = rootView.context.getString(R.string.dialog_enter_atc_explanation, tanMedium.displayName)
|
||||||
rootView.txtAtcExplanationToShowToUser.text = Html.fromHtml(explanationHtml, Html.FROM_HTML_MODE_LEGACY)
|
rootView.txtAtcExplanationToShowToUser.text = explanationHtml.getSpannedFromHtml()
|
||||||
|
|
||||||
rootView.btnCancel.setOnClickListener { enteringAtcDone(null, null) }
|
rootView.btnCancel.setOnClickListener { enteringAtcDone(null, null) }
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import net.dankito.banking.ui.model.Account
|
||||||
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
||||||
import net.dankito.banking.ui.model.tan.*
|
import net.dankito.banking.ui.model.tan.*
|
||||||
import net.dankito.banking.ui.presenter.BankingPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
|
import net.dankito.utils.android.extensions.getSpannedFromHtml
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,7 +85,7 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
|
|
||||||
setupTanView(rootView)
|
setupTanView(rootView)
|
||||||
|
|
||||||
rootView.txtTanDescriptionToShowToUser.text = getString(R.string.dialog_enter_tan_hint_from_bank, tanChallenge.messageToShowToUser)
|
rootView.txtTanDescriptionToShowToUser.text = getString(R.string.dialog_enter_tan_hint_from_bank, tanChallenge.messageToShowToUser.getSpannedFromHtml())
|
||||||
|
|
||||||
rootView.btnCancel.setOnClickListener { enteringTanDone(null) }
|
rootView.btnCancel.setOnClickListener { enteringTanDone(null) }
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,8 @@ open class EnterTanDialog(
|
||||||
hbox {
|
hbox {
|
||||||
maxWidth = 400.0
|
maxWidth = 400.0
|
||||||
|
|
||||||
label(String.format(messages["enter.tan.dialog.hint.from.bank"], challenge.messageToShowToUser)) {
|
// TODO: also display rich text like <b>, not only new lines
|
||||||
|
label(String.format(messages["enter.tan.dialog.hint.from.bank"], challenge.messageToShowToUser.htmlToPlainText())) {
|
||||||
isWrapText = true
|
isWrapText = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue