From 4d64bc79bf66635201eeb42daa26b68c11246262 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 29 Apr 2020 22:16:53 +0200 Subject: [PATCH] Not displaying USB TAN procedures anymore (either Android nor JavaFX app supports USB) --- .../dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt | 6 ++++-- .../banking/fints4java/android/ui/dialogs/EnterTanDialog.kt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt b/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt index 40edd3e3..c39518ae 100644 --- a/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt +++ b/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt @@ -31,7 +31,9 @@ open class EnterTanDialog( protected val dialogService = JavaFxDialogService() - protected val selectedTanProcedure = SimpleObjectProperty(account.selectedTanProcedure ?: account.supportedTanProcedures.firstOrNull()) + protected val tanProceduresWithoutUnsupported = account.supportedTanProcedures.filterNot { it.displayName.contains("usb", true) } // USB tan generators are not supported + + protected val selectedTanProcedure = SimpleObjectProperty(account.selectedTanProcedure ?: tanProceduresWithoutUnsupported.firstOrNull { it.displayName.contains("manuell", true) == false } ?: tanProceduresWithoutUnsupported.firstOrNull()) protected val selectedTanMedium = SimpleObjectProperty(account.tanMediaSorted.firstOrNull()) @@ -61,7 +63,7 @@ open class EnterTanDialog( form { fieldset { field(messages["enter.tan.dialog.select.tan.procedure"]) { - combobox(selectedTanProcedure, account.supportedTanProcedures) { + combobox(selectedTanProcedure, tanProceduresWithoutUnsupported) { cellFormat { text = it.displayName } diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/EnterTanDialog.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/EnterTanDialog.kt index 864a32d2..0a405daa 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/EnterTanDialog.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/EnterTanDialog.kt @@ -89,13 +89,15 @@ open class EnterTanDialog : DialogFragment() { protected open fun setupSelectTanProcedureView(rootView: View) { val adapter = TanProceduresAdapter() - adapter.setItems(account.supportedTanProcedures) + val tanProceduresWithoutUnsupported = account.supportedTanProcedures.filterNot { it.displayName.contains("usb", true) } // USB tan generators are not supported on Android + adapter.setItems(tanProceduresWithoutUnsupported) rootView.findViewById(R.id.spnTanProcedures)?.let { spinner -> spinner.adapter = adapter val selectedTanProcedure = account.selectedTanProcedure - ?: account.supportedTanProcedures.firstOrNull() + ?: tanProceduresWithoutUnsupported.filter { it.displayName.contains("manuell") == false && it.displayName.contains("usb") == false }.firstOrNull() + ?: tanProceduresWithoutUnsupported.firstOrNull() selectedTanProcedure?.let { spinner.setSelection(adapter.getItems().indexOf(selectedTanProcedure)) } spinner.onItemSelectedListener = ListItemSelectedListener(adapter) { newSelectedTanProcedure ->