Renamed MainWindowPresenter to BankingPresenter
This commit is contained in:
parent
beb2dca2a9
commit
f1494d485a
|
@ -7,7 +7,7 @@ import net.dankito.banking.ui.javafx.RouterJavaFx
|
||||||
import net.dankito.banking.ui.javafx.controls.AccountTransactionsView
|
import net.dankito.banking.ui.javafx.controls.AccountTransactionsView
|
||||||
import net.dankito.banking.ui.javafx.controls.AccountsView
|
import net.dankito.banking.ui.javafx.controls.AccountsView
|
||||||
import net.dankito.banking.ui.javafx.dialogs.mainwindow.controls.MainMenuBar
|
import net.dankito.banking.ui.javafx.dialogs.mainwindow.controls.MainMenuBar
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
import tornadofx.FX.Companion.messages
|
import tornadofx.FX.Companion.messages
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
@ -18,7 +18,7 @@ class MainWindow : View(messages["application.title"]) {
|
||||||
private val dataFolder = File("data", "accounts")
|
private val dataFolder = File("data", "accounts")
|
||||||
|
|
||||||
// private val presenter = MainWindowPresenter(fints4javaBankingClientCreator(OkHttpWebClient(), Base64ServiceJava8()), dataFolder, BankingPersistenceJson(File(dataFolder, "accounts.json")), RouterJavaFx())
|
// private val presenter = MainWindowPresenter(fints4javaBankingClientCreator(OkHttpWebClient(), Base64ServiceJava8()), dataFolder, BankingPersistenceJson(File(dataFolder, "accounts.json")), RouterJavaFx())
|
||||||
private val presenter = MainWindowPresenter(hbci4jBankingClientCreator(), dataFolder, BankingPersistenceJson(File(dataFolder, "accounts.json")), RouterJavaFx())
|
private val presenter = BankingPresenter(hbci4jBankingClientCreator(), dataFolder, BankingPersistenceJson(File(dataFolder, "accounts.json")), RouterJavaFx())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ import javafx.beans.property.SimpleBooleanProperty
|
||||||
import javafx.scene.input.KeyCode
|
import javafx.scene.input.KeyCode
|
||||||
import javafx.scene.input.KeyCodeCombination
|
import javafx.scene.input.KeyCodeCombination
|
||||||
import javafx.scene.input.KeyCombination
|
import javafx.scene.input.KeyCombination
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.utils.javafx.ui.extensions.fixedHeight
|
import net.dankito.utils.javafx.ui.extensions.fixedHeight
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
|
|
||||||
|
|
||||||
open class MainMenuBar(protected val presenter: MainWindowPresenter) : View() {
|
open class MainMenuBar(protected val presenter: BankingPresenter) : View() {
|
||||||
|
|
||||||
protected val areAccountsThatCanTransferMoneyAdded = SimpleBooleanProperty()
|
protected val areAccountsThatCanTransferMoneyAdded = SimpleBooleanProperty()
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import net.dankito.banking.ui.model.tan.EnterTanGeneratorAtcResult
|
||||||
import net.dankito.banking.ui.model.tan.EnterTanResult
|
import net.dankito.banking.ui.model.tan.EnterTanResult
|
||||||
import net.dankito.banking.ui.model.tan.TanChallenge
|
import net.dankito.banking.ui.model.tan.TanChallenge
|
||||||
import net.dankito.banking.ui.model.tan.TanGeneratorTanMedium
|
import net.dankito.banking.ui.model.tan.TanGeneratorTanMedium
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import tornadofx.FX
|
import tornadofx.FX
|
||||||
import tornadofx.FX.Companion.messages
|
import tornadofx.FX.Companion.messages
|
||||||
import tornadofx.get
|
import tornadofx.get
|
||||||
|
@ -21,11 +21,11 @@ import java.util.concurrent.atomic.AtomicReference
|
||||||
|
|
||||||
open class RouterJavaFx : IRouter {
|
open class RouterJavaFx : IRouter {
|
||||||
|
|
||||||
override fun showAddAccountDialog(presenter: MainWindowPresenter) {
|
override fun showAddAccountDialog(presenter: BankingPresenter) {
|
||||||
AddAccountDialog(presenter).show(messages["add.account.dialog.title"])
|
AddAccountDialog(presenter).show(messages["add.account.dialog.title"])
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTanFromUserFromNonUiThread(account: Account, tanChallenge: TanChallenge, presenter: MainWindowPresenter): EnterTanResult {
|
override fun getTanFromUserFromNonUiThread(account: Account, tanChallenge: TanChallenge, presenter: BankingPresenter): EnterTanResult {
|
||||||
val enteredTan = AtomicReference<EnterTanResult>(null)
|
val enteredTan = AtomicReference<EnterTanResult>(null)
|
||||||
val tanEnteredLatch = CountDownLatch(1)
|
val tanEnteredLatch = CountDownLatch(1)
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ open class RouterJavaFx : IRouter {
|
||||||
return EnterTanGeneratorAtcResult.userDidNotEnterTan()
|
return EnterTanGeneratorAtcResult.userDidNotEnterTan()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showTransferMoneyDialog(presenter: MainWindowPresenter, preselectedBankAccount: BankAccount?, preselectedValues: TransferMoneyData?) {
|
override fun showTransferMoneyDialog(presenter: BankingPresenter, preselectedBankAccount: BankAccount?, preselectedValues: TransferMoneyData?) {
|
||||||
TransferMoneyDialog(presenter, preselectedBankAccount, preselectedValues).show(messages["transfer.money.dialog.title"])
|
TransferMoneyDialog(presenter, preselectedBankAccount, preselectedValues).show(messages["transfer.money.dialog.title"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import javafx.beans.property.SimpleBooleanProperty
|
||||||
import javafx.beans.property.SimpleStringProperty
|
import javafx.beans.property.SimpleStringProperty
|
||||||
import javafx.geometry.Insets
|
import javafx.geometry.Insets
|
||||||
import javafx.geometry.Pos
|
import javafx.geometry.Pos
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.utils.javafx.ui.controls.UpdateButton
|
import net.dankito.utils.javafx.ui.controls.UpdateButton
|
||||||
import net.dankito.utils.javafx.ui.controls.addButton
|
import net.dankito.utils.javafx.ui.controls.addButton
|
||||||
import net.dankito.utils.javafx.ui.controls.searchtextfield
|
import net.dankito.utils.javafx.ui.controls.searchtextfield
|
||||||
|
@ -14,7 +14,7 @@ import tornadofx.*
|
||||||
|
|
||||||
|
|
||||||
open class AccountTransactionsControlView(
|
open class AccountTransactionsControlView(
|
||||||
protected val presenter: MainWindowPresenter,
|
protected val presenter: BankingPresenter,
|
||||||
protected val transactionsFilter: SimpleStringProperty,
|
protected val transactionsFilter: SimpleStringProperty,
|
||||||
protected val balance: SimpleStringProperty
|
protected val balance: SimpleStringProperty
|
||||||
) : View() {
|
) : View() {
|
||||||
|
|
|
@ -6,14 +6,13 @@ import javafx.collections.ObservableList
|
||||||
import javafx.geometry.Insets
|
import javafx.geometry.Insets
|
||||||
import javafx.geometry.Pos
|
import javafx.geometry.Pos
|
||||||
import javafx.scene.control.ContentDisplay
|
import javafx.scene.control.ContentDisplay
|
||||||
import javafx.scene.control.ContextMenu
|
|
||||||
import javafx.scene.control.TableColumn
|
import javafx.scene.control.TableColumn
|
||||||
import javafx.scene.control.TableView
|
import javafx.scene.control.TableView
|
||||||
import javafx.scene.layout.Priority
|
import javafx.scene.layout.Priority
|
||||||
import javafx.scene.paint.Color
|
import javafx.scene.paint.Color
|
||||||
import javafx.util.Callback
|
import javafx.util.Callback
|
||||||
import net.dankito.banking.ui.model.AccountTransaction
|
import net.dankito.banking.ui.model.AccountTransaction
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.utils.javafx.ui.extensions.ensureOnlyUsesSpaceIfVisible
|
import net.dankito.utils.javafx.ui.extensions.ensureOnlyUsesSpaceIfVisible
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
import tornadofx.FX.Companion.messages
|
import tornadofx.FX.Companion.messages
|
||||||
|
@ -21,7 +20,7 @@ import java.text.DateFormat
|
||||||
|
|
||||||
|
|
||||||
open class AccountTransactionsTable @JvmOverloads constructor(
|
open class AccountTransactionsTable @JvmOverloads constructor(
|
||||||
protected val presenter: MainWindowPresenter,
|
protected val presenter: BankingPresenter,
|
||||||
transactions: ObservableList<AccountTransaction> = FXCollections.emptyObservableList<AccountTransaction>()
|
transactions: ObservableList<AccountTransaction> = FXCollections.emptyObservableList<AccountTransaction>()
|
||||||
) : TableView<AccountTransaction>(transactions) {
|
) : TableView<AccountTransaction>(transactions) {
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,11 @@ import net.dankito.banking.ui.model.AccountTransaction
|
||||||
import net.dankito.banking.ui.model.BankAccount
|
import net.dankito.banking.ui.model.BankAccount
|
||||||
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
||||||
import net.dankito.banking.ui.model.responses.GetTransactionsResponse
|
import net.dankito.banking.ui.model.responses.GetTransactionsResponse
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
|
|
||||||
|
|
||||||
open class AccountTransactionsView(private val presenter: MainWindowPresenter) : View() {
|
open class AccountTransactionsView(private val presenter: BankingPresenter) : View() {
|
||||||
|
|
||||||
protected val isAccountSelected = SimpleBooleanProperty(false)
|
protected val isAccountSelected = SimpleBooleanProperty(false)
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,14 @@ import javafx.scene.layout.Priority
|
||||||
import net.dankito.banking.ui.javafx.model.AccountsAccountTreeItem
|
import net.dankito.banking.ui.javafx.model.AccountsAccountTreeItem
|
||||||
import net.dankito.banking.ui.javafx.model.AccountsBankAccountTreeItem
|
import net.dankito.banking.ui.javafx.model.AccountsBankAccountTreeItem
|
||||||
import net.dankito.banking.ui.javafx.model.AccountsRootTreeItem
|
import net.dankito.banking.ui.javafx.model.AccountsRootTreeItem
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.utils.javafx.ui.controls.addButton
|
import net.dankito.utils.javafx.ui.controls.addButton
|
||||||
import net.dankito.utils.javafx.ui.extensions.fixedHeight
|
import net.dankito.utils.javafx.ui.extensions.fixedHeight
|
||||||
import net.dankito.utils.javafx.ui.extensions.fixedWidth
|
import net.dankito.utils.javafx.ui.extensions.fixedWidth
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
|
|
||||||
|
|
||||||
open class AccountsView(protected val presenter: MainWindowPresenter) : View() {
|
open class AccountsView(protected val presenter: BankingPresenter) : View() {
|
||||||
|
|
||||||
protected val accounts = FXCollections.observableArrayList(presenter.accounts)
|
protected val accounts = FXCollections.observableArrayList(presenter.accounts)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import javafx.scene.paint.Color
|
||||||
import javafx.scene.text.Font
|
import javafx.scene.text.Font
|
||||||
import javafx.scene.text.FontWeight
|
import javafx.scene.text.FontWeight
|
||||||
import net.dankito.banking.ui.model.responses.AddAccountResponse
|
import net.dankito.banking.ui.model.responses.AddAccountResponse
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.fints.model.BankInfo
|
import net.dankito.fints.model.BankInfo
|
||||||
import net.dankito.utils.javafx.ui.controls.UpdateButton
|
import net.dankito.utils.javafx.ui.controls.UpdateButton
|
||||||
import net.dankito.utils.javafx.ui.dialogs.Window
|
import net.dankito.utils.javafx.ui.dialogs.Window
|
||||||
|
@ -22,7 +22,7 @@ import net.dankito.utils.javafx.ui.extensions.setBackgroundToColor
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
|
|
||||||
|
|
||||||
open class AddAccountDialog(protected val presenter: MainWindowPresenter) : Window() {
|
open class AddAccountDialog(protected val presenter: BankingPresenter) : Window() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val LabelMargins = Insets(6.0, 4.0, 6.0, 4.0)
|
private val LabelMargins = Insets(6.0, 4.0, 6.0, 4.0)
|
||||||
|
@ -237,7 +237,7 @@ open class AddAccountDialog(protected val presenter: MainWindowPresenter) : Wind
|
||||||
val userSelection = dialogService.showDialog(Alert.AlertType.CONFIRMATION, message, null, currentStage, ButtonType.YES, ButtonType.NO)
|
val userSelection = dialogService.showDialog(Alert.AlertType.CONFIRMATION, message, null, currentStage, ButtonType.YES, ButtonType.NO)
|
||||||
|
|
||||||
when (userSelection) {
|
when (userSelection) {
|
||||||
ButtonType.YES -> { presenter.getAccountTransactionsAsync(response.account) { } }
|
ButtonType.YES -> presenter.getAccountTransactionsAsync(response.account) { }
|
||||||
else -> { } // nothing to do then, simply close dialog
|
else -> { } // nothing to do then, simply close dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import net.dankito.banking.ui.javafx.dialogs.JavaFxDialogService
|
||||||
import net.dankito.banking.ui.model.BankAccount
|
import net.dankito.banking.ui.model.BankAccount
|
||||||
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
||||||
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.fints.messages.segmente.implementierte.sepa.ISepaMessageCreator
|
import net.dankito.fints.messages.segmente.implementierte.sepa.ISepaMessageCreator
|
||||||
import net.dankito.fints.messages.segmente.implementierte.sepa.SepaMessageCreator
|
import net.dankito.fints.messages.segmente.implementierte.sepa.SepaMessageCreator
|
||||||
import net.dankito.fints.model.BankInfo
|
import net.dankito.fints.model.BankInfo
|
||||||
|
@ -23,7 +23,7 @@ import tornadofx.*
|
||||||
|
|
||||||
|
|
||||||
open class TransferMoneyDialog @JvmOverloads constructor(
|
open class TransferMoneyDialog @JvmOverloads constructor(
|
||||||
protected val presenter: MainWindowPresenter,
|
protected val presenter: BankingPresenter,
|
||||||
preselectedBankAccount: BankAccount? = null,
|
preselectedBankAccount: BankAccount? = null,
|
||||||
preselectedValues: TransferMoneyData? = null
|
preselectedValues: TransferMoneyData? = null
|
||||||
) : Window() {
|
) : Window() {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import net.dankito.banking.ui.javafx.dialogs.tan.controls.TanImageView
|
||||||
import net.dankito.banking.ui.model.Account
|
import net.dankito.banking.ui.model.Account
|
||||||
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
||||||
import net.dankito.banking.ui.model.tan.*
|
import net.dankito.banking.ui.model.tan.*
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.utils.javafx.ui.dialogs.Window
|
import net.dankito.utils.javafx.ui.dialogs.Window
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import tornadofx.*
|
||||||
open class EnterTanDialog(
|
open class EnterTanDialog(
|
||||||
protected val account: Account,
|
protected val account: Account,
|
||||||
protected val challenge: TanChallenge,
|
protected val challenge: TanChallenge,
|
||||||
protected val presenter: MainWindowPresenter,
|
protected val presenter: BankingPresenter,
|
||||||
protected val tanEnteredCallback: (EnterTanResult) -> Unit
|
protected val tanEnteredCallback: (EnterTanResult) -> Unit
|
||||||
) : Window() {
|
) : Window() {
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,17 @@ import net.dankito.banking.ui.model.tan.EnterTanGeneratorAtcResult
|
||||||
import net.dankito.banking.ui.model.tan.EnterTanResult
|
import net.dankito.banking.ui.model.tan.EnterTanResult
|
||||||
import net.dankito.banking.ui.model.tan.TanChallenge
|
import net.dankito.banking.ui.model.tan.TanChallenge
|
||||||
import net.dankito.banking.ui.model.tan.TanGeneratorTanMedium
|
import net.dankito.banking.ui.model.tan.TanGeneratorTanMedium
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
|
|
||||||
|
|
||||||
interface IRouter {
|
interface IRouter {
|
||||||
|
|
||||||
fun showAddAccountDialog(presenter: MainWindowPresenter)
|
fun showAddAccountDialog(presenter: BankingPresenter)
|
||||||
|
|
||||||
fun getTanFromUserFromNonUiThread(account: Account, tanChallenge: TanChallenge, presenter: MainWindowPresenter): EnterTanResult
|
fun getTanFromUserFromNonUiThread(account: Account, tanChallenge: TanChallenge, presenter: BankingPresenter): EnterTanResult
|
||||||
|
|
||||||
fun getAtcFromUserFromNonUiThread(tanMedium: TanGeneratorTanMedium): EnterTanGeneratorAtcResult
|
fun getAtcFromUserFromNonUiThread(tanMedium: TanGeneratorTanMedium): EnterTanGeneratorAtcResult
|
||||||
|
|
||||||
fun showTransferMoneyDialog(presenter: MainWindowPresenter, preselectedBankAccount: BankAccount?, preselectedValues: TransferMoneyData?)
|
fun showTransferMoneyDialog(presenter: BankingPresenter, preselectedBankAccount: BankAccount?, preselectedValues: TransferMoneyData?)
|
||||||
|
|
||||||
}
|
}
|
|
@ -28,7 +28,7 @@ import java.util.*
|
||||||
import kotlin.collections.ArrayList
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
|
|
||||||
open class MainWindowPresenter(
|
open class BankingPresenter(
|
||||||
protected val bankingClientCreator: IBankingClientCreator,
|
protected val bankingClientCreator: IBankingClientCreator,
|
||||||
protected val dataFolder: File,
|
protected val dataFolder: File,
|
||||||
protected val persister: IBankingPersistence,
|
protected val persister: IBankingPersistence,
|
||||||
|
@ -39,7 +39,7 @@ open class MainWindowPresenter(
|
||||||
companion object {
|
companion object {
|
||||||
protected const val OneDayMillis = 24 * 60 * 60 * 1000
|
protected const val OneDayMillis = 24 * 60 * 60 * 1000
|
||||||
|
|
||||||
private val log = LoggerFactory.getLogger(MainWindowPresenter::class.java)
|
private val log = LoggerFactory.getLogger(BankingPresenter::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ open class MainWindowPresenter(
|
||||||
saveAccountOnNextEnterTanInvocation = false
|
saveAccountOnNextEnterTanInvocation = false
|
||||||
}
|
}
|
||||||
|
|
||||||
val result = router.getTanFromUserFromNonUiThread(account, tanChallenge, this@MainWindowPresenter)
|
val result = router.getTanFromUserFromNonUiThread(account, tanChallenge, this@BankingPresenter)
|
||||||
|
|
||||||
if (result.changeTanProcedureTo != null || result.changeTanMediumTo != null) { // then either selected TAN medium or procedure will change -> save account on next call to enterTan() as then changes will be visible
|
if (result.changeTanProcedureTo != null || result.changeTanMediumTo != null) { // then either selected TAN medium or procedure will change -> save account on next call to enterTan() as then changes will be visible
|
||||||
saveAccountOnNextEnterTanInvocation = true
|
saveAccountOnNextEnterTanInvocation = true
|
|
@ -20,7 +20,7 @@ import net.dankito.banking.fints4java.android.util.Base64ServiceAndroid
|
||||||
import net.dankito.banking.fints4javaBankingClientCreator
|
import net.dankito.banking.fints4javaBankingClientCreator
|
||||||
import net.dankito.banking.persistence.BankingPersistenceJson
|
import net.dankito.banking.persistence.BankingPersistenceJson
|
||||||
import net.dankito.banking.ui.model.Account
|
import net.dankito.banking.ui.model.Account
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.utils.web.client.OkHttpWebClient
|
import net.dankito.utils.web.client.OkHttpWebClient
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
@ -40,7 +40,7 @@ class MainActivity : AppCompatActivity() {
|
||||||
private lateinit var floatingActionMenuButton: MainActivityFloatingActionMenuButton
|
private lateinit var floatingActionMenuButton: MainActivityFloatingActionMenuButton
|
||||||
|
|
||||||
|
|
||||||
lateinit var presenter: MainWindowPresenter
|
lateinit var presenter: BankingPresenter
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
@ -48,7 +48,7 @@ class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
val dataFolder = File(this.filesDir, "data/accounts")
|
val dataFolder = File(this.filesDir, "data/accounts")
|
||||||
|
|
||||||
presenter = MainWindowPresenter(fints4javaBankingClientCreator(OkHttpWebClient(), Base64ServiceAndroid()), dataFolder,
|
presenter = BankingPresenter(fints4javaBankingClientCreator(OkHttpWebClient(), Base64ServiceAndroid()), dataFolder,
|
||||||
BankingPersistenceJson(File(dataFolder, "accounts.json")), RouterAndroid(this))
|
BankingPersistenceJson(File(dataFolder, "accounts.json")), RouterAndroid(this))
|
||||||
|
|
||||||
initUi()
|
initUi()
|
||||||
|
|
|
@ -13,18 +13,18 @@ import net.dankito.banking.ui.model.tan.EnterTanGeneratorAtcResult
|
||||||
import net.dankito.banking.ui.model.tan.EnterTanResult
|
import net.dankito.banking.ui.model.tan.EnterTanResult
|
||||||
import net.dankito.banking.ui.model.tan.TanChallenge
|
import net.dankito.banking.ui.model.tan.TanChallenge
|
||||||
import net.dankito.banking.ui.model.tan.TanGeneratorTanMedium
|
import net.dankito.banking.ui.model.tan.TanGeneratorTanMedium
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import java.util.concurrent.CountDownLatch
|
import java.util.concurrent.CountDownLatch
|
||||||
import java.util.concurrent.atomic.AtomicReference
|
import java.util.concurrent.atomic.AtomicReference
|
||||||
|
|
||||||
|
|
||||||
open class RouterAndroid(protected val activity: AppCompatActivity) : IRouter {
|
open class RouterAndroid(protected val activity: AppCompatActivity) : IRouter {
|
||||||
|
|
||||||
override fun showAddAccountDialog(presenter: MainWindowPresenter) {
|
override fun showAddAccountDialog(presenter: BankingPresenter) {
|
||||||
AddAccountDialog().show(activity, presenter)
|
AddAccountDialog().show(activity, presenter)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTanFromUserFromNonUiThread(account: Account, tanChallenge: TanChallenge, presenter: MainWindowPresenter): EnterTanResult {
|
override fun getTanFromUserFromNonUiThread(account: Account, tanChallenge: TanChallenge, presenter: BankingPresenter): EnterTanResult {
|
||||||
val enteredTan = AtomicReference<EnterTanResult>(null)
|
val enteredTan = AtomicReference<EnterTanResult>(null)
|
||||||
val tanEnteredLatch = CountDownLatch(1)
|
val tanEnteredLatch = CountDownLatch(1)
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ open class RouterAndroid(protected val activity: AppCompatActivity) : IRouter {
|
||||||
return result.get()
|
return result.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showTransferMoneyDialog(presenter: MainWindowPresenter, preselectedBankAccount: BankAccount?, preselectedValues: TransferMoneyData?) {
|
override fun showTransferMoneyDialog(presenter: BankingPresenter, preselectedBankAccount: BankAccount?, preselectedValues: TransferMoneyData?) {
|
||||||
TransferMoneyDialog().show(activity, presenter, preselectedBankAccount, preselectedValues)
|
TransferMoneyDialog().show(activity, presenter, preselectedBankAccount, preselectedValues)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,14 @@ import android.widget.Filter
|
||||||
import android.widget.Filterable
|
import android.widget.Filterable
|
||||||
import kotlinx.android.synthetic.main.list_item_bank_info.view.*
|
import kotlinx.android.synthetic.main.list_item_bank_info.view.*
|
||||||
import net.dankito.banking.fints4java.android.R
|
import net.dankito.banking.fints4java.android.R
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.banking.fints4java.android.ui.adapter.filter.BankInfoFilter
|
import net.dankito.banking.fints4java.android.ui.adapter.filter.BankInfoFilter
|
||||||
import net.dankito.fints.model.BankInfo
|
import net.dankito.fints.model.BankInfo
|
||||||
import net.dankito.utils.android.extensions.setTintColor
|
import net.dankito.utils.android.extensions.setTintColor
|
||||||
import net.dankito.utils.android.ui.adapter.ListAdapter
|
import net.dankito.utils.android.ui.adapter.ListAdapter
|
||||||
|
|
||||||
|
|
||||||
open class BankListAdapter(protected val presenter: MainWindowPresenter) : ListAdapter<BankInfo>(), Filterable {
|
open class BankListAdapter(protected val presenter: BankingPresenter) : ListAdapter<BankInfo>(), Filterable {
|
||||||
|
|
||||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View? {
|
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View? {
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package net.dankito.banking.fints4java.android.ui.adapter.filter
|
package net.dankito.banking.fints4java.android.ui.adapter.filter
|
||||||
|
|
||||||
import android.widget.Filter
|
import android.widget.Filter
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.fints.model.BankInfo
|
import net.dankito.fints.model.BankInfo
|
||||||
|
|
||||||
|
|
||||||
open class BankInfoFilter(protected val presenter: MainWindowPresenter,
|
open class BankInfoFilter(protected val presenter: BankingPresenter,
|
||||||
protected val publishResultsCallback: (List<BankInfo>) -> Unit) : Filter() {
|
protected val publishResultsCallback: (List<BankInfo>) -> Unit) : Filter() {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import kotlinx.android.synthetic.main.dialog_add_account.view.*
|
||||||
import net.dankito.banking.fints4java.android.R
|
import net.dankito.banking.fints4java.android.R
|
||||||
import net.dankito.banking.fints4java.android.ui.adapter.BankListAdapter
|
import net.dankito.banking.fints4java.android.ui.adapter.BankListAdapter
|
||||||
import net.dankito.banking.ui.model.responses.AddAccountResponse
|
import net.dankito.banking.ui.model.responses.AddAccountResponse
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.fints.model.BankInfo
|
import net.dankito.fints.model.BankInfo
|
||||||
import net.dankito.utils.android.extensions.asActivity
|
import net.dankito.utils.android.extensions.asActivity
|
||||||
|
|
||||||
|
@ -29,14 +29,14 @@ open class AddAccountDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected lateinit var presenter: MainWindowPresenter
|
protected lateinit var presenter: BankingPresenter
|
||||||
|
|
||||||
protected lateinit var adapter: BankListAdapter
|
protected lateinit var adapter: BankListAdapter
|
||||||
|
|
||||||
protected var selectedBank: BankInfo? = null
|
protected var selectedBank: BankInfo? = null
|
||||||
|
|
||||||
|
|
||||||
fun show(activity: AppCompatActivity, presenter: MainWindowPresenter, fullscreen: Boolean = false) {
|
fun show(activity: AppCompatActivity, presenter: BankingPresenter, fullscreen: Boolean = false) {
|
||||||
this.presenter = presenter
|
this.presenter = presenter
|
||||||
|
|
||||||
presenter.preloadBanksAsync()
|
presenter.preloadBanksAsync()
|
||||||
|
|
|
@ -21,7 +21,7 @@ import net.dankito.banking.fints4java.android.ui.listener.ListItemSelectedListen
|
||||||
import net.dankito.banking.ui.model.Account
|
import net.dankito.banking.ui.model.Account
|
||||||
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
||||||
import net.dankito.banking.ui.model.tan.*
|
import net.dankito.banking.ui.model.tan.*
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
|
|
||||||
|
|
||||||
open class EnterTanDialog : DialogFragment() {
|
open class EnterTanDialog : DialogFragment() {
|
||||||
|
@ -37,14 +37,14 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
|
|
||||||
protected lateinit var tanChallenge: TanChallenge
|
protected lateinit var tanChallenge: TanChallenge
|
||||||
|
|
||||||
protected lateinit var presenter: MainWindowPresenter
|
protected lateinit var presenter: BankingPresenter
|
||||||
|
|
||||||
protected lateinit var tanEnteredCallback: (EnterTanResult) -> Unit
|
protected lateinit var tanEnteredCallback: (EnterTanResult) -> Unit
|
||||||
|
|
||||||
protected val tanMediumAdapter = TanMediumAdapter()
|
protected val tanMediumAdapter = TanMediumAdapter()
|
||||||
|
|
||||||
|
|
||||||
open fun show(account: Account, tanChallenge: TanChallenge, presenter: MainWindowPresenter, activity: AppCompatActivity,
|
open fun show(account: Account, tanChallenge: TanChallenge, presenter: BankingPresenter, activity: AppCompatActivity,
|
||||||
fullscreen: Boolean = false, tanEnteredCallback: (EnterTanResult) -> Unit) {
|
fullscreen: Boolean = false, tanEnteredCallback: (EnterTanResult) -> Unit) {
|
||||||
|
|
||||||
this.account = account
|
this.account = account
|
||||||
|
|
|
@ -17,7 +17,7 @@ import net.dankito.banking.fints4java.android.ui.listener.ListItemSelectedListen
|
||||||
import net.dankito.banking.ui.model.BankAccount
|
import net.dankito.banking.ui.model.BankAccount
|
||||||
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
||||||
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
import net.dankito.banking.ui.model.responses.BankingClientResponse
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.fints.messages.segmente.implementierte.sepa.ISepaMessageCreator
|
import net.dankito.fints.messages.segmente.implementierte.sepa.ISepaMessageCreator
|
||||||
import net.dankito.fints.messages.segmente.implementierte.sepa.SepaMessageCreator
|
import net.dankito.fints.messages.segmente.implementierte.sepa.SepaMessageCreator
|
||||||
import net.dankito.fints.model.BankInfo
|
import net.dankito.fints.model.BankInfo
|
||||||
|
@ -32,7 +32,7 @@ open class TransferMoneyDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected lateinit var presenter: MainWindowPresenter
|
protected lateinit var presenter: BankingPresenter
|
||||||
|
|
||||||
protected var preselectedBankAccount: BankAccount? = null
|
protected var preselectedBankAccount: BankAccount? = null
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@ open class TransferMoneyDialog : DialogFragment() {
|
||||||
protected val sepaMessageCreator: ISepaMessageCreator = SepaMessageCreator()
|
protected val sepaMessageCreator: ISepaMessageCreator = SepaMessageCreator()
|
||||||
|
|
||||||
|
|
||||||
open fun show(activity: AppCompatActivity, presenter: MainWindowPresenter, preselectedBankAccount: BankAccount?, fullscreen: Boolean = false) {
|
open fun show(activity: AppCompatActivity, presenter: BankingPresenter, preselectedBankAccount: BankAccount?, fullscreen: Boolean = false) {
|
||||||
show(activity, presenter, preselectedBankAccount, null, fullscreen)
|
show(activity, presenter, preselectedBankAccount, null, fullscreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun show(activity: AppCompatActivity, presenter: MainWindowPresenter, preselectedBankAccount: BankAccount?, preselectedValues: TransferMoneyData?, fullscreen: Boolean = false) {
|
open fun show(activity: AppCompatActivity, presenter: BankingPresenter, preselectedBankAccount: BankAccount?, preselectedValues: TransferMoneyData?, fullscreen: Boolean = false) {
|
||||||
this.presenter = presenter
|
this.presenter = presenter
|
||||||
this.preselectedBankAccount = preselectedBankAccount
|
this.preselectedBankAccount = preselectedBankAccount
|
||||||
this.preselectedValues = preselectedValues
|
this.preselectedValues = preselectedValues
|
||||||
|
|
|
@ -18,7 +18,7 @@ import net.dankito.banking.fints4java.android.ui.adapter.AccountTransactionAdapt
|
||||||
import net.dankito.banking.ui.model.AccountTransaction
|
import net.dankito.banking.ui.model.AccountTransaction
|
||||||
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
||||||
import net.dankito.banking.ui.model.responses.GetTransactionsResponse
|
import net.dankito.banking.ui.model.responses.GetTransactionsResponse
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
import net.dankito.utils.android.extensions.asActivity
|
import net.dankito.utils.android.extensions.asActivity
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class HomeFragment : Fragment() {
|
||||||
protected var appliedTransactionsFilter = ""
|
protected var appliedTransactionsFilter = ""
|
||||||
|
|
||||||
|
|
||||||
private lateinit var presenter: MainWindowPresenter
|
private lateinit var presenter: BankingPresenter
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
|
@ -4,10 +4,10 @@ import android.support.v7.app.AppCompatActivity
|
||||||
import com.github.clans.fab.FloatingActionButton
|
import com.github.clans.fab.FloatingActionButton
|
||||||
import com.github.clans.fab.FloatingActionMenu
|
import com.github.clans.fab.FloatingActionMenu
|
||||||
import kotlinx.android.synthetic.main.view_floating_action_button_main.view.*
|
import kotlinx.android.synthetic.main.view_floating_action_button_main.view.*
|
||||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||||
|
|
||||||
|
|
||||||
open class MainActivityFloatingActionMenuButton(floatingActionMenu: FloatingActionMenu, protected val presenter: MainWindowPresenter)
|
open class MainActivityFloatingActionMenuButton(floatingActionMenu: FloatingActionMenu, protected val presenter: BankingPresenter)
|
||||||
: FloatingActionMenuButton(floatingActionMenu) {
|
: FloatingActionMenuButton(floatingActionMenu) {
|
||||||
|
|
||||||
protected lateinit var fabTransferMoney: FloatingActionButton
|
protected lateinit var fabTransferMoney: FloatingActionButton
|
||||||
|
|
Loading…
Reference in New Issue