Renamed BankTransferDialog to TransferMoneyDialog

This commit is contained in:
dankl 2020-01-03 14:06:53 +01:00 committed by dankito
parent dc5e405833
commit 9b247d2c9e
7 changed files with 56 additions and 56 deletions

View File

@ -57,10 +57,10 @@ open class AccountTransactionAdapter
selectedTransaction = getItem(viewHolder.adapterPosition) selectedTransaction = getItem(viewHolder.adapterPosition)
menu.findItem(R.id.mnitmShowBankTransferDialog)?.let { mnitmShowBankTransferDialog -> menu.findItem(R.id.mnitmShowTransferMoneyDialog)?.let { mnitmShowTransferMoneyDialog ->
val remitteeName = selectedTransaction?.otherPartyName ?: "" val remitteeName = selectedTransaction?.otherPartyName ?: ""
mnitmShowBankTransferDialog.title = view.context.getString(R.string.fragment_home_new_bank_transfer_to, remitteeName) mnitmShowTransferMoneyDialog.title = view.context.getString(R.string.fragment_home_transfer_money_to, remitteeName)
} }
} }

View File

@ -9,8 +9,8 @@ import android.text.TextWatcher
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import kotlinx.android.synthetic.main.dialog_bank_transfer.* import kotlinx.android.synthetic.main.dialog_transfer_money.*
import kotlinx.android.synthetic.main.dialog_bank_transfer.view.* import kotlinx.android.synthetic.main.dialog_transfer_money.view.*
import net.dankito.banking.fints4java.android.R import net.dankito.banking.fints4java.android.R
import net.dankito.banking.fints4java.android.ui.MainWindowPresenter import net.dankito.banking.fints4java.android.ui.MainWindowPresenter
import net.dankito.banking.fints4java.android.ui.adapter.BankAccountsAdapter import net.dankito.banking.fints4java.android.ui.adapter.BankAccountsAdapter
@ -24,10 +24,10 @@ import net.dankito.utils.android.extensions.asActivity
import java.math.BigDecimal import java.math.BigDecimal
open class BankTransferDialog : DialogFragment() { open class TransferMoneyDialog : DialogFragment() {
companion object { companion object {
const val DialogTag = "BankTransferDialog" const val DialogTag = "TransferMoneyDialog"
} }
@ -59,7 +59,7 @@ open class BankTransferDialog : DialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val rootView = inflater.inflate(R.layout.dialog_bank_transfer, container, false) val rootView = inflater.inflate(R.layout.dialog_transfer_money, container, false)
setupUI(rootView) setupUI(rootView)
@ -93,7 +93,7 @@ open class BankTransferDialog : DialogFragment() {
rootView.btnCancel.setOnClickListener { dismiss() } rootView.btnCancel.setOnClickListener { dismiss() }
rootView.btnDoBankTransfer.setOnClickListener { transferMoney() } rootView.btnTransferMoney.setOnClickListener { transferMoney() }
} }
protected open fun setPreselectedValues(rootView: View) { protected open fun setPreselectedValues(rootView: View) {
@ -145,11 +145,11 @@ open class BankTransferDialog : DialogFragment() {
protected open fun handleTransferMoneyResultOnUiThread(transferData: TransferMoneyData, response: BankingClientResponse) { protected open fun handleTransferMoneyResultOnUiThread(transferData: TransferMoneyData, response: BankingClientResponse) {
context?.let { context -> context?.let { context ->
val message = if (response.isSuccessful) { val message = if (response.isSuccessful) {
context.getString(R.string.dialog_bank_transfer_message_transfer_successful, context.getString(R.string.dialog_transfer_money_message_transfer_successful,
String.format("%.02f", transferData.amount), "", transferData.creditorName) // TODO: where to get currency from? String.format("%.02f", transferData.amount), "", transferData.creditorName) // TODO: where to get currency from?
} }
else { else {
context.getString(R.string.dialog_bank_transfer_message_transfer_failed, context.getString(R.string.dialog_transfer_money_message_transfer_failed,
String.format("%.02f", transferData.amount), "", transferData.creditorName, // TODO: where to get currency from? String.format("%.02f", transferData.amount), "", transferData.creditorName, // TODO: where to get currency from?
response.errorToShowToUser response.errorToShowToUser
) )
@ -216,7 +216,7 @@ open class BankTransferDialog : DialogFragment() {
&& isAmountGreaterZero() && isAmountGreaterZero()
&& sepaMessageCreator.containsOnlyAllowedCharacters(edtxtUsage.text.toString()) // TODO: show error message for illegal characters && sepaMessageCreator.containsOnlyAllowedCharacters(edtxtUsage.text.toString()) // TODO: show error message for illegal characters
btnDoBankTransfer.isEnabled = requiredDataEntered btnTransferMoney.isEnabled = requiredDataEntered
} }
protected open fun isAmountGreaterZero(): Boolean { protected open fun isAmountGreaterZero(): Boolean {

View File

@ -17,7 +17,7 @@ import net.dankito.banking.fints4java.android.MainActivity
import net.dankito.banking.fints4java.android.R import net.dankito.banking.fints4java.android.R
import net.dankito.banking.fints4java.android.ui.MainWindowPresenter import net.dankito.banking.fints4java.android.ui.MainWindowPresenter
import net.dankito.banking.fints4java.android.ui.adapter.AccountTransactionAdapter import net.dankito.banking.fints4java.android.ui.adapter.AccountTransactionAdapter
import net.dankito.banking.fints4java.android.ui.dialogs.BankTransferDialog import net.dankito.banking.fints4java.android.ui.dialogs.TransferMoneyDialog
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
@ -119,8 +119,8 @@ class HomeFragment : Fragment() {
override fun onContextItemSelected(item: MenuItem): Boolean { override fun onContextItemSelected(item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.mnitmShowBankTransferDialog -> { R.id.mnitmShowTransferMoneyDialog -> {
showBankTransferDialog() showTransferMoneyDialog()
return true return true
} }
} }
@ -169,10 +169,10 @@ class HomeFragment : Fragment() {
} }
private fun showBankTransferDialog() { private fun showTransferMoneyDialog() {
transactionAdapter.selectedTransaction?.let { selectedTransaction -> transactionAdapter.selectedTransaction?.let { selectedTransaction ->
(context as? AppCompatActivity)?.let { activity -> (context as? AppCompatActivity)?.let { activity ->
BankTransferDialog().show(activity, presenter, selectedTransaction.bankAccount, mapPreselectedValues(selectedTransaction)) TransferMoneyDialog().show(activity, presenter, selectedTransaction.bankAccount, mapPreselectedValues(selectedTransaction))
} }
} }
} }

View File

@ -3,15 +3,15 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="@dimen/dialog_bank_transfer_padding" android:padding="@dimen/dialog_transfer_money_padding"
> >
<LinearLayout <LinearLayout
android:id="@+id/lytSelectBankAccount" android:id="@+id/lytSelectBankAccount"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dialog_bank_transfer_input_fields_height" android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
android:layout_marginBottom="@dimen/dialog_bank_transfer_bank_accounts_margin_bottom" android:layout_marginBottom="@dimen/dialog_transfer_money_bank_accounts_margin_bottom"
android:gravity="center_vertical" android:gravity="center_vertical"
android:visibility="gone" android:visibility="gone"
> >
@ -19,9 +19,9 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/dialog_bank_transfer_account" android:text="@string/dialog_transfer_money_account"
android:layout_marginRight="@dimen/dialog_bank_transfer_label_margin_right" android:layout_marginRight="@dimen/dialog_transfer_money_label_margin_right"
android:layout_marginEnd="@dimen/dialog_bank_transfer_label_margin_right" android:layout_marginEnd="@dimen/dialog_transfer_money_label_margin_right"
android:gravity="center_vertical" android:gravity="center_vertical"
/> />
@ -38,13 +38,13 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/dialog_bank_transfer_remittee_name" android:hint="@string/dialog_transfer_money_remittee_name"
> >
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/edtxtRemitteeName" android:id="@+id/edtxtRemitteeName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dialog_bank_transfer_input_fields_height" android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
android:inputType="textPersonName" android:inputType="textPersonName"
> >
@ -57,13 +57,13 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/dialog_bank_transfer_remittee_iban" android:hint="@string/dialog_transfer_money_remittee_iban"
> >
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/edtxtRemitteeIban" android:id="@+id/edtxtRemitteeIban"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dialog_bank_transfer_autocomplete_fields_height" android:layout_height="@dimen/dialog_transfer_money_autocomplete_fields_height"
android:inputType="text" android:inputType="text"
/> />
@ -73,13 +73,13 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/dialog_bank_transfer_remittee_bic" android:hint="@string/dialog_transfer_money_remittee_bic"
> >
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/edtxtRemitteeBic" android:id="@+id/edtxtRemitteeBic"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dialog_bank_transfer_input_fields_height" android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
android:inputType="text" android:inputType="text"
android:enabled="false" android:enabled="false"
/> />
@ -90,13 +90,13 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/dialog_bank_transfer_amount" android:hint="@string/dialog_transfer_money_amount"
> >
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/edtxtAmount" android:id="@+id/edtxtAmount"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dialog_bank_transfer_input_fields_height" android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
android:inputType="numberDecimal" android:inputType="numberDecimal"
/> />
@ -106,13 +106,13 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/dialog_bank_transfer_usage" android:hint="@string/dialog_transfer_money_usage"
> >
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/edtxtUsage" android:id="@+id/edtxtUsage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dialog_bank_transfer_input_fields_height" android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
android:inputType="text" android:inputType="text"
/> />
@ -126,22 +126,22 @@
> >
<Button <Button
android:id="@+id/btnDoBankTransfer" android:id="@+id/btnTransferMoney"
android:layout_width="@dimen/dialog_bank_transfer_buttons_width" android:layout_width="@dimen/dialog_transfer_money_buttons_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:text="@string/dialog_bank_transfer_transfer" android:text="@string/dialog_transfer_money_transfer"
android:enabled="false" android:enabled="false"
/> />
<Button <Button
android:id="@+id/btnCancel" android:id="@+id/btnCancel"
android:layout_width="@dimen/dialog_bank_transfer_buttons_width" android:layout_width="@dimen/dialog_transfer_money_buttons_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/btnDoBankTransfer" android:layout_toLeftOf="@+id/btnTransferMoney"
android:layout_toStartOf="@+id/btnDoBankTransfer" android:layout_toStartOf="@+id/btnTransferMoney"
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:text="@string/cancel" android:text="@string/cancel"
/> />

View File

@ -2,8 +2,8 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<item <item
android:id="@+id/mnitmShowBankTransferDialog" android:id="@+id/mnitmShowTransferMoneyDialog"
android:title="@string/fragment_home_new_bank_transfer_to" android:title="@string/fragment_home_transfer_money_to"
/> />
</menu> </menu>

View File

@ -34,12 +34,12 @@
<dimen name="view_successfully_added_account_message_margin_bottom">12dp</dimen> <dimen name="view_successfully_added_account_message_margin_bottom">12dp</dimen>
<dimen name="view_successfully_added_account_tan_procedures_height">40dp</dimen> <dimen name="view_successfully_added_account_tan_procedures_height">40dp</dimen>
<dimen name="dialog_bank_transfer_padding">4dp</dimen> <dimen name="dialog_transfer_money_padding">4dp</dimen>
<dimen name="dialog_bank_transfer_input_fields_height">40dp</dimen> <dimen name="dialog_transfer_money_input_fields_height">40dp</dimen>
<dimen name="dialog_bank_transfer_label_margin_right">4dp</dimen> <dimen name="dialog_transfer_money_label_margin_right">4dp</dimen>
<dimen name="dialog_bank_transfer_bank_accounts_margin_bottom">12dp</dimen> <dimen name="dialog_transfer_money_bank_accounts_margin_bottom">12dp</dimen>
<dimen name="dialog_bank_transfer_autocomplete_fields_height">50dp</dimen> <dimen name="dialog_transfer_money_autocomplete_fields_height">50dp</dimen>
<dimen name="dialog_bank_transfer_buttons_width">120dp</dimen> <dimen name="dialog_transfer_money_buttons_width">120dp</dimen>
<dimen name="list_item_bank_account_padding">4dp</dimen> <dimen name="list_item_bank_account_padding">4dp</dimen>
<dimen name="list_item_bank_account_text_size">13sp</dimen> <dimen name="list_item_bank_account_text_size">13sp</dimen>

View File

@ -22,7 +22,7 @@
<string name="menu_main_update_transactions">Update transactions</string> <string name="menu_main_update_transactions">Update transactions</string>
<string name="fragment_home_could_not_retrieve_account_transactions">Could not retrieve account transactions:\n%s</string> <string name="fragment_home_could_not_retrieve_account_transactions">Could not retrieve account transactions:\n%s</string>
<string name="fragment_home_new_bank_transfer_to">New bank transfer to %s</string> <string name="fragment_home_transfer_money_to">Transfer money to %s</string>
<string name="dialog_add_account_enter_bank_code">Bank code:</string> <string name="dialog_add_account_enter_bank_code">Bank code:</string>
<string name="dialog_add_account_enter_fints_server_address">FinTS server address:</string> <string name="dialog_add_account_enter_fints_server_address">FinTS server address:</string>
@ -41,15 +41,15 @@
\n\nWould you like to fetch all account transactions now? If so entering a TAN is required. \n\nWould you like to fetch all account transactions now? If so entering a TAN is required.
</string> </string>
<string name="dialog_bank_transfer_account">Account:</string> <string name="dialog_transfer_money_account">Account:</string>
<string name="dialog_bank_transfer_remittee_name">Name:</string> <string name="dialog_transfer_money_remittee_name">Name:</string>
<string name="dialog_bank_transfer_remittee_iban">IBAN:</string> <string name="dialog_transfer_money_remittee_iban">IBAN:</string>
<string name="dialog_bank_transfer_remittee_bic">BIC:</string> <string name="dialog_transfer_money_remittee_bic">BIC:</string>
<string name="dialog_bank_transfer_amount">Amount:</string> <string name="dialog_transfer_money_amount">Amount:</string>
<string name="dialog_bank_transfer_usage">Usage:</string> <string name="dialog_transfer_money_usage">Usage:</string>
<string name="dialog_bank_transfer_transfer">Transfer</string> <string name="dialog_transfer_money_transfer">Transfer</string>
<string name="dialog_bank_transfer_message_transfer_successful">Successfully transferred %1$s %2$s to %3$s.</string> <string name="dialog_transfer_money_message_transfer_successful">Successfully transferred %1$s %2$s to %3$s.</string>
<string name="dialog_bank_transfer_message_transfer_failed">Could not transfer %1$s %2$s to %3$s:\n%4$s.</string> <string name="dialog_transfer_money_message_transfer_failed">Could not transfer %1$s %2$s to %3$s:\n%4$s.</string>
<string name="view_tan_image_size_controls_size">Size:</string> <string name="view_tan_image_size_controls_size">Size:</string>
<string name="view_tan_image_size_controls_increase_size">+</string> <string name="view_tan_image_size_controls_increase_size">+</string>