From 85acd02c36d571e9b49d49c292fa600f8505bd91 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 17 Oct 2020 02:20:28 +0200 Subject: [PATCH] Added add account button to bank credentials section --- .../ui/android/dialogs/settings/SettingsDialog.kt | 6 +++++- .../src/main/res/layout/dialog_settings.xml | 15 ++++++++++++++- .../src/main/res/values-de/strings.xml | 1 + .../src/main/res/values/dimens.xml | 3 +++ .../src/main/res/values/strings.xml | 1 + 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/SettingsDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/SettingsDialog.kt index 647ede55..946cfeb8 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/SettingsDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/SettingsDialog.kt @@ -52,6 +52,8 @@ open class SettingsDialog : SettingsDialogBase() { banksAdapter.onClickListener = { navigationToBankSettingsDialog(it.bank) } banksAdapter.itemDropped = { oldPosition, oldItem, newPosition, newItem -> reorderedBanks(oldPosition, oldItem.bank, newPosition, newItem.bank) } + btnAddAccount.setOnClickListener { presenter.showAddAccountDialog() } + selectUpdateAccountsAfter.periodInMinutes = presenter.appSettings.automaticallyUpdateAccountsAfterMinutes btnSetAppProtection.setOnClickListener { navigateToProtectAppSettingsDialog() } @@ -77,7 +79,9 @@ open class SettingsDialog : SettingsDialogBase() { } protected open fun updateBanksAdapterItems() { - banksAdapter.setItems(createBanksAdapterItems()) + activity?.runOnUiThread { + banksAdapter.setItems(createBanksAdapterItems()) + } } diff --git a/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml b/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml index 3447c3f4..c8330b86 100644 --- a/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml +++ b/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml @@ -38,7 +38,7 @@ @@ -54,6 +54,19 @@ android:layout_height="wrap_content" /> +