Added showAddAccountDialog() to IRouter
This commit is contained in:
parent
fe6a2f17d5
commit
00c7084d42
|
@ -10,6 +10,8 @@ import net.dankito.banking.ui.presenter.MainWindowPresenter
|
|||
|
||||
interface IRouter {
|
||||
|
||||
fun showAddAccountDialog(presenter: MainWindowPresenter)
|
||||
|
||||
fun getTanFromUserFromNonUiThread(account: Account, tanChallenge: TanChallenge, presenter: MainWindowPresenter): EnterTanResult
|
||||
|
||||
fun getAtcFromUserFromNonUiThread(tanMedium: TanGeneratorTanMedium): EnterTanGeneratorAtcResult
|
||||
|
|
|
@ -195,6 +195,11 @@ open class MainWindowPresenter(
|
|||
}
|
||||
|
||||
|
||||
open fun showAddAccountDialog() {
|
||||
router.showAddAccountDialog(this)
|
||||
}
|
||||
|
||||
|
||||
protected open fun getClientForAccount(account: Account): IBankingClient? {
|
||||
clientsForAccounts.get(account)?.let { client ->
|
||||
// TODO: is this code still needed after updating data model is implemented?
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.view.Menu
|
|||
import androidx.navigation.findNavController
|
||||
import com.github.clans.fab.FloatingActionMenu
|
||||
import kotlinx.android.synthetic.main.action_view_account_menu_item.view.*
|
||||
import net.dankito.banking.fints4java.android.ui.dialogs.AddAccountDialog
|
||||
import net.dankito.banking.fints4java.android.ui.views.MainActivityFloatingActionMenuButton
|
||||
import net.dankito.banking.fints4java.android.util.Base64ServiceAndroid
|
||||
import net.dankito.banking.fints4javaBankingClientCreator
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.dankito.banking.fints4java.android
|
||||
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import net.dankito.banking.fints4java.android.ui.dialogs.AddAccountDialog
|
||||
import net.dankito.banking.fints4java.android.ui.dialogs.EnterAtcDialog
|
||||
import net.dankito.banking.fints4java.android.ui.dialogs.EnterTanDialog
|
||||
import net.dankito.banking.ui.IRouter
|
||||
|
@ -16,6 +17,10 @@ import java.util.concurrent.atomic.AtomicReference
|
|||
|
||||
open class RouterAndroid(protected val activity: AppCompatActivity) : IRouter {
|
||||
|
||||
override fun showAddAccountDialog(presenter: MainWindowPresenter) {
|
||||
AddAccountDialog().show(activity, presenter)
|
||||
}
|
||||
|
||||
override fun getTanFromUserFromNonUiThread(account: Account, tanChallenge: TanChallenge, presenter: MainWindowPresenter): EnterTanResult {
|
||||
val enteredTan = AtomicReference<EnterTanResult>(null)
|
||||
val tanEnteredLatch = CountDownLatch(1)
|
||||
|
|
|
@ -3,9 +3,8 @@ package net.dankito.banking.fints4java.android.ui.views
|
|||
import android.support.v7.app.AppCompatActivity
|
||||
import com.github.clans.fab.FloatingActionMenu
|
||||
import kotlinx.android.synthetic.main.view_floating_action_button_main.view.*
|
||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
||||
import net.dankito.banking.fints4java.android.ui.dialogs.AddAccountDialog
|
||||
import net.dankito.banking.fints4java.android.ui.dialogs.TransferMoneyDialog
|
||||
import net.dankito.banking.ui.presenter.MainWindowPresenter
|
||||
|
||||
|
||||
open class MainActivityFloatingActionMenuButton(floatingActionMenu: FloatingActionMenu, protected val presenter: MainWindowPresenter)
|
||||
|
@ -18,7 +17,7 @@ open class MainActivityFloatingActionMenuButton(floatingActionMenu: FloatingActi
|
|||
private fun setupButtons(floatingActionMenu: FloatingActionMenu) {
|
||||
(floatingActionMenu.context as? AppCompatActivity)?.let { activity ->
|
||||
floatingActionMenu.fabAddAccount.setOnClickListener {
|
||||
executeAndCloseMenu { AddAccountDialog().show(activity, presenter) }
|
||||
executeAndCloseMenu { presenter.showAddAccountDialog() }
|
||||
}
|
||||
|
||||
val fabTransferMoney = floatingActionMenu.fabTransferMoney
|
||||
|
|
Loading…
Reference in New Issue