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 ddd153ab..13e057e5 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 @@ -3,6 +3,7 @@ package net.dankito.banking.ui.android.dialogs.settings import android.os.Bundle import android.view.* import androidx.appcompat.app.AppCompatActivity +import kotlinx.android.synthetic.main.dialog_settings.* import kotlinx.android.synthetic.main.dialog_settings.view.* import net.dankito.banking.ui.android.R import net.dankito.banking.ui.android.adapter.BankDataAdapterItem @@ -42,7 +43,7 @@ open class SettingsDialog : SettingsDialogBase() { protected open fun setupUI(rootView: View) { rootView.apply { toolbar.apply { - setupToolbar(this, rootView.context.getString(R.string.settings), false) + setupToolbar(this, rootView.context.getString(R.string.settings)) } val items = createBanksAdapterItems() @@ -50,6 +51,8 @@ open class SettingsDialog : SettingsDialogBase() { banksAdapter.onClickListener = { navigationToBankSettingsDialog(it.bank) } banksAdapter.itemDropped = { oldPosition, oldItem, newPosition, newItem -> reorderedBanks(oldPosition, oldItem.bank, newPosition, newItem.bank) } + swtchUpdateAccountsAutomatically.isChecked = presenter.appSettings.updateAccountsAutomatically + btnSetAppProtection.setOnClickListener { ProtectAppSettingsDialog().show(requireActivity() as AppCompatActivity) } btnShowSendMessageLogDialog.setOnClickListener { presenter.showSendMessageLogDialog() } @@ -87,10 +90,11 @@ open class SettingsDialog : SettingsDialogBase() { override val hasUnsavedChanges: Boolean - get() = false + get() = presenter.appSettings.updateAccountsAutomatically != swtchUpdateAccountsAutomatically.isChecked override fun saveChanges() { - + presenter.appSettings.updateAccountsAutomatically = swtchUpdateAccountsAutomatically.isChecked + presenter.appSettingsChanged() } } \ No newline at end of file diff --git a/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml b/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml index a9efa249..526e424b 100644 --- a/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml +++ b/ui/BankingAndroidApp/src/main/res/layout/dialog_settings.xml @@ -57,6 +57,28 @@ + + + + + + + + +