diff options
author | Torsten Grote <t@grobox.de> | 2020-05-14 14:13:18 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-05-15 14:26:42 -0300 |
commit | 69093aa9055da501fd14103ac772d730850cb7b4 (patch) | |
tree | 4886bd05b7790df295902ed44fcca93146fd06fc /wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt | |
parent | 171a1ae228b801d5c0d54c6c7e7ad8aa458d6bce (diff) | |
download | taler-android-69093aa9055da501fd14103ac772d730850cb7b4.tar.gz taler-android-69093aa9055da501fd14103ac772d730850cb7b4.tar.bz2 taler-android-69093aa9055da501fd14103ac772d730850cb7b4.zip |
[wallet] Remove success pages for withdrawal and payment
The user is now brought the the transaction list where both are shown
directly as pending transactions.
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt b/wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt index 6d31879..ab109bc 100644 --- a/wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt +++ b/wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt @@ -30,14 +30,16 @@ import androidx.lifecycle.observe import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager import androidx.transition.TransitionManager.beginDelayedTransition +import com.google.android.material.snackbar.Snackbar +import com.google.android.material.snackbar.Snackbar.LENGTH_LONG import kotlinx.android.synthetic.main.payment_bottom_bar.* import kotlinx.android.synthetic.main.payment_details.* import net.taler.common.Amount import net.taler.common.ContractTerms import net.taler.common.fadeIn import net.taler.common.fadeOut -import net.taler.wallet.R import net.taler.wallet.MainViewModel +import net.taler.wallet.R /** * Show a payment and ask the user to accept/decline. @@ -97,7 +99,10 @@ class PromptPaymentFragment : Fragment(), ProductImageClickListener { confirmButton.isEnabled = true confirmButton.setOnClickListener { model.showProgressBar.value = true - paymentManager.confirmPay(payStatus.proposalId) + paymentManager.confirmPay( + payStatus.proposalId, + payStatus.contractTerms.amount.currency + ) confirmButton.fadeOut() confirmProgressBar.fadeIn() } @@ -111,7 +116,10 @@ class PromptPaymentFragment : Fragment(), ProductImageClickListener { is PayStatus.Success -> { showLoading(false) paymentManager.resetPayStatus() - findNavController().navigate(R.id.action_promptPayment_to_paymentSuccessful) + // TODO bring the user to the currency's transaction page, if there's more than one currency + model.transactionManager.selectedCurrency = payStatus.currency + findNavController().navigate(R.id.action_promptPayment_to_nav_main) + Snackbar.make(requireView(), R.string.payment_initiated, LENGTH_LONG).show() } is PayStatus.AlreadyPaid -> { showLoading(false) |