aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-09-28 14:33:33 -0300
committerTorsten Grote <t@grobox.de>2020-09-28 14:33:33 -0300
commit44496bcedb1336b8169e10e4d4fcf9165edc194d (patch)
tree17e4abd66f986944e0f5bec44480a7ead589b566
parent0936fc851232c8c6c41ce4a0c479ba7a1e452137 (diff)
downloadtaler-android-44496bcedb1336b8169e10e4d4fcf9165edc194d.tar.gz
taler-android-44496bcedb1336b8169e10e4d4fcf9165edc194d.tar.bz2
taler-android-44496bcedb1336b8169e10e4d4fcf9165edc194d.zip
[wallet] Enable manual withdrawal (without payto:// parsing/display)
-rw-r--r--wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt8
-rw-r--r--wallet/src/main/res/navigation/nav_graph.xml6
2 files changed, 9 insertions, 5 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt b/wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt
index f368c68..47c2c6b 100644
--- a/wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt
@@ -21,10 +21,9 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import android.widget.Toast
-import android.widget.Toast.LENGTH_SHORT
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
+import androidx.navigation.fragment.findNavController
import net.taler.common.hideKeyboard
import net.taler.lib.common.Amount
import net.taler.wallet.MainViewModel
@@ -44,7 +43,7 @@ class ManualWithdrawFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
- savedInstanceState: Bundle?
+ savedInstanceState: Bundle?,
): View? {
ui = FragmentManualWithdrawBinding.inflate(inflater, container, false)
return ui.root
@@ -70,8 +69,9 @@ class ManualWithdrawFragment : Fragment() {
val value = ui.amountView.text.toString().toLong()
val amount = Amount(exchangeItem.currency, value, 0)
ui.amountView.hideKeyboard()
- Toast.makeText(requireContext(), "Not implemented: $amount", LENGTH_SHORT).show()
+
withdrawManager.getWithdrawalDetails(exchangeItem.exchangeBaseUrl, amount)
+ findNavController().navigate(R.id.action_nav_exchange_manual_withdrawal_to_promptWithdraw)
}
}
diff --git a/wallet/src/main/res/navigation/nav_graph.xml b/wallet/src/main/res/navigation/nav_graph.xml
index cf98b95..e8929c9 100644
--- a/wallet/src/main/res/navigation/nav_graph.xml
+++ b/wallet/src/main/res/navigation/nav_graph.xml
@@ -75,7 +75,11 @@
<fragment
android:id="@+id/nav_exchange_manual_withdrawal"
android:name="net.taler.wallet.withdraw.ManualWithdrawFragment"
- android:label="@string/withdraw_title"/>
+ android:label="@string/withdraw_title">
+ <action
+ android:id="@+id/action_nav_exchange_manual_withdrawal_to_promptWithdraw"
+ app:destination="@id/promptWithdraw" />
+ </fragment>
<fragment
android:id="@+id/nav_settings_backup"