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)

This commit is contained in:
dankito 2020-05-16 23:41:25 +02:00
parent e7b448126b
commit e9a409f04a
1 changed files with 4 additions and 3 deletions

View File

@ -148,14 +148,15 @@ open class DrawerView(
.withSecondaryIcon(GoogleMaterial.Icon.gmd_delete) .withSecondaryIcon(GoogleMaterial.Icon.gmd_delete)
.withSecondaryIconColor(activity, R.color.primaryTextColor_Dark) .withSecondaryIconColor(activity, R.color.primaryTextColor_Dark)
.withOnSecondaryIconClickedListener { closeDrawerAndEditAccount(account) } .withOnSecondaryIconClickedListener { closeDrawerAndEditAccount(account) }
.withIcon(activity, FontAwesome.Icon.faw_piggy_bank, R.color.primaryTextColor_Dark) .withIcon(account.bank.iconUrl ?: "")
.withSelected(presenter.isSingleSelectedAccount(account)) .withSelected(presenter.isSingleSelectedAccount(account))
.withOnDrawerItemClickListener { _, _, _ -> itemClicked { presenter.selectedAccount(account) } } .withOnDrawerItemClickListener { _, _, _ -> itemClicked { presenter.selectedAccount(account) } }
account.bank.iconUrl?.let { bankIconUrl -> if (account.bank.iconUrl == null) {
accountItem.withIcon(bankIconUrl) accountItem.withIcon(activity, FontAwesome.Icon.faw_piggy_bank, R.color.primaryTextColor_Dark)
} }
return accountItem return accountItem
} }