diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/util/BankIconFinder.kt b/BankingUiCommon/src/main/java/net/dankito/banking/util/BankIconFinder.kt index 23506015..40335852 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/util/BankIconFinder.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/util/BankIconFinder.kt @@ -36,11 +36,15 @@ open class BankIconFinder : IBankIconFinder { protected val faviconComparator = FaviconComparator(webClient) - override fun findIconForBank(bankName: String): String? { + override fun findIconForBank(bankName: String, prefSize: Int): String? { findBankWebsite(bankName)?.let { bankUrl -> webClient.get(bankUrl).body?.let { bankHomepageResponse -> val favicons = faviconFinder.extractFavicons(Jsoup.parse(bankHomepageResponse), bankUrl) + faviconComparator.getBestIcon(favicons, prefSize, prefSize + 32, true)?.let { prefFavicon -> + return prefFavicon.url + } + return faviconComparator.getBestIcon(favicons, 16)?.url } } diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/util/IBankIconFinder.kt b/BankingUiCommon/src/main/java/net/dankito/banking/util/IBankIconFinder.kt index aaa98fe8..4cae55f8 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/util/IBankIconFinder.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/util/IBankIconFinder.kt @@ -3,7 +3,7 @@ package net.dankito.banking.util interface IBankIconFinder { - fun findIconForBank(bankName: String): String? + fun findIconForBank(bankName: String, prefSize: Int = 72): String? fun findBankWebsite(bankName: String): String?