From e9a409f04a35378960dff6b7b78f0a0d204b021f Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 16 May 2020 23:41:25 +0200 Subject: [PATCH] Fixed that by default bank's icon url gets set and only if there's no icon for bank available default icon gets used (fixes bug that if bank item is selected default icon got displayed) --- .../banking/fints4java/android/ui/views/DrawerView.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/DrawerView.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/DrawerView.kt index 6b85229c..4069a75f 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/DrawerView.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/DrawerView.kt @@ -148,14 +148,15 @@ open class DrawerView( .withSecondaryIcon(GoogleMaterial.Icon.gmd_delete) .withSecondaryIconColor(activity, R.color.primaryTextColor_Dark) .withOnSecondaryIconClickedListener { closeDrawerAndEditAccount(account) } - .withIcon(activity, FontAwesome.Icon.faw_piggy_bank, R.color.primaryTextColor_Dark) + .withIcon(account.bank.iconUrl ?: "") .withSelected(presenter.isSingleSelectedAccount(account)) .withOnDrawerItemClickListener { _, _, _ -> itemClicked { presenter.selectedAccount(account) } } - account.bank.iconUrl?.let { bankIconUrl -> - accountItem.withIcon(bankIconUrl) + if (account.bank.iconUrl == null) { + accountItem.withIcon(activity, FontAwesome.Icon.faw_piggy_bank, R.color.primaryTextColor_Dark) } + return accountItem }