aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-01-03 14:58:53 -0600
committerIván Ávalos <avalos@disroot.org>2023-01-03 14:58:53 -0600
commit54ead5e35458b6bed19c5aeb2ce8e2fd9de9842e (patch)
treec2bb4af66095290cf399d42be8081ba04ddbdbf7
parentab77084575b76f9cbd517ff5817a2a5655133136 (diff)
downloadtaler-android-bug-0007472.tar.gz
taler-android-bug-0007472.tar.bz2
taler-android-bug-0007472.zip
[wallet] Layout improvements for payment promptbug-0007472
-rw-r--r--wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt7
-rw-r--r--wallet/src/main/res/layout-w550dp/payment_bottom_bar.xml98
-rw-r--r--wallet/src/main/res/layout/payment_bottom_bar.xml102
-rw-r--r--wallet/src/main/res/layout/payment_details.xml14
-rw-r--r--wallet/src/main/res/values-ar/strings.xml1
-rw-r--r--wallet/src/main/res/values-de/strings.xml1
-rw-r--r--wallet/src/main/res/values-es/strings.xml1
-rw-r--r--wallet/src/main/res/values-fr/strings.xml1
-rw-r--r--wallet/src/main/res/values-it/strings.xml1
-rw-r--r--wallet/src/main/res/values-ja/strings.xml1
-rw-r--r--wallet/src/main/res/values-ko/strings.xml1
-rw-r--r--wallet/src/main/res/values-pt/strings.xml1
-rw-r--r--wallet/src/main/res/values-ru/strings.xml1
-rw-r--r--wallet/src/main/res/values-sv/strings.xml1
-rw-r--r--wallet/src/main/res/values-tr/strings.xml1
-rw-r--r--wallet/src/main/res/values/strings.xml1
16 files changed, 141 insertions, 92 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 7ed1bab..6169111 100644
--- a/wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt
@@ -35,6 +35,7 @@ import net.taler.common.fadeOut
import net.taler.wallet.MainViewModel
import net.taler.wallet.R
import net.taler.wallet.databinding.FragmentPromptPaymentBinding
+import kotlin.contracts.contract
/**
* Show a payment and ask the user to accept/decline.
@@ -135,7 +136,11 @@ class PromptPaymentFragment : Fragment(), ProductImageClickListener {
private fun showOrder(contractTerms: ContractTerms, amount: Amount, totalFees: Amount? = null) {
ui.details.orderView.text = contractTerms.summary
adapter.setItems(contractTerms.products)
- ui.details.productsList.fadeIn()
+ if (contractTerms.products.isEmpty()) {
+ ui.details.singleItemLabelView.fadeIn()
+ } else {
+ ui.details.productsList.fadeIn()
+ }
ui.bottom.totalView.text = amount.toString()
if (totalFees != null && !totalFees.isZero()) {
ui.bottom.feeView.text = getString(R.string.payment_fee, totalFees)
diff --git a/wallet/src/main/res/layout-w550dp/payment_bottom_bar.xml b/wallet/src/main/res/layout-w550dp/payment_bottom_bar.xml
index b5eabbe..9b84d89 100644
--- a/wallet/src/main/res/layout-w550dp/payment_bottom_bar.xml
+++ b/wallet/src/main/res/layout-w550dp/payment_bottom_bar.xml
@@ -27,55 +27,67 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
- <TextView
- android:id="@+id/totalLabelView"
+ <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/payment_label_amount_total"
- android:visibility="invisible"
+ app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/totalView"
- app:layout_constraintHorizontal_bias="1.0"
- app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="@+id/totalView"
- app:layout_constraintVertical_bias="0.0"
- tools:visibility="visible" />
+ app:layout_constraintEnd_toStartOf="@id/confirmButton"
+ android:layout_marginVertical="20dp"
+ android:layout_marginStart="20dp">
+ <TextView
+ android:id="@+id/totalLabelView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="8dp"
+ android:textSize="18sp"
+ android:text="@string/payment_label_amount_total"
+ android:visibility="invisible"
+ app:layout_constraintEnd_toStartOf="@+id/totalView"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_bias="0.0"
+ tools:visibility="visible" />
- <TextView
- android:id="@+id/totalView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginTop="8dp"
- android:layout_marginEnd="16dp"
- android:textColor="?android:attr/textColorPrimary"
- android:textStyle="bold"
- android:visibility="invisible"
- app:layout_constraintBottom_toTopOf="@+id/feeView"
- app:layout_constraintEnd_toStartOf="@+id/confirmButton"
- app:layout_constraintHorizontal_chainStyle="packed"
- app:layout_constraintStart_toEndOf="@+id/totalLabelView"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_goneMarginBottom="8dp"
- tools:text="10 TESTKUDOS"
- tools:visibility="visible" />
+ <TextView
+ android:id="@+id/totalView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginEnd="8dp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textStyle="bold"
+ android:textSize="18sp"
+ android:visibility="invisible"
+ app:layout_constraintBottom_toTopOf="@+id/feeView"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toEndOf="@+id/totalLabelView"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_bias="0.0"
+ tools:text="10 TESTKUDOS"
+ tools:visibility="visible" />
- <TextView
- android:id="@+id/feeView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="8dp"
- android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/confirmButton"
- app:layout_constraintHorizontal_bias="1.0"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/totalView"
- tools:text="@string/payment_fee"
- tools:visibility="visible" />
+ <TextView
+ android:id="@+id/feeView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp"
+ android:textSize="18sp"
+ android:visibility="gone"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/totalView"
+ tools:text="@string/payment_fee"
+ tools:visibility="visible" />
+ </androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/confirmButton"
diff --git a/wallet/src/main/res/layout/payment_bottom_bar.xml b/wallet/src/main/res/layout/payment_bottom_bar.xml
index 496f2f3..2108d4a 100644
--- a/wallet/src/main/res/layout/payment_bottom_bar.xml
+++ b/wallet/src/main/res/layout/payment_bottom_bar.xml
@@ -27,57 +27,66 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
- <TextView
- android:id="@+id/totalLabelView"
+ <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginTop="8dp"
- android:text="@string/payment_label_amount_total"
- android:visibility="invisible"
- app:layout_constraintBottom_toTopOf="@+id/confirmButton"
- app:layout_constraintEnd_toStartOf="@+id/totalView"
- app:layout_constraintHorizontal_bias="1.0"
- app:layout_constraintHorizontal_chainStyle="packed"
- app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintBottom_toTopOf="@id/confirmButton"
app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintVertical_bias="0.0"
- tools:visibility="visible" />
-
- <TextView
- android:id="@+id/totalView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginTop="8dp"
- android:layout_marginEnd="8dp"
- android:textColor="?android:attr/textColorPrimary"
- android:textStyle="bold"
- android:visibility="invisible"
- app:layout_constraintBottom_toTopOf="@+id/feeView"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="1.0"
- app:layout_constraintHorizontal_chainStyle="packed"
- app:layout_constraintStart_toEndOf="@+id/totalLabelView"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintVertical_bias="0.0"
- tools:text="10 TESTKUDOS"
- tools:visibility="visible" />
+ android:layout_marginVertical="20dp">
+ <TextView
+ android:id="@+id/totalLabelView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="8dp"
+ android:textSize="18sp"
+ android:text="@string/payment_label_amount_total"
+ android:visibility="invisible"
+ app:layout_constraintEnd_toStartOf="@+id/totalView"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_bias="0.0"
+ tools:visibility="visible" />
- <TextView
- android:id="@+id/feeView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginEnd="8dp"
- android:visibility="gone"
- app:layout_constraintBottom_toTopOf="@+id/confirmButton"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="1.0"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/totalView"
- tools:text="@string/payment_fee"
- tools:visibility="visible" />
+ <TextView
+ android:id="@+id/totalView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginEnd="8dp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textStyle="bold"
+ android:textSize="18sp"
+ android:visibility="invisible"
+ app:layout_constraintBottom_toTopOf="@+id/feeView"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toEndOf="@+id/totalLabelView"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_bias="0.0"
+ tools:text="10 TESTKUDOS"
+ tools:visibility="visible" />
+
+ <TextView
+ android:id="@+id/feeView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp"
+ android:textSize="18sp"
+ android:visibility="gone"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/totalView"
+ tools:text="@string/payment_fee"
+ tools:visibility="visible" />
+ </androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/confirmButton"
@@ -91,7 +100,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/feeView"
tools:enabled="true" />
<ProgressBar
diff --git a/wallet/src/main/res/layout/payment_details.xml b/wallet/src/main/res/layout/payment_details.xml
index 0610f52..ef33335 100644
--- a/wallet/src/main/res/layout/payment_details.xml
+++ b/wallet/src/main/res/layout/payment_details.xml
@@ -53,6 +53,7 @@
android:text="@string/payment_label_order_summary"
android:textAlignment="center"
android:visibility="invisible"
+ app:layout_constraintTop_toTopOf="@id/errorView"
app:layout_constraintBottom_toTopOf="@+id/orderView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -69,7 +70,6 @@
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
android:textSize="25sp"
android:visibility="invisible"
- app:layout_constraintBottom_toTopOf="@+id/productsList"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/orderLabelView"
@@ -89,6 +89,18 @@
tools:listitem="@layout/list_item_product"
tools:visibility="visible" />
+ <TextView
+ android:id="@+id/singleItemLabelView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAlignment="center"
+ android:text="@string/payment_single_item"
+ android:visibility="invisible"
+ app:layout_constraintStart_toStartOf="@id/productsList"
+ app:layout_constraintEnd_toEndOf="@id/productsList"
+ app:layout_constraintTop_toTopOf="@id/productsList"
+ tools:visibility="invisible"/>
+
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
diff --git a/wallet/src/main/res/values-ar/strings.xml b/wallet/src/main/res/values-ar/strings.xml
index ef8cdde..7380da8 100644
--- a/wallet/src/main/res/values-ar/strings.xml
+++ b/wallet/src/main/res/values-ar/strings.xml
@@ -65,6 +65,7 @@
<string name="payment_failed">إخفاق</string>
<string name="payment_initiated">بدء الدفع</string>
<string name="payment_already_paid_title">مدفوع الآن</string>
+ <string name="payment_single_item">شراء عنصر واحد</string>
<string name="withdraw_initiated">لقد بدأ السحب</string>
<string name="withdraw_title">السحب</string>
<string name="withdraw_total">سحب النقود</string>
diff --git a/wallet/src/main/res/values-de/strings.xml b/wallet/src/main/res/values-de/strings.xml
index 8460f65..67556e2 100644
--- a/wallet/src/main/res/values-de/strings.xml
+++ b/wallet/src/main/res/values-de/strings.xml
@@ -38,6 +38,7 @@
<string name="payment_initiated">Zahlung eingeleitet</string>
<string name="payment_already_paid_title">Bereits bezahlt</string>
<string name="payment_already_paid">Sie haben diesen Kauf bereits bezahlt.</string>
+ <string name="payment_single_item">Kauf eines einzelnen Artikels</string>
<string name="withdraw_initiated">Auszahlung eingeleitet</string>
<string name="withdraw_title">Abhebung</string>
<string name="withdraw_total">Abheben</string>
diff --git a/wallet/src/main/res/values-es/strings.xml b/wallet/src/main/res/values-es/strings.xml
index 5f68132..7092704 100644
--- a/wallet/src/main/res/values-es/strings.xml
+++ b/wallet/src/main/res/values-es/strings.xml
@@ -41,6 +41,7 @@
<string name="payment_failed">Fallido</string>
<string name="payment_already_paid_title">Ya pagado</string>
<string name="payment_already_paid">Ya has pagado por esta compra.</string>
+ <string name="payment_single_item">Compra de único artículo</string>
<string name="withdraw_initiated">Retirada iniciada</string>
<string name="withdraw_title">Retirada</string>
<string name="withdraw_total">Retirar</string>
diff --git a/wallet/src/main/res/values-fr/strings.xml b/wallet/src/main/res/values-fr/strings.xml
index 7d260a6..94dda6e 100644
--- a/wallet/src/main/res/values-fr/strings.xml
+++ b/wallet/src/main/res/values-fr/strings.xml
@@ -45,6 +45,7 @@
<string name="payment_balance_insufficient">Solde insuffisant !</string>
<string name="payment_already_paid_title">Déjà payé</string>
<string name="payment_already_paid">Vous avez déjà payé cet achat.</string>
+ <string name="payment_single_item">Achat d\'un seul article</string>
<string name="withdraw_total">Retirer</string>
<string name="withdraw_fees">Frais</string>
<string name="withdraw_exchange">Change</string>
diff --git a/wallet/src/main/res/values-it/strings.xml b/wallet/src/main/res/values-it/strings.xml
index 7f43827..0609d4f 100644
--- a/wallet/src/main/res/values-it/strings.xml
+++ b/wallet/src/main/res/values-it/strings.xml
@@ -60,6 +60,7 @@
<string name="payment_fee">+%s tassa di commissione</string>
<string name="payment_button_confirm">Confermare pagamento</string>
<string name="payment_already_paid">Hai già pagato questo ordine.</string>
+ <string name="payment_single_item">Acquisto di un singolo articolo</string>
<string name="exchange_settings_summary">Gestire la lista di cambi conosciuti in questo portafoglio</string>
<string name="exchange_add_error">Non è stato possibile aggiungere il cambio</string>
<plurals name="exchange_fee_coin">
diff --git a/wallet/src/main/res/values-ja/strings.xml b/wallet/src/main/res/values-ja/strings.xml
index ea841bd..70134b9 100644
--- a/wallet/src/main/res/values-ja/strings.xml
+++ b/wallet/src/main/res/values-ja/strings.xml
@@ -8,6 +8,7 @@
<string name="payment_error">エラー: %s</string>
<string name="payment_aborted">停止</string>
<string name="payment_failed">失敗</string>
+ <string name="payment_single_item">一点買い</string>
<string name="app_name">通貨財布</string>
<string name="google_play_title" tools:keep="@string/google_play_title">通貨財布(テスト)</string>
<string name="google_play_short_desc" tools:keep="@string/google_play_short_desc">GNU通貨は、プライバシーに優しい簡単で速いオンライン支払い。</string>
diff --git a/wallet/src/main/res/values-ko/strings.xml b/wallet/src/main/res/values-ko/strings.xml
index e050aba..8865d64 100644
--- a/wallet/src/main/res/values-ko/strings.xml
+++ b/wallet/src/main/res/values-ko/strings.xml
@@ -70,6 +70,7 @@
<string name="payment_initiated">결제 시작</string>
<string name="payment_already_paid_title">이미 지불</string>
<string name="payment_already_paid">이 구매에 대해 이미 결제하셨습니다.</string>
+ <string name="payment_single_item">단품 구매</string>
<string name="withdraw_initiated">출금 시작됨</string>
<string name="withdraw_title">출금</string>
<string name="withdraw_total">출금</string>
diff --git a/wallet/src/main/res/values-pt/strings.xml b/wallet/src/main/res/values-pt/strings.xml
index 8bb29bf..ee74460 100644
--- a/wallet/src/main/res/values-pt/strings.xml
+++ b/wallet/src/main/res/values-pt/strings.xml
@@ -55,6 +55,7 @@
<string name="payment_failed">Falhou</string>
<string name="payment_initiated">Pagamento iniciado</string>
<string name="payment_already_paid">Já pagou esta compra.</string>
+ <string name="payment_single_item">Compra de um único item</string>
<string name="withdraw_initiated">Saque iniciado</string>
<string name="withdraw_title">Saque</string>
<string name="withdraw_total">Sacar</string>
diff --git a/wallet/src/main/res/values-ru/strings.xml b/wallet/src/main/res/values-ru/strings.xml
index c9a82ff..f3e0e09 100644
--- a/wallet/src/main/res/values-ru/strings.xml
+++ b/wallet/src/main/res/values-ru/strings.xml
@@ -69,6 +69,7 @@
<string name="payment_failed">Платёж не прошёл</string>
<string name="payment_initiated">Платёж инициирован</string>
<string name="payment_already_paid_title">Уже оплачено</string>
+ <string name="payment_single_item">Покупка одного товара</string>
<string name="withdraw_initiated">Вывод средств инициирован</string>
<string name="withdraw_title">Вывод средств</string>
<string name="withdraw_button_confirm">Подтвердить вывод средств</string>
diff --git a/wallet/src/main/res/values-sv/strings.xml b/wallet/src/main/res/values-sv/strings.xml
index 35e7094..27b4873 100644
--- a/wallet/src/main/res/values-sv/strings.xml
+++ b/wallet/src/main/res/values-sv/strings.xml
@@ -65,6 +65,7 @@
<string name="payment_failed">Misslyckad</string>
<string name="payment_already_paid_title">Redan betald</string>
<string name="payment_already_paid">Du har redan betalat för det här köpet.</string>
+ <string name="payment_single_item">Köp av enstaka artiklar</string>
<string name="withdraw_initiated">Uttag påbörjat</string>
<string name="withdraw_title">Uttag</string>
<string name="withdraw_total">Ta ut</string>
diff --git a/wallet/src/main/res/values-tr/strings.xml b/wallet/src/main/res/values-tr/strings.xml
index 6360667..019ce7f 100644
--- a/wallet/src/main/res/values-tr/strings.xml
+++ b/wallet/src/main/res/values-tr/strings.xml
@@ -58,6 +58,7 @@
<string name="payment_failed">Başarısız</string>
<string name="payment_already_paid">Bu satın alma işlemi için zaten ödeme yaptınız.</string>
<string name="payment_already_paid_title">Zaten ödendi</string>
+ <string name="payment_single_item">Tek ürün satın alma</string>
<string name="withdraw_initiated">Para çekme işlemi başlatıldı</string>
<string name="withdraw_title">Para çekme</string>
<string name="withdraw_total">Para çek</string>
diff --git a/wallet/src/main/res/values/strings.xml b/wallet/src/main/res/values/strings.xml
index eb15021..d5c59e0 100644
--- a/wallet/src/main/res/values/strings.xml
+++ b/wallet/src/main/res/values/strings.xml
@@ -115,6 +115,7 @@ GNU Taler is immune against many types of fraud, such as phishing of credit card
<string name="payment_initiated">Payment initiated</string>
<string name="payment_already_paid_title">Already paid</string>
<string name="payment_already_paid">You\'ve already paid for this purchase.</string>
+ <string name="payment_single_item">Single item purchase</string>
<string name="receive_amount">Amount to receive</string>
<string name="receive_amount_invalid">Amount invalid</string>