Implemented displaying formatted TAN challenges (that is challenges contains html tags)

This commit is contained in:
dankito 2020-05-24 22:52:01 +02:00
parent e86b17d08b
commit 11adc132aa
3 changed files with 6 additions and 3 deletions

View File

@ -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.model.tan.EnterTanGeneratorAtcResult
import net.dankito.banking.ui.model.tan.TanMedium
import net.dankito.utils.android.extensions.getSpannedFromHtml
open class EnterAtcDialog : DialogFragment() {
@ -49,7 +50,7 @@ open class EnterAtcDialog : DialogFragment() {
protected open fun setupUI(rootView: View) {
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) }

View File

@ -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.tan.*
import net.dankito.banking.ui.presenter.BankingPresenter
import net.dankito.utils.android.extensions.getSpannedFromHtml
import javax.inject.Inject
@ -84,7 +85,7 @@ open class EnterTanDialog : DialogFragment() {
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) }

View File

@ -130,7 +130,8 @@ open class EnterTanDialog(
hbox {
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
}