From e78e0e93f92f954b5c47847b29f02f28223d6f07 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 22 Sep 2020 00:36:35 +0200 Subject: [PATCH] Added button to add account if no accounts have been added yet --- .../banking/ui/android/home/HomeFragment.kt | 2 ++ .../banking/ui/android/views/DrawerView.kt | 2 +- .../src/main/res/layout/fragment_home.xml | 15 +++++++++++++++ .../src/main/res/values-de/strings.xml | 3 ++- .../src/main/res/values/dimens.xml | 1 + .../src/main/res/values/strings.xml | 3 ++- 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/home/HomeFragment.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/home/HomeFragment.kt index 30cc59fd..f8ee61dc 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/home/HomeFragment.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/home/HomeFragment.kt @@ -95,6 +95,7 @@ class HomeFragment : Fragment() { } rootView.btnRetrieveTransactions.setOnClickListener { fetchTransactions() } + rootView.btnAddAccount.setOnClickListener { presenter.showAddAccountDialog() } return rootView } @@ -262,6 +263,7 @@ class HomeFragment : Fragment() { rcyvwAccountTransactions.visibility = if (haveTransactionsBeenRetrieved) View.VISIBLE else View.GONE lytNoTransactionsFetched.visibility = if (haveTransactionsBeenRetrieved || noAccountsAddedYet) View.GONE else View.VISIBLE btnRetrieveTransactions.visibility = if (transactionsRetrievalState == TransactionsRetrievalState.AccountDoesNotSupportFetchingTransactions) View.GONE else View.VISIBLE + btnAddAccount.visibility = if (noAccountsAddedYet) View.VISIBLE else View.GONE val transactionsRetrievalStateMessageId = when (transactionsRetrievalState) { TransactionsRetrievalState.AccountDoesNotSupportFetchingTransactions -> R.string.fragment_home_transactions_retrieval_state_account_does_not_support_retrieving_transactions diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/DrawerView.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/DrawerView.kt index 0a7e04e3..0a547575 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/DrawerView.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/DrawerView.kt @@ -90,7 +90,7 @@ open class DrawerView( , PrimaryDrawerItem() - .withName(R.string.drawer_menu_add_bank_account_title) + .withName(R.string.add_account) .withIdentifier(AddAccountId) .withLevel(AccountLevel) .withIcon(activity, GoogleMaterial.Icon.gmd_add, R.color.primaryTextColor_Dark) diff --git a/ui/BankingAndroidApp/src/main/res/layout/fragment_home.xml b/ui/BankingAndroidApp/src/main/res/layout/fragment_home.xml index 72a9af38..1c03edbf 100644 --- a/ui/BankingAndroidApp/src/main/res/layout/fragment_home.xml +++ b/ui/BankingAndroidApp/src/main/res/layout/fragment_home.xml @@ -100,6 +100,21 @@ +