diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/MainActivity.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/MainActivity.kt index b37a5b21..f5d48958 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/MainActivity.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/MainActivity.kt @@ -10,12 +10,26 @@ import android.view.Menu import androidx.navigation.findNavController import net.dankito.banking.fints4java.android.ui.MainWindowPresenter import net.dankito.banking.fints4java.android.ui.dialogs.AddAccountDialog +import net.dankito.fints.FinTsClientCallback +import net.dankito.fints.model.TanChallenge +import net.dankito.fints.model.TanProcedure class MainActivity : AppCompatActivity() { // private lateinit var appBarConfiguration: AppBarConfiguration - val presenter = MainWindowPresenter() + val presenter = MainWindowPresenter(callback = object : FinTsClientCallback { + + override fun askUserForTanProcedure(supportedTanProcedures: List): TanProcedure? { + // TODO: show dialog and ask user + return supportedTanProcedures.first() + } + + override fun enterTan(tanChallenge: TanChallenge): String? { + return null + } + + }) override fun onCreate(savedInstanceState: Bundle?) { diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/MainWindowPresenter.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/MainWindowPresenter.kt index 4f9e75ba..f6860d6e 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/MainWindowPresenter.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/MainWindowPresenter.kt @@ -4,7 +4,10 @@ import net.dankito.banking.fints4java.android.Base64ServiceAndroid import net.dankito.fints.FinTsClient import net.dankito.fints.FinTsClientCallback import net.dankito.fints.banks.BankFinder -import net.dankito.fints.model.* +import net.dankito.fints.model.BankData +import net.dankito.fints.model.BankInfo +import net.dankito.fints.model.CustomerData +import net.dankito.fints.model.GetTransactionsParameter import net.dankito.fints.model.mapper.BankDataMapper import net.dankito.fints.response.client.FinTsClientResponse import net.dankito.fints.response.client.GetTransactionsResponse @@ -12,20 +15,7 @@ import net.dankito.utils.IThreadPool import net.dankito.utils.ThreadPool -open class MainWindowPresenter { - - protected val callback = object : FinTsClientCallback { - - override fun askUserForTanProcedure(supportedTanProcedures: List): TanProcedure? { - // TODO: show dialog and ask user - return supportedTanProcedures.first() - } - - override fun enterTan(tanChallenge: TanChallenge): String? { - return null - } - - } +open class MainWindowPresenter(callback: FinTsClientCallback) { protected val finTsClient = FinTsClient(callback, Base64ServiceAndroid())