Renamed BankTransferDialog to TransferMoneyDialog
This commit is contained in:
parent
dc5e405833
commit
9b247d2c9e
|
@ -57,10 +57,10 @@ open class AccountTransactionAdapter
|
|||
|
||||
selectedTransaction = getItem(viewHolder.adapterPosition)
|
||||
|
||||
menu.findItem(R.id.mnitmShowBankTransferDialog)?.let { mnitmShowBankTransferDialog ->
|
||||
menu.findItem(R.id.mnitmShowTransferMoneyDialog)?.let { mnitmShowTransferMoneyDialog ->
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ import android.text.TextWatcher
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import kotlinx.android.synthetic.main.dialog_bank_transfer.*
|
||||
import kotlinx.android.synthetic.main.dialog_bank_transfer.view.*
|
||||
import kotlinx.android.synthetic.main.dialog_transfer_money.*
|
||||
import kotlinx.android.synthetic.main.dialog_transfer_money.view.*
|
||||
import net.dankito.banking.fints4java.android.R
|
||||
import net.dankito.banking.fints4java.android.ui.MainWindowPresenter
|
||||
import net.dankito.banking.fints4java.android.ui.adapter.BankAccountsAdapter
|
||||
|
@ -24,10 +24,10 @@ import net.dankito.utils.android.extensions.asActivity
|
|||
import java.math.BigDecimal
|
||||
|
||||
|
||||
open class BankTransferDialog : DialogFragment() {
|
||||
open class TransferMoneyDialog : DialogFragment() {
|
||||
|
||||
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? {
|
||||
val rootView = inflater.inflate(R.layout.dialog_bank_transfer, container, false)
|
||||
val rootView = inflater.inflate(R.layout.dialog_transfer_money, container, false)
|
||||
|
||||
setupUI(rootView)
|
||||
|
||||
|
@ -93,7 +93,7 @@ open class BankTransferDialog : DialogFragment() {
|
|||
|
||||
rootView.btnCancel.setOnClickListener { dismiss() }
|
||||
|
||||
rootView.btnDoBankTransfer.setOnClickListener { transferMoney() }
|
||||
rootView.btnTransferMoney.setOnClickListener { transferMoney() }
|
||||
}
|
||||
|
||||
protected open fun setPreselectedValues(rootView: View) {
|
||||
|
@ -145,11 +145,11 @@ open class BankTransferDialog : DialogFragment() {
|
|||
protected open fun handleTransferMoneyResultOnUiThread(transferData: TransferMoneyData, response: BankingClientResponse) {
|
||||
context?.let { context ->
|
||||
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?
|
||||
}
|
||||
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?
|
||||
response.errorToShowToUser
|
||||
)
|
||||
|
@ -216,7 +216,7 @@ open class BankTransferDialog : DialogFragment() {
|
|||
&& isAmountGreaterZero()
|
||||
&& sepaMessageCreator.containsOnlyAllowedCharacters(edtxtUsage.text.toString()) // TODO: show error message for illegal characters
|
||||
|
||||
btnDoBankTransfer.isEnabled = requiredDataEntered
|
||||
btnTransferMoney.isEnabled = requiredDataEntered
|
||||
}
|
||||
|
||||
protected open fun isAmountGreaterZero(): Boolean {
|
|
@ -17,7 +17,7 @@ import net.dankito.banking.fints4java.android.MainActivity
|
|||
import net.dankito.banking.fints4java.android.R
|
||||
import net.dankito.banking.fints4java.android.ui.MainWindowPresenter
|
||||
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.parameters.TransferMoneyData
|
||||
import net.dankito.banking.ui.model.responses.GetTransactionsResponse
|
||||
|
@ -119,8 +119,8 @@ class HomeFragment : Fragment() {
|
|||
|
||||
override fun onContextItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.mnitmShowBankTransferDialog -> {
|
||||
showBankTransferDialog()
|
||||
R.id.mnitmShowTransferMoneyDialog -> {
|
||||
showTransferMoneyDialog()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@ -169,10 +169,10 @@ class HomeFragment : Fragment() {
|
|||
}
|
||||
|
||||
|
||||
private fun showBankTransferDialog() {
|
||||
private fun showTransferMoneyDialog() {
|
||||
transactionAdapter.selectedTransaction?.let { selectedTransaction ->
|
||||
(context as? AppCompatActivity)?.let { activity ->
|
||||
BankTransferDialog().show(activity, presenter, selectedTransaction.bankAccount, mapPreselectedValues(selectedTransaction))
|
||||
TransferMoneyDialog().show(activity, presenter, selectedTransaction.bankAccount, mapPreselectedValues(selectedTransaction))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/dialog_bank_transfer_padding"
|
||||
android:padding="@dimen/dialog_transfer_money_padding"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lytSelectBankAccount"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dialog_bank_transfer_input_fields_height"
|
||||
android:layout_marginBottom="@dimen/dialog_bank_transfer_bank_accounts_margin_bottom"
|
||||
android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
|
||||
android:layout_marginBottom="@dimen/dialog_transfer_money_bank_accounts_margin_bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
>
|
||||
|
@ -19,9 +19,9 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/dialog_bank_transfer_account"
|
||||
android:layout_marginRight="@dimen/dialog_bank_transfer_label_margin_right"
|
||||
android:layout_marginEnd="@dimen/dialog_bank_transfer_label_margin_right"
|
||||
android:text="@string/dialog_transfer_money_account"
|
||||
android:layout_marginRight="@dimen/dialog_transfer_money_label_margin_right"
|
||||
android:layout_marginEnd="@dimen/dialog_transfer_money_label_margin_right"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
|
@ -38,13 +38,13 @@
|
|||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
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:id="@+id/edtxtRemitteeName"
|
||||
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"
|
||||
>
|
||||
|
||||
|
@ -57,13 +57,13 @@
|
|||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
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:id="@+id/edtxtRemitteeIban"
|
||||
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"
|
||||
/>
|
||||
|
||||
|
@ -73,13 +73,13 @@
|
|||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
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:id="@+id/edtxtRemitteeBic"
|
||||
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:enabled="false"
|
||||
/>
|
||||
|
@ -90,13 +90,13 @@
|
|||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
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:id="@+id/edtxtAmount"
|
||||
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"
|
||||
/>
|
||||
|
||||
|
@ -106,13 +106,13 @@
|
|||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
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:id="@+id/edtxtUsage"
|
||||
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"
|
||||
/>
|
||||
|
||||
|
@ -126,22 +126,22 @@
|
|||
>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnDoBankTransfer"
|
||||
android:layout_width="@dimen/dialog_bank_transfer_buttons_width"
|
||||
android:id="@+id/btnTransferMoney"
|
||||
android:layout_width="@dimen/dialog_transfer_money_buttons_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:text="@string/dialog_bank_transfer_transfer"
|
||||
android:text="@string/dialog_transfer_money_transfer"
|
||||
android:enabled="false"
|
||||
/>
|
||||
|
||||
<Button
|
||||
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_toLeftOf="@+id/btnDoBankTransfer"
|
||||
android:layout_toStartOf="@+id/btnDoBankTransfer"
|
||||
android:layout_toLeftOf="@+id/btnTransferMoney"
|
||||
android:layout_toStartOf="@+id/btnTransferMoney"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:text="@string/cancel"
|
||||
/>
|
|
@ -2,8 +2,8 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/mnitmShowBankTransferDialog"
|
||||
android:title="@string/fragment_home_new_bank_transfer_to"
|
||||
android:id="@+id/mnitmShowTransferMoneyDialog"
|
||||
android:title="@string/fragment_home_transfer_money_to"
|
||||
/>
|
||||
|
||||
</menu>
|
|
@ -34,12 +34,12 @@
|
|||
<dimen name="view_successfully_added_account_message_margin_bottom">12dp</dimen>
|
||||
<dimen name="view_successfully_added_account_tan_procedures_height">40dp</dimen>
|
||||
|
||||
<dimen name="dialog_bank_transfer_padding">4dp</dimen>
|
||||
<dimen name="dialog_bank_transfer_input_fields_height">40dp</dimen>
|
||||
<dimen name="dialog_bank_transfer_label_margin_right">4dp</dimen>
|
||||
<dimen name="dialog_bank_transfer_bank_accounts_margin_bottom">12dp</dimen>
|
||||
<dimen name="dialog_bank_transfer_autocomplete_fields_height">50dp</dimen>
|
||||
<dimen name="dialog_bank_transfer_buttons_width">120dp</dimen>
|
||||
<dimen name="dialog_transfer_money_padding">4dp</dimen>
|
||||
<dimen name="dialog_transfer_money_input_fields_height">40dp</dimen>
|
||||
<dimen name="dialog_transfer_money_label_margin_right">4dp</dimen>
|
||||
<dimen name="dialog_transfer_money_bank_accounts_margin_bottom">12dp</dimen>
|
||||
<dimen name="dialog_transfer_money_autocomplete_fields_height">50dp</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_text_size">13sp</dimen>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<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_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_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.
|
||||
</string>
|
||||
|
||||
<string name="dialog_bank_transfer_account">Account:</string>
|
||||
<string name="dialog_bank_transfer_remittee_name">Name:</string>
|
||||
<string name="dialog_bank_transfer_remittee_iban">IBAN:</string>
|
||||
<string name="dialog_bank_transfer_remittee_bic">BIC:</string>
|
||||
<string name="dialog_bank_transfer_amount">Amount:</string>
|
||||
<string name="dialog_bank_transfer_usage">Usage:</string>
|
||||
<string name="dialog_bank_transfer_transfer">Transfer</string>
|
||||
<string name="dialog_bank_transfer_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_account">Account:</string>
|
||||
<string name="dialog_transfer_money_remittee_name">Name:</string>
|
||||
<string name="dialog_transfer_money_remittee_iban">IBAN:</string>
|
||||
<string name="dialog_transfer_money_remittee_bic">BIC:</string>
|
||||
<string name="dialog_transfer_money_amount">Amount:</string>
|
||||
<string name="dialog_transfer_money_usage">Usage:</string>
|
||||
<string name="dialog_transfer_money_transfer">Transfer</string>
|
||||
<string name="dialog_transfer_money_message_transfer_successful">Successfully transferred %1$s %2$s to %3$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_increase_size">+</string>
|
||||
|
|
Loading…
Reference in New Issue