From 0200a274a9c34584e9a39a087e742640e336b4f1 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 16 Nov 2020 22:23:59 +0100 Subject: [PATCH] Extracted getFormattedMessageLogForAccounts() --- .../banking/ui/android/dialogs/SendMessageLogDialog.kt | 2 +- .../net/dankito/banking/ui/presenter/BankingPresenter.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/SendMessageLogDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/SendMessageLogDialog.kt index b5556125..8a3c1598 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/SendMessageLogDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/SendMessageLogDialog.kt @@ -53,7 +53,7 @@ open class SendMessageLogDialog : DialogFragment() { } protected open fun setupUI(rootView: View) { - val messageLog = presenter.getMessageLogForAccounts(presenter.allBanksSortedByDisplayIndex).joinToString("\r\n\r\n") + val messageLog = presenter.getFormattedMessageLogForAccounts(presenter.allBanksSortedByDisplayIndex) if (messageLog.isBlank()) { rootView.txtvwInfoNoMessageLogEntriesYet.show() diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt index cbeca2f9..2291574e 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -782,6 +782,10 @@ open class BankingPresenter( } + open fun getFormattedMessageLogForAccounts(banks: List, includeFailedAccountAdditions: Boolean = true): String { + return getMessageLogForAccounts(banks, includeFailedAccountAdditions).joinToString("\r\n\r\n") + } + open fun getMessageLogForAccounts(banks: List, includeFailedAccountAdditions: Boolean = true): List { val logEntries = mutableListOf()