Removed alert after adding account to ask user if now all account transactions should get fetched
This commit is contained in:
parent
7a64177d47
commit
fcdf60f596
|
@ -1,7 +1,5 @@
|
||||||
package net.dankito.banking.ui.android.dialogs
|
package net.dankito.banking.ui.android.dialogs
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.DialogInterface
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
@ -11,7 +9,6 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
|
@ -135,8 +132,6 @@ open class AddAccountDialog : DialogFragment() {
|
||||||
context?.let { context ->
|
context?.let { context ->
|
||||||
if (response.successful) {
|
if (response.successful) {
|
||||||
this.dismiss()
|
this.dismiss()
|
||||||
|
|
||||||
showMessageForSuccessfullyAddedAccount(context, response)
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AlertDialog.Builder(context)
|
AlertDialog.Builder(context)
|
||||||
|
@ -147,35 +142,6 @@ open class AddAccountDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun showMessageForSuccessfullyAddedAccount(context: Context, response: AddAccountResponse) {
|
|
||||||
val view = createSuccessfullyAddedAccountView(context, response)
|
|
||||||
|
|
||||||
AlertDialog.Builder(context)
|
|
||||||
.setView(view)
|
|
||||||
.setPositiveButton(R.string.fetch) { dialog, _ -> retrieveAccountTransactionsAndDismiss(response, dialog) }
|
|
||||||
.setNeutralButton(R.string.no) { dialog, _ -> dialog.dismiss() }
|
|
||||||
.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
protected open fun createSuccessfullyAddedAccountView(context: Context, response: AddAccountResponse): View? {
|
|
||||||
|
|
||||||
val messageId = if (response.supportsRetrievingTransactionsOfLast90DaysWithoutTan)
|
|
||||||
R.string.dialog_add_account_message_successfully_added_account_support_retrieving_transactions_of_last_90_days_without_tan
|
|
||||||
else R.string.dialog_add_account_message_successfully_added_account
|
|
||||||
|
|
||||||
val view = context.asActivity()?.layoutInflater?.inflate(R.layout.view_successfully_added_account, null)
|
|
||||||
|
|
||||||
view?.findViewById<TextView>(R.id.txtSuccessfullyAddedAccountMessage)?.setText(messageId)
|
|
||||||
|
|
||||||
return view
|
|
||||||
}
|
|
||||||
|
|
||||||
protected open fun retrieveAccountTransactionsAndDismiss(response: AddAccountResponse, messageDialog: DialogInterface) {
|
|
||||||
presenter.fetchAllAccountTransactionsAsync(response.customer) { }
|
|
||||||
|
|
||||||
messageDialog.dismiss()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected val otherEditTextChangedWatcher = object : TextWatcher {
|
protected val otherEditTextChangedWatcher = object : TextWatcher {
|
||||||
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="@dimen/view_successfully_added_account_padding"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtSuccessfullyAddedAccountMessage"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="@dimen/view_successfully_added_account_message_margin_bottom"
|
|
||||||
style="@style/TextAppearance.AppCompat.Medium"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
<string name="yes">Ja</string>
|
<string name="yes">Ja</string>
|
||||||
<string name="no">Nein</string>
|
<string name="no">Nein</string>
|
||||||
<string name="fetch">Abrufen</string>
|
|
||||||
|
|
||||||
<string name="save">Speichern</string>
|
<string name="save">Speichern</string>
|
||||||
<string name="discard">Verwerfen</string>
|
<string name="discard">Verwerfen</string>
|
||||||
|
@ -46,15 +45,6 @@
|
||||||
<string name="dialog_add_account_add">Hinzufügen</string>
|
<string name="dialog_add_account_add">Hinzufügen</string>
|
||||||
<string name="dialog_add_account_bank_does_not_support_fints_3_error_message">%s untersützt FinTS 3.0 nicht und kann deshalb mit dieser App nicht verwendet werden.</string>
|
<string name="dialog_add_account_bank_does_not_support_fints_3_error_message">%s untersützt FinTS 3.0 nicht und kann deshalb mit dieser App nicht verwendet werden.</string>
|
||||||
<string name="dialog_add_account_message_could_not_add_account">Konto konnte nicht hinzugefügt werden.\n\nFehlermeldung Ihrer Bank:\n\n%s</string>
|
<string name="dialog_add_account_message_could_not_add_account">Konto konnte nicht hinzugefügt werden.\n\nFehlermeldung Ihrer Bank:\n\n%s</string>
|
||||||
<string name="dialog_add_account_message_successfully_added_account">
|
|
||||||
Konto erfolgreich hinzugefügt.
|
|
||||||
\n\nMöchten Sie nun die Kontoumsätze dieses Kontos abrufen? Hierfür muss eine TAN eingegeben werden.
|
|
||||||
</string>
|
|
||||||
<string name="dialog_add_account_message_successfully_added_account_support_retrieving_transactions_of_last_90_days_without_tan">
|
|
||||||
Konto erfolgreich hinzugefügt.
|
|
||||||
\n\nKontoumsätze der letzten 90 Tage konnten ohne TAN abgerufen werden.
|
|
||||||
\n\nMöchten Sie nun alle Kontoumsätze abrufen? Hierfür muss eine TAN eingegeben werden.
|
|
||||||
</string>
|
|
||||||
|
|
||||||
<string name="dialog_transfer_money_account">Konto:</string>
|
<string name="dialog_transfer_money_account">Konto:</string>
|
||||||
<string name="dialog_transfer_money_remittee_name">Name:</string>
|
<string name="dialog_transfer_money_remittee_name">Name:</string>
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
<string name="yes">Yes</string>
|
<string name="yes">Yes</string>
|
||||||
<string name="no">No</string>
|
<string name="no">No</string>
|
||||||
<string name="fetch">Fetch</string>
|
|
||||||
|
|
||||||
<string name="save">Save</string>
|
<string name="save">Save</string>
|
||||||
<string name="discard">Discard</string>
|
<string name="discard">Discard</string>
|
||||||
|
@ -46,15 +45,6 @@
|
||||||
<string name="dialog_add_account_add">Add</string>
|
<string name="dialog_add_account_add">Add</string>
|
||||||
<string name="dialog_add_account_bank_does_not_support_fints_3_error_message">%s does not support FinTS 3.0 and therefore cannot be used in this application.</string>
|
<string name="dialog_add_account_bank_does_not_support_fints_3_error_message">%s does not support FinTS 3.0 and therefore cannot be used in this application.</string>
|
||||||
<string name="dialog_add_account_message_could_not_add_account">Could not add account.\n\nError message from your bank:\n\n%s</string>
|
<string name="dialog_add_account_message_could_not_add_account">Could not add account.\n\nError message from your bank:\n\n%s</string>
|
||||||
<string name="dialog_add_account_message_successfully_added_account">
|
|
||||||
Successfully added account.
|
|
||||||
\n\nWould you like to fetch this account\'s transactions now? For this entering a TAN is required.
|
|
||||||
</string>
|
|
||||||
<string name="dialog_add_account_message_successfully_added_account_support_retrieving_transactions_of_last_90_days_without_tan">
|
|
||||||
Successfully added account.
|
|
||||||
\n\nAccount transactions of last 90 days could be retrieved without a TAN.
|
|
||||||
\n\nWould you like to fetch all account transactions now? For this entering a TAN is required.
|
|
||||||
</string>
|
|
||||||
|
|
||||||
<string name="dialog_transfer_money_account">Account:</string>
|
<string name="dialog_transfer_money_account">Account:</string>
|
||||||
<string name="dialog_transfer_money_remittee_name">Name:</string>
|
<string name="dialog_transfer_money_remittee_name">Name:</string>
|
||||||
|
|
Loading…
Reference in New Issue