aboutsummaryrefslogtreecommitdiff
path: root/wallet/src/main/res
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-04-08 14:21:11 -0300
committerTorsten Grote <t@grobox.de>2020-04-08 14:21:11 -0300
commit874b52c6d5c0d8043f3250e2b80f5091c159ded1 (patch)
treeaa994a5805a0feda15d894a6fcf1d6357f97ce29 /wallet/src/main/res
parent9ee202aebf6416bb336729cb3044e4921a94bee4 (diff)
downloadtaler-android-874b52c6d5c0d8043f3250e2b80f5091c159ded1.tar.gz
taler-android-874b52c6d5c0d8043f3250e2b80f5091c159ded1.tar.bz2
taler-android-874b52c6d5c0d8043f3250e2b80f5091c159ded1.zip
[wallet] add option to see exchange's fee structure
Diffstat (limited to 'wallet/src/main/res')
-rw-r--r--wallet/src/main/res/layout/fragment_prompt_withdraw.xml28
-rw-r--r--wallet/src/main/res/layout/fragment_select_exchange.xml135
-rw-r--r--wallet/src/main/res/layout/list_item_coin_fee.xml78
-rw-r--r--wallet/src/main/res/layout/list_item_wire_fee.xml57
-rw-r--r--wallet/src/main/res/navigation/nav_graph.xml8
-rw-r--r--wallet/src/main/res/values/strings.xml18
6 files changed, 319 insertions, 5 deletions
diff --git a/wallet/src/main/res/layout/fragment_prompt_withdraw.xml b/wallet/src/main/res/layout/fragment_prompt_withdraw.xml
index 4372cba..c9c9402 100644
--- a/wallet/src/main/res/layout/fragment_prompt_withdraw.xml
+++ b/wallet/src/main/res/layout/fragment_prompt_withdraw.xml
@@ -64,7 +64,7 @@
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:gravity="center"
- android:text="Chosen Amount"
+ android:text="@string/amount_chosen"
android:visibility="invisible"
app:layout_constraintBottom_toTopOf="@+id/chosenAmountView"
app:layout_constraintEnd_toEndOf="parent"
@@ -144,18 +144,36 @@
<TextView
android:id="@+id/withdrawExchangeUrl"
- android:layout_width="0dp"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
- android:layout_marginEnd="16dp"
+ android:layout_marginEnd="8dp"
android:gravity="center"
android:textSize="24sp"
android:visibility="invisible"
+ app:layout_constrainedWidth="true"
app:layout_constraintBottom_toTopOf="@+id/withdrawCard"
- app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/selectExchangeButton"
+ app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/exchangeIntroView"
- tools:text="long.exchange.demo.taler.net"
+ tools:text="demo.taler.net"
+ tools:visibility="visible" />
+
+ <ImageButton
+ android:id="@+id/selectExchangeButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="16dp"
+ android:backgroundTint="@color/colorPrimary"
+ android:contentDescription="@string/nav_exchange_fees"
+ android:src="@drawable/ic_cash_usd_outline"
+ android:tint="?attr/colorOnPrimary"
+ android:visibility="invisible"
+ app:layout_constraintBottom_toBottomOf="@+id/withdrawExchangeUrl"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/withdrawExchangeUrl"
+ app:layout_constraintTop_toTopOf="@+id/withdrawExchangeUrl"
tools:visibility="visible" />
<ProgressBar
diff --git a/wallet/src/main/res/layout/fragment_select_exchange.xml b/wallet/src/main/res/layout/fragment_select_exchange.xml
new file mode 100644
index 0000000..cb8d35a
--- /dev/null
+++ b/wallet/src/main/res/layout/fragment_select_exchange.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ This file is part of GNU Taler
+ ~ (C) 2020 Taler Systems S.A.
+ ~
+ ~ GNU Taler is free software; you can redistribute it and/or modify it under the
+ ~ terms of the GNU General Public License as published by the Free Software
+ ~ Foundation; either version 3, or (at your option) any later version.
+ ~
+ ~ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ ~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ ~ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License along with
+ ~ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ -->
+
+<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/withdrawFeeLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="16dp"
+ android:text="@string/exchange_fee_withdrawal_fee_label"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/withdrawFeeView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="16dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/withdrawFeeLabel"
+ app:layout_constraintTop_toTopOf="@+id/withdrawFeeLabel"
+ tools:text="-0.23 TESTKUDOS"
+ tools:textColor="@color/red" />
+
+ <TextView
+ android:id="@+id/overheadLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:text="@string/exchange_fee_overhead_label"
+ app:layout_constraintStart_toStartOf="@+id/withdrawFeeLabel"
+ app:layout_constraintTop_toBottomOf="@+id/withdrawFeeLabel" />
+
+ <TextView
+ android:id="@+id/overheadView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ app:layout_constraintEnd_toEndOf="@+id/withdrawFeeView"
+ app:layout_constraintStart_toEndOf="@+id/overheadLabel"
+ app:layout_constraintTop_toTopOf="@+id/overheadLabel"
+ tools:text="-0.42 TESTKUDOS"
+ tools:textColor="@color/red" />
+
+ <TextView
+ android:id="@+id/expirationLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:text="@string/exchange_fee_coin_expiration_label"
+ app:layout_constraintStart_toStartOf="@+id/withdrawFeeLabel"
+ app:layout_constraintTop_toBottomOf="@+id/overheadLabel" />
+
+ <TextView
+ android:id="@+id/expirationView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ app:layout_constraintEnd_toEndOf="@+id/withdrawFeeView"
+ app:layout_constraintStart_toEndOf="@+id/expirationLabel"
+ app:layout_constraintTop_toTopOf="@+id/expirationLabel"
+ tools:text="in 5 years" />
+
+ <TextView
+ android:id="@+id/coinFeesLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:text="@string/exchange_fee_coin_fees_label"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="16sp"
+ app:layout_constraintStart_toStartOf="@+id/withdrawFeeLabel"
+ app:layout_constraintTop_toBottomOf="@+id/expirationLabel" />
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/coinFeesList"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:overScrollMode="never"
+ app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
+ app:layout_constraintEnd_toEndOf="@+id/withdrawFeeView"
+ app:layout_constraintStart_toStartOf="@+id/withdrawFeeLabel"
+ app:layout_constraintTop_toBottomOf="@+id/coinFeesLabel"
+ tools:listitem="@layout/list_item_coin_fee" />
+
+ <TextView
+ android:id="@+id/wireFeesLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:text="@string/exchange_fee_wire_fees_label"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="16sp"
+ app:layout_constraintStart_toStartOf="@+id/withdrawFeeLabel"
+ app:layout_constraintTop_toBottomOf="@+id/coinFeesList" />
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/wireFeesList"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:overScrollMode="never"
+ app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
+ app:layout_constraintEnd_toEndOf="@+id/withdrawFeeView"
+ app:layout_constraintStart_toStartOf="@+id/withdrawFeeLabel"
+ app:layout_constraintTop_toBottomOf="@+id/wireFeesLabel"
+ tools:listitem="@layout/list_item_wire_fee" />
+
+ </androidx.constraintlayout.widget.ConstraintLayout>
+</androidx.core.widget.NestedScrollView>
diff --git a/wallet/src/main/res/layout/list_item_coin_fee.xml b/wallet/src/main/res/layout/list_item_coin_fee.xml
new file mode 100644
index 0000000..daf2789
--- /dev/null
+++ b/wallet/src/main/res/layout/list_item_coin_fee.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ This file is part of GNU Taler
+ ~ (C) 2020 Taler Systems S.A.
+ ~
+ ~ GNU Taler is free software; you can redistribute it and/or modify it under the
+ ~ terms of the GNU General Public License as published by the Free Software
+ ~ Foundation; either version 3, or (at your option) any later version.
+ ~
+ ~ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ ~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ ~ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License along with
+ ~ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ -->
+
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/coinView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ tools:text="Coin: 2 TESTKUDOS (used 3 times)" />
+
+ <TextView
+ android:id="@+id/withdrawFeeView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="@+id/coinView"
+ app:layout_constraintTop_toBottomOf="@+id/coinView"
+ tools:text="Withdraw Fee: 0.01 TESTKUDOS" />
+
+ <TextView
+ android:id="@+id/depositFeeView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="@+id/coinView"
+ app:layout_constraintTop_toBottomOf="@+id/withdrawFeeView"
+ tools:text="Deposit Fee: 0.01 TESTKUDOS" />
+
+ <TextView
+ android:id="@+id/refreshFeeView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="@+id/coinView"
+ app:layout_constraintTop_toBottomOf="@+id/depositFeeView"
+ tools:text="Change Fee: 0.01 TESTKUDOS" />
+
+ <TextView
+ android:id="@+id/refundFeeView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="8dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="@+id/coinView"
+ app:layout_constraintTop_toBottomOf="@+id/refreshFeeView"
+ tools:text="Refund Fee: 0.01 TESTKUDOS" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/wallet/src/main/res/layout/list_item_wire_fee.xml b/wallet/src/main/res/layout/list_item_wire_fee.xml
new file mode 100644
index 0000000..92ede8b
--- /dev/null
+++ b/wallet/src/main/res/layout/list_item_wire_fee.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ This file is part of GNU Taler
+ ~ (C) 2020 Taler Systems S.A.
+ ~
+ ~ GNU Taler is free software; you can redistribute it and/or modify it under the
+ ~ terms of the GNU General Public License as published by the Free Software
+ ~ Foundation; either version 3, or (at your option) any later version.
+ ~
+ ~ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ ~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ ~ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License along with
+ ~ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ -->
+
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/validityView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ app:layout_constrainedWidth="true"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ tools:text="Timespan: Jan 1 2020 - Dec 31 2020" />
+
+ <TextView
+ android:id="@+id/wireFeeView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/validityView"
+ tools:text="Wire Fee: 0.01 TESTKUDOS" />
+
+ <TextView
+ android:id="@+id/closingFeeView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="8dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/wireFeeView"
+ tools:text="Closing Fee: 0.01 TESTKUDOS" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/wallet/src/main/res/navigation/nav_graph.xml b/wallet/src/main/res/navigation/nav_graph.xml
index c39df94..f6d8598 100644
--- a/wallet/src/main/res/navigation/nav_graph.xml
+++ b/wallet/src/main/res/navigation/nav_graph.xml
@@ -96,6 +96,9 @@
android:id="@+id/action_promptWithdraw_to_errorFragment"
app:destination="@id/errorFragment"
app:popUpTo="@id/showBalance" />
+ <action
+ android:id="@+id/action_promptWithdraw_to_selectExchangeFragment"
+ app:destination="@id/selectExchangeFragment" />
</fragment>
<fragment
@@ -113,6 +116,11 @@
app:destination="@id/promptWithdraw"
app:popUpTo="@id/showBalance" />
</fragment>
+ <fragment
+ android:id="@+id/selectExchangeFragment"
+ android:name="net.taler.wallet.withdraw.SelectExchangeFragment"
+ android:label="@string/nav_exchange_fees"
+ tools:layout="@layout/fragment_select_exchange" />
<fragment
android:id="@+id/nav_pending_operations"
diff --git a/wallet/src/main/res/values/strings.xml b/wallet/src/main/res/values/strings.xml
index 31aaf14..8cbecb9 100644
--- a/wallet/src/main/res/values/strings.xml
+++ b/wallet/src/main/res/values/strings.xml
@@ -23,6 +23,7 @@
<string name="nav_prompt_withdraw">Withdraw Digital Cash</string>
<string name="nav_exchange_tos">Exchange\'s Terms of Service</string>
+ <string name="nav_exchange_fees">Exchange Fees</string>
<string name="nav_error">Error</string>
<string name="button_back">Go Back</string>
@@ -103,6 +104,23 @@
<string name="withdraw_error_title">Withdrawal Error</string>
<string name="withdraw_error_message">Withdrawing is currently not possible. Please try again later!</string>
+ <string name="exchange_fee_withdrawal_fee_label">Withdrawal Fee:</string>
+ <string name="exchange_fee_overhead_label">Rounding Loss:</string>
+ <string name="exchange_fee_coin_expiration_label">Earliest Coin Expiry:</string>
+ <string name="exchange_fee_coin_fees_label">Coin Fees</string>
+ <string name="exchange_fee_wire_fees_label">Wire Fees</string>
+ <plurals name="exchange_fee_coin">
+ <item quantity="one">Coin: %s (used %d time)</item>
+ <item quantity="other">Coin: %s (used %d times)</item>
+ </plurals>
+ <string name="exchange_fee_withdraw_fee">Withdraw Fee: %s</string>
+ <string name="exchange_fee_deposit_fee">Deposit Fee: %s</string>
+ <string name="exchange_fee_refresh_fee">Change Fee: %s</string>
+ <string name="exchange_fee_refund_fee">Refund Fee: %s</string>
+ <string name="exchange_fee_wire_fee_timespan">Timespan: %1$s - %2$s</string>
+ <string name="exchange_fee_wire_fee_wire_fee">Wire Fee: %s</string>
+ <string name="exchange_fee_wire_fee_closing_fee">Closing Fee: %s</string>
+
<string name="pending_operations_title">Pending Operations</string>
<string name="pending_operations_refuse">Refuse Proposal</string>
<string name="pending_operations_no_action">(no action)</string>