gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-android] branch master updated (9401b3e -> 78dcfb7)


From: gnunet
Subject: [taler-taler-android] branch master updated (9401b3e -> 78dcfb7)
Date: Thu, 02 Apr 2020 18:59:51 +0200

This is an automated email from the git hooks/post-receive script.

torsten-grote pushed a change to branch master
in repository taler-android.

    from 9401b3e  [wallet] automatic code cleanup
     new 5cd8303  [cashier] automatic code cleanup
     new c3f777e  [wallet] remove abort/cancel buttons
     new a6e5a8d  [wallet] Show withdraw summary before ToS and do one-click 
accept
     new 78dcfb7  Prevent parallel deploys to nightly repo

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cashier/.gitlab-ci.yml                             |  7 ++-
 cashier/src/main/AndroidManifest.xml               |  4 +-
 .../main/java/net/taler/cashier/ConfigFragment.kt  |  3 +-
 .../src/main/java/net/taler/cashier/HttpHelper.kt  |  4 +-
 .../main/java/net/taler/cashier/MainActivity.kt    |  4 +-
 .../main/res/drawable/ic_launcher_foreground.xml   | 16 ++---
 .../res/layout-w550dp/fragment_transaction.xml     |  3 +-
 cashier/src/main/res/layout/activity_main.xml      |  3 +-
 cashier/src/main/res/layout/fragment_balance.xml   |  2 +-
 cashier/src/main/res/layout/fragment_error.xml     |  3 +-
 .../src/main/res/layout/fragment_transaction.xml   |  3 +-
 cashier/src/main/res/menu/balance.xml              |  3 +-
 .../src/main/res/mipmap-anydpi-v26/ic_launcher.xml |  4 +-
 cashier/src/main/res/values-night/colors.xml       |  3 +-
 merchant-terminal/.gitlab-ci.yml                   |  3 +
 wallet/.gitlab-ci.yml                              | 11 +++-
 .../taler/wallet/payment/PromptPaymentFragment.kt  |  5 --
 .../wallet/withdraw/PromptWithdrawFragment.kt      | 67 ++++++++++++---------
 .../wallet/withdraw/ReviewExchangeTosFragment.kt   | 11 +---
 .../net/taler/wallet/withdraw/WithdrawManager.kt   | 68 ++++++++++------------
 .../main/res/layout-w550dp/payment_bottom_bar.xml  | 18 +-----
 .../main/res/layout/fragment_prompt_withdraw.xml   | 36 +++++-------
 .../res/layout/fragment_review_exchange_tos.xml    | 46 +++------------
 wallet/src/main/res/layout/payment_bottom_bar.xml  | 22 ++-----
 wallet/src/main/res/navigation/nav_graph.xml       |  7 +--
 wallet/src/main/res/values/strings.xml             |  9 ++-
 26 files changed, 148 insertions(+), 217 deletions(-)

diff --git a/cashier/.gitlab-ci.yml b/cashier/.gitlab-ci.yml
index 1b82411..e5f02ad 100644
--- a/cashier/.gitlab-ci.yml
+++ b/cashier/.gitlab-ci.yml
@@ -5,6 +5,8 @@ cashier_test:
   only:
     changes:
       - cashier/**/*
+      - taler-kotlin-common/**/*
+      - build.gradle
   script: ./gradlew :cashier:lint :cashier:assembleRelease
   artifacts:
     paths:
@@ -13,6 +15,7 @@ cashier_test:
 
 cashier_deploy_nightly:
   stage: deploy
+  resource_group: deploy_nightly
   only:
     refs:
       - master
@@ -24,8 +27,8 @@ cashier_deploy_nightly:
     - test -z "$DEBUG_KEYSTORE" && exit 0
     # Rename nightly app
     - sed -i
-        's,<string name="app_name">.*</string>,<string name="app_name">Cashier 
Nightly</string>,'
-        cashier/src/main/res/values*/strings.xml
+      's,<string name="app_name">.*</string>,<string name="app_name">Cashier 
Nightly</string>,'
+      cashier/src/main/res/values*/strings.xml
     # Set time-based version code
     - export versionCode=$(date '+%s')
     - sed -i "s,^\(\s*versionCode\) *[0-9].*,\1 $versionCode," 
cashier/build.gradle
diff --git a/cashier/src/main/AndroidManifest.xml 
b/cashier/src/main/AndroidManifest.xml
index bdc5ec0..1d8b810 100644
--- a/cashier/src/main/AndroidManifest.xml
+++ b/cashier/src/main/AndroidManifest.xml
@@ -5,12 +5,12 @@
 
     <application
         android:allowBackup="true"
+        android:fullBackupContent="@xml/backup_descriptor"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
-        android:fullBackupContent="@xml/backup_descriptor"
+        android:roundIcon="@mipmap/ic_launcher"
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
-        android:roundIcon="@mipmap/ic_launcher"
         tools:ignore="GoogleAppIndexingWarning">
 
         <activity
diff --git a/cashier/src/main/java/net/taler/cashier/ConfigFragment.kt 
b/cashier/src/main/java/net/taler/cashier/ConfigFragment.kt
index 2225ff6..ccbb1a6 100644
--- a/cashier/src/main/java/net/taler/cashier/ConfigFragment.kt
+++ b/cashier/src/main/java/net/taler/cashier/ConfigFragment.kt
@@ -94,7 +94,8 @@ class ConfigFragment : Fragment() {
         // focus on password if it is the only missing value (like after 
locking)
         if (urlView.editText!!.text.isNotBlank()
             && usernameView.editText!!.text.isNotBlank()
-            && passwordView.editText!!.text.isBlank()) {
+            && passwordView.editText!!.text.isBlank()
+        ) {
             passwordView.editText!!.requestFocus()
         }
     }
diff --git a/cashier/src/main/java/net/taler/cashier/HttpHelper.kt 
b/cashier/src/main/java/net/taler/cashier/HttpHelper.kt
index 43ba4d8..63eaddf 100644
--- a/cashier/src/main/java/net/taler/cashier/HttpHelper.kt
+++ b/cashier/src/main/java/net/taler/cashier/HttpHelper.kt
@@ -39,8 +39,8 @@ object HttpHelper {
             .build()
         val response = try {
             getHttpClient(config.username, config.password)
-            .newCall(request)
-            .execute()
+                .newCall(request)
+                .execute()
         } catch (e: Exception) {
             Log.e(TAG, "Error retrieving $url", e)
             return HttpJsonResult.Error(500)
diff --git a/cashier/src/main/java/net/taler/cashier/MainActivity.kt 
b/cashier/src/main/java/net/taler/cashier/MainActivity.kt
index b238054..0559b38 100644
--- a/cashier/src/main/java/net/taler/cashier/MainActivity.kt
+++ b/cashier/src/main/java/net/taler/cashier/MainActivity.kt
@@ -17,7 +17,9 @@
 package net.taler.cashier
 
 import android.content.Intent
-import android.content.Intent.*
+import android.content.Intent.ACTION_MAIN
+import android.content.Intent.CATEGORY_HOME
+import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
 import android.os.Bundle
 import androidx.activity.viewModels
 import androidx.appcompat.app.AppCompatActivity
diff --git a/cashier/src/main/res/drawable/ic_launcher_foreground.xml 
b/cashier/src/main/res/drawable/ic_launcher_foreground.xml
index fbaac05..06c4ddd 100644
--- a/cashier/src/main/res/drawable/ic_launcher_foreground.xml
+++ b/cashier/src/main/res/drawable/ic_launcher_foreground.xml
@@ -4,12 +4,12 @@
     android:height="108dp"
     android:viewportWidth="48"
     android:viewportHeight="48">
-  <group
-      android:translateX="12"
-      android:translateY="12">
-    <path
-        android:pathData="M6,3L6,6L9,6L9,7L6.25,7C5.05,7 4.0508,8 
4.0508,9L3.5,16L20.5,16L20,9C19.8,8 18.8008,7 
17.8008,7L11,7L11,6L14,6L14,3L6,3zM7,4L13,4L13,5L7,5L7,4zM6,9L8,9L8,10L6,10L6,9zM9,9L11,9L11,10L9,10L9,9zM13,9L18,9L18,11L13,11L13,9zM6,11L8,11L8,12L6,12L6,11zM9,11L11,11L11,12L9,12L9,11zM6,13L8,13L8,14L6,14L6,13zM9,13L11,13L11,14L9,14L9,13zM2,17L2,21L22,21L22,17L2,17zM4.7422,17.291L7.2695,17.291L7.2695,17.7793L6.3574,17.7793L6.3574,20.6777L5.6543,20.6777L5.6543,17.7793L4.7422,
 [...]
-        android:fillColor="#f9f9f9"
-        tools:ignore="VectorPath" />
-  </group>
+    <group
+        android:translateX="12"
+        android:translateY="12">
+        <path
+            android:fillColor="#f9f9f9"
+            android:pathData="M6,3L6,6L9,6L9,7L6.25,7C5.05,7 4.0508,8 
4.0508,9L3.5,16L20.5,16L20,9C19.8,8 18.8008,7 
17.8008,7L11,7L11,6L14,6L14,3L6,3zM7,4L13,4L13,5L7,5L7,4zM6,9L8,9L8,10L6,10L6,9zM9,9L11,9L11,10L9,10L9,9zM13,9L18,9L18,11L13,11L13,9zM6,11L8,11L8,12L6,12L6,11zM9,11L11,11L11,12L9,12L9,11zM6,13L8,13L8,14L6,14L6,13zM9,13L11,13L11,14L9,14L9,13zM2,17L2,21L22,21L22,17L2,17zM4.7422,17.291L7.2695,17.291L7.2695,17.7793L6.3574,17.7793L6.3574,20.6777L5.6543,20.6777L5.6543,17.7793L4.7
 [...]
+            tools:ignore="VectorPath" />
+    </group>
 </vector>
diff --git a/cashier/src/main/res/layout-w550dp/fragment_transaction.xml 
b/cashier/src/main/res/layout-w550dp/fragment_transaction.xml
index 610ed28..3df5035 100644
--- a/cashier/src/main/res/layout-w550dp/fragment_transaction.xml
+++ b/cashier/src/main/res/layout-w550dp/fragment_transaction.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   ~ This file is part of GNU Taler
   ~ (C) 2020 Taler Systems S.A.
   ~
diff --git a/cashier/src/main/res/layout/activity_main.xml 
b/cashier/src/main/res/layout/activity_main.xml
index e41b842..a56b647 100644
--- a/cashier/src/main/res/layout/activity_main.xml
+++ b/cashier/src/main/res/layout/activity_main.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   ~ This file is part of GNU Taler
   ~ (C) 2020 Taler Systems S.A.
   ~
diff --git a/cashier/src/main/res/layout/fragment_balance.xml 
b/cashier/src/main/res/layout/fragment_balance.xml
index b50cfa9..fcd0e0a 100644
--- a/cashier/src/main/res/layout/fragment_balance.xml
+++ b/cashier/src/main/res/layout/fragment_balance.xml
@@ -65,9 +65,9 @@
         android:id="@+id/balanceView"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:gravity="center"
         android:paddingStart="@dimen/default_margin"
         android:paddingTop="8dp"
-        android:gravity="center"
         android:paddingEnd="@dimen/default_margin"
         android:paddingBottom="@dimen/default_margin"
         android:textAppearance="@style/TextAppearance.AppCompat.Headline"
diff --git a/cashier/src/main/res/layout/fragment_error.xml 
b/cashier/src/main/res/layout/fragment_error.xml
index ac34c85..fe1db37 100644
--- a/cashier/src/main/res/layout/fragment_error.xml
+++ b/cashier/src/main/res/layout/fragment_error.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   ~ This file is part of GNU Taler
   ~ (C) 2020 Taler Systems S.A.
   ~
diff --git a/cashier/src/main/res/layout/fragment_transaction.xml 
b/cashier/src/main/res/layout/fragment_transaction.xml
index 3affbf2..499b362 100644
--- a/cashier/src/main/res/layout/fragment_transaction.xml
+++ b/cashier/src/main/res/layout/fragment_transaction.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   ~ This file is part of GNU Taler
   ~ (C) 2020 Taler Systems S.A.
   ~
diff --git a/cashier/src/main/res/menu/balance.xml 
b/cashier/src/main/res/menu/balance.xml
index bc64af3..eac38d6 100644
--- a/cashier/src/main/res/menu/balance.xml
+++ b/cashier/src/main/res/menu/balance.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   ~ This file is part of GNU Taler
   ~ (C) 2020 Taler Systems S.A.
   ~
diff --git a/cashier/src/main/res/mipmap-anydpi-v26/ic_launcher.xml 
b/cashier/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
index 7353dbd..ac94b34 100644
--- a/cashier/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ b/cashier/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android";>
-    <background android:drawable="@color/ic_launcher_background"/>
-    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
+    <background android:drawable="@color/ic_launcher_background" />
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
 </adaptive-icon>
\ No newline at end of file
diff --git a/cashier/src/main/res/values-night/colors.xml 
b/cashier/src/main/res/values-night/colors.xml
index 55dde58..c46823c 100644
--- a/cashier/src/main/res/values-night/colors.xml
+++ b/cashier/src/main/res/values-night/colors.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   ~ This file is part of GNU Taler
   ~ (C) 2020 Taler Systems S.A.
   ~
diff --git a/merchant-terminal/.gitlab-ci.yml b/merchant-terminal/.gitlab-ci.yml
index 9bd889b..76f25ad 100644
--- a/merchant-terminal/.gitlab-ci.yml
+++ b/merchant-terminal/.gitlab-ci.yml
@@ -3,6 +3,8 @@ merchant_test:
   only:
     changes:
       - merchant-terminal/**/*
+      - taler-kotlin-common/**/*
+      - build.gradle
   script: ./gradlew :merchant-terminal:lint :merchant-terminal:assembleRelease
   artifacts:
     paths:
@@ -11,6 +13,7 @@ merchant_test:
 
 merchant_deploy_nightly:
   stage: deploy
+  resource_group: deploy_nightly
   only:
     refs:
       - master
diff --git a/wallet/.gitlab-ci.yml b/wallet/.gitlab-ci.yml
index acd4a49..477acca 100644
--- a/wallet/.gitlab-ci.yml
+++ b/wallet/.gitlab-ci.yml
@@ -1,7 +1,4 @@
 .binary_deps:
-  only:
-    changes:
-      - wallet/**/*
   before_script:
     - wget 
"https://git.taler.net/wallet-android.git/plain/akono.aar?h=binary-deps"; -O 
akono/akono.aar
     - mkdir -p app/src/main/assets
@@ -10,6 +7,11 @@
 wallet_test:
   stage: test
   extends: .binary_deps
+  only:
+    changes:
+      - wallet/**/*
+      - taler-kotlin-common/**/*
+      - build.gradle
   script: ./gradlew :wallet:lint :wallet:assembleRelease
   artifacts:
     paths:
@@ -18,8 +20,11 @@ wallet_test:
 
 wallet_deploy_nightly:
   stage: deploy
+  resource_group: deploy_nightly
   extends: .binary_deps
   only:
+    changes:
+      - wallet/**/*
     refs:
       - master
   needs: ["wallet_test"]
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 2eea59e..7fab695 100644
--- a/wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/payment/PromptPaymentFragment.kt
@@ -71,11 +71,6 @@ class PromptPaymentFragment : Fragment(), 
ProductImageClickListener {
             adapter = this@PromptPaymentFragment.adapter
             layoutManager = LinearLayoutManager(requireContext())
         }
-
-        abortButton.setOnClickListener {
-            paymentManager.abortPay()
-            findNavController().navigateUp()
-        }
     }
 
     override fun onDestroy() {
diff --git 
a/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt 
b/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt
index 8fb4cb8..875a9c4 100644
--- a/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt
@@ -25,6 +25,7 @@ import androidx.fragment.app.activityViewModels
 import androidx.lifecycle.Observer
 import androidx.navigation.fragment.findNavController
 import kotlinx.android.synthetic.main.fragment_prompt_withdraw.*
+import net.taler.common.Amount
 import net.taler.common.fadeIn
 import net.taler.common.fadeOut
 import net.taler.wallet.R
@@ -48,39 +49,23 @@ class PromptWithdrawFragment : Fragment() {
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
         super.onViewCreated(view, savedInstanceState)
 
-        button_cancel_withdraw.setOnClickListener {
-            withdrawManager.cancelCurrentWithdraw()
-            findNavController().navigateUp()
-        }
-
-        button_confirm_withdraw.setOnClickListener {
-            val status = withdrawManager.withdrawStatus.value
-            if (status !is WithdrawStatus.ReceivedDetails) throw 
AssertionError()
-            it.fadeOut()
-            confirmProgressBar.fadeIn()
-            withdrawManager.acceptWithdrawal(status.talerWithdrawUri, 
status.suggestedExchange)
-        }
-
         withdrawManager.withdrawStatus.observe(viewLifecycleOwner, Observer {
             showWithdrawStatus(it)
         })
     }
 
-    private fun showWithdrawStatus(status: WithdrawStatus?) = when (status) {
+    private fun showWithdrawStatus(status: WithdrawStatus?): Any = when 
(status) {
         is WithdrawStatus.ReceivedDetails -> {
-            model.showProgressBar.value = false
-            progressBar.fadeOut()
-
-            introView.fadeIn()
-            withdrawAmountView.text = status.amount.toString()
-            withdrawAmountView.fadeIn()
-            feeView.fadeIn()
-
-            exchangeIntroView.fadeIn()
-            withdrawExchangeUrl.text = status.suggestedExchange
-            withdrawExchangeUrl.fadeIn()
-
-            button_confirm_withdraw.isEnabled = true
+            showContent(status.amount, status.suggestedExchange)
+            confirmWithdrawButton.apply {
+                text = getString(R.string.withdraw_button_confirm)
+                setOnClickListener {
+                    it.fadeOut()
+                    confirmProgressBar.fadeIn()
+                    withdrawManager.acceptWithdrawal(status.talerWithdrawUri, 
status.suggestedExchange)
+                }
+                isEnabled = true
+            }
         }
         is WithdrawStatus.Success -> {
             model.showProgressBar.value = false
@@ -94,8 +79,14 @@ class PromptWithdrawFragment : Fragment() {
             model.showProgressBar.value = true
         }
         is TermsOfServiceReviewRequired -> {
-            model.showProgressBar.value = false
-            
findNavController().navigate(R.id.action_promptWithdraw_to_reviewExchangeTOS)
+            showContent(status.amount, status.suggestedExchange)
+            confirmWithdrawButton.apply {
+                text = getString(R.string.withdraw_button_tos)
+                setOnClickListener {
+                    
findNavController().navigate(R.id.action_promptWithdraw_to_reviewExchangeTOS)
+                }
+                isEnabled = true
+            }
         }
         is WithdrawStatus.Error -> {
             model.showProgressBar.value = false
@@ -104,4 +95,22 @@ class PromptWithdrawFragment : Fragment() {
         null -> model.showProgressBar.value = false
     }
 
+    private fun showContent(amount: Amount, exchange: String) {
+        model.showProgressBar.value = false
+        progressBar.fadeOut()
+
+        introView.fadeIn()
+        withdrawAmountView.text = amount.toString()
+        withdrawAmountView.fadeIn()
+        feeView.fadeIn()
+
+        exchangeIntroView.fadeIn()
+        withdrawExchangeUrl.text = exchange.let {
+            if (it.startsWith("https://";)) it.substring(8) else it
+        }.trimEnd('/')
+        withdrawExchangeUrl.fadeIn()
+
+        withdrawCard.fadeIn()
+    }
+
 }
diff --git 
a/wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt 
b/wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt
index eac9e13..af76971 100644
--- 
a/wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt
+++ 
b/wallet/src/main/java/net/taler/wallet/withdraw/ReviewExchangeTosFragment.kt
@@ -47,14 +47,7 @@ class ReviewExchangeTosFragment : Fragment() {
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
         super.onViewCreated(view, savedInstanceState)
         acceptTosCheckBox.isChecked = false
-        acceptTosCheckBox.setOnCheckedChangeListener { _, isChecked ->
-            acceptTosButton.isEnabled = isChecked
-        }
-        abortTosButton.setOnClickListener {
-            withdrawManager.cancelCurrentWithdraw()
-            findNavController().navigateUp()
-        }
-        acceptTosButton.setOnClickListener {
+        acceptTosCheckBox.setOnCheckedChangeListener { _, _ ->
             withdrawManager.acceptCurrentTermsOfService()
         }
         withdrawManager.withdrawStatus.observe(viewLifecycleOwner, Observer {
@@ -71,8 +64,6 @@ class ReviewExchangeTosFragment : Fragment() {
                 is WithdrawStatus.ReceivedDetails -> {
                     
findNavController().navigate(R.id.action_reviewExchangeTOS_to_promptWithdraw)
                 }
-                else -> {
-                }
             }
         })
     }
diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt 
b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
index d686465..e252627 100644
--- a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
+++ b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
@@ -21,6 +21,7 @@ import androidx.lifecycle.MutableLiveData
 import net.taler.common.Amount
 import net.taler.wallet.TAG
 import net.taler.wallet.backend.WalletBackendApi
+import net.taler.wallet.withdraw.WithdrawStatus.ReceivedDetails
 import org.json.JSONObject
 
 sealed class WithdrawStatus {
@@ -62,9 +63,9 @@ class WithdrawManager(private val walletBackendApi: 
WalletBackendApi) {
     }
 
     fun getWithdrawalInfo(talerWithdrawUri: String) {
-        val args = JSONObject()
-        args.put("talerWithdrawUri", talerWithdrawUri)
-
+        val args = JSONObject().apply {
+            put("talerWithdrawUri", talerWithdrawUri)
+        }
         withdrawStatus.value = WithdrawStatus.Loading(talerWithdrawUri)
 
         this.currentWithdrawRequestId++
@@ -97,12 +98,13 @@ class WithdrawManager(private val walletBackendApi: 
WalletBackendApi) {
     }
 
     private fun getWithdrawalInfoWithExchange(talerWithdrawUri: String, 
selectedExchange: String) {
-        val args = JSONObject()
-        args.put("talerWithdrawUri", talerWithdrawUri)
-        args.put("selectedExchange", selectedExchange)
+        val args = JSONObject().apply {
+            put("talerWithdrawUri", talerWithdrawUri)
+            put("selectedExchange", selectedExchange)
+        }
 
-        this.currentWithdrawRequestId++
-        val myWithdrawRequestId = this.currentWithdrawRequestId
+        currentWithdrawRequestId++
+        val myWithdrawRequestId = currentWithdrawRequestId
 
         walletBackendApi.sendRequest("getWithdrawDetailsForUri", args) { 
isError, result ->
             if (isError) {
@@ -111,15 +113,15 @@ class WithdrawManager(private val walletBackendApi: 
WalletBackendApi) {
                 withdrawStatus.postValue(WithdrawStatus.Error(message))
                 return@sendRequest
             }
-            if (myWithdrawRequestId != this.currentWithdrawRequestId) {
-                val mismatch = "$myWithdrawRequestId != 
${this.currentWithdrawRequestId}"
+            if (myWithdrawRequestId != currentWithdrawRequestId) {
+                val mismatch = "$myWithdrawRequestId != 
$currentWithdrawRequestId"
                 Log.w(TAG, "Got withdraw result for different request id 
$mismatch")
                 return@sendRequest
             }
             Log.v(TAG, "got getWithdrawDetailsForUri result (with exchange 
details)")
             val status = withdrawStatus.value
             if (status !is WithdrawStatus.Loading) {
-                Log.v(TAG, "ignoring withdrawal info result, not loading.")
+                Log.w(TAG, "ignoring withdrawal info result, not loading.")
                 return@sendRequest
             }
             val wi = result.getJSONObject("bankWithdrawDetails")
@@ -145,7 +147,7 @@ class WithdrawManager(private val walletBackendApi: 
WalletBackendApi) {
                 )
             } else {
                 withdrawStatus.postValue(
-                    WithdrawStatus.ReceivedDetails(
+                    ReceivedDetails(
                         status.talerWithdrawUri,
                         amount,
                         suggestedExchange
@@ -162,15 +164,16 @@ class WithdrawManager(private val walletBackendApi: 
WalletBackendApi) {
 
         withdrawStatus.value = WithdrawStatus.Withdrawing(talerWithdrawUri)
 
-        walletBackendApi.sendRequest("acceptWithdrawal", args) { isError, _ ->
+        walletBackendApi.sendRequest("acceptWithdrawal", args) { isError, 
result ->
             if (isError) {
-                Log.v(TAG, "got acceptWithdrawal error result")
+                Log.v(TAG, "got acceptWithdrawal error result: 
${result.toString(4)}")
                 return@sendRequest
             }
             Log.v(TAG, "got acceptWithdrawal result")
             val status = withdrawStatus.value
             if (status !is WithdrawStatus.Withdrawing) {
-                Log.v(TAG, "ignoring acceptWithdrawal result, invalid state")
+                Log.w(TAG, "ignoring acceptWithdrawal result, invalid state: 
$status")
+                return@sendRequest
             }
             withdrawStatus.postValue(WithdrawStatus.Success)
         }
@@ -180,30 +183,21 @@ class WithdrawManager(private val walletBackendApi: 
WalletBackendApi) {
      * Accept the currently displayed terms of service.
      */
     fun acceptCurrentTermsOfService() {
-        when (val s = withdrawStatus.value) {
-            is WithdrawStatus.TermsOfServiceReviewRequired -> {
-                val args = JSONObject()
-                args.put("exchangeBaseUrl", s.exchangeBaseUrl)
-                args.put("etag", s.tosEtag)
-                walletBackendApi.sendRequest("acceptExchangeTermsOfService", 
args) { isError, _ ->
-                    if (isError) {
-                        return@sendRequest
-                    }
-                    withdrawStatus.postValue(
-                        WithdrawStatus.ReceivedDetails(
-                            s.talerWithdrawUri,
-                            s.amount,
-                            s.suggestedExchange
-                        )
-                    )
-                }
+        val s = withdrawStatus.value
+        check(s is WithdrawStatus.TermsOfServiceReviewRequired)
+
+        val args = JSONObject().apply {
+            put("exchangeBaseUrl", s.exchangeBaseUrl)
+            put("etag", s.tosEtag)
+        }
+        walletBackendApi.sendRequest("acceptExchangeTermsOfService", args) { 
isError, result ->
+            if (isError) {
+                Log.e(TAG, "Error acceptExchangeTermsOfService 
${result.toString(4)}")
+                return@sendRequest
             }
+            val status = ReceivedDetails(s.talerWithdrawUri, s.amount, 
s.suggestedExchange)
+            withdrawStatus.postValue(status)
         }
     }
 
-    fun cancelCurrentWithdraw() {
-        currentWithdrawRequestId++
-        withdrawStatus.value = null
-    }
-
 }
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 d9952f8..b5eabbe 100644
--- a/wallet/src/main/res/layout-w550dp/payment_bottom_bar.xml
+++ b/wallet/src/main/res/layout-w550dp/payment_bottom_bar.xml
@@ -31,14 +31,13 @@
             android:id="@+id/totalLabelView"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="8dp"
             android:text="@string/payment_label_amount_total"
             android:visibility="invisible"
             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_toEndOf="@+id/abortButton"
+            app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="@+id/totalView"
             app:layout_constraintVertical_bias="0.0"
             tools:visibility="visible" />
@@ -78,19 +77,6 @@
             tools:text="@string/payment_fee"
             tools:visibility="visible" />
 
-        <Button
-            android:id="@+id/abortButton"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_margin="8dp"
-            android:backgroundTint="@color/red"
-            android:text="@string/payment_button_abort"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toStartOf="@+id/confirmButton"
-            app:layout_constraintHorizontal_chainStyle="spread_inside"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
         <Button
             android:id="@+id/confirmButton"
             android:layout_width="wrap_content"
@@ -101,8 +87,6 @@
             android:text="@string/payment_button_confirm"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintHorizontal_bias="0.5"
-            app:layout_constraintStart_toEndOf="@+id/abortButton"
             app:layout_constraintTop_toTopOf="parent"
             tools:enabled="true" />
 
diff --git a/wallet/src/main/res/layout/fragment_prompt_withdraw.xml 
b/wallet/src/main/res/layout/fragment_prompt_withdraw.xml
index 0d507c8..b03ee03 100644
--- a/wallet/src/main/res/layout/fragment_prompt_withdraw.xml
+++ b/wallet/src/main/res/layout/fragment_prompt_withdraw.xml
@@ -29,7 +29,7 @@
         android:layout_marginEnd="16dp"
         android:layout_marginBottom="8dp"
         android:gravity="center"
-        android:text="@string/withdraw_do_you_want"
+        android:text="@string/withdraw_total"
         android:visibility="invisible"
         app:layout_constraintBottom_toTopOf="@+id/withdrawAmountView"
         app:layout_constraintEnd_toEndOf="parent"
@@ -97,13 +97,13 @@
         android:layout_marginStart="16dp"
         android:layout_marginEnd="16dp"
         android:gravity="center"
-        android:textSize="25sp"
+        android:textSize="24sp"
         android:visibility="invisible"
         app:layout_constraintBottom_toTopOf="@+id/withdrawCard"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/exchangeIntroView"
-        tools:text="(exchange base url)"
+        tools:text="long.exchange.demo.taler.net"
         tools:visibility="visible" />
 
     <ProgressBar
@@ -121,9 +121,11 @@
         style="@style/BottomCard"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:visibility="invisible"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent">
+        app:layout_constraintStart_toStartOf="parent"
+        tools:visibility="visible">
 
         <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
@@ -131,18 +133,7 @@
             android:padding="8dp">
 
             <Button
-                android:id="@+id/button_cancel_withdraw"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:backgroundTint="@color/red"
-                android:text="@string/button_cancel"
-                app:layout_constraintBottom_toBottomOf="parent"
-                
app:layout_constraintEnd_toStartOf="@+id/button_confirm_withdraw"
-                app:layout_constraintHorizontal_chainStyle="spread_inside"
-                app:layout_constraintStart_toStartOf="parent" />
-
-            <Button
-                android:id="@+id/button_confirm_withdraw"
+                android:id="@+id/confirmWithdrawButton"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:backgroundTint="@color/green"
@@ -150,7 +141,10 @@
                 android:text="@string/withdraw_button_confirm"
                 app:layout_constraintBottom_toBottomOf="parent"
                 app:layout_constraintEnd_toEndOf="parent"
-                
app:layout_constraintStart_toEndOf="@+id/button_cancel_withdraw" />
+                app:layout_constraintHorizontal_bias="1.0"
+                app:layout_constraintStart_toStartOf="parent"
+                tools:enabled="true"
+                tools:text="@string/withdraw_button_tos" />
 
             <ProgressBar
                 android:id="@+id/confirmProgressBar"
@@ -158,10 +152,10 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:visibility="invisible"
-                
app:layout_constraintBottom_toBottomOf="@+id/button_confirm_withdraw"
-                app:layout_constraintEnd_toEndOf="@+id/button_confirm_withdraw"
-                
app:layout_constraintStart_toStartOf="@+id/button_confirm_withdraw"
-                app:layout_constraintTop_toTopOf="@+id/button_confirm_withdraw"
+                
app:layout_constraintBottom_toBottomOf="@+id/confirmWithdrawButton"
+                app:layout_constraintEnd_toEndOf="@+id/confirmWithdrawButton"
+                
app:layout_constraintStart_toStartOf="@+id/confirmWithdrawButton"
+                app:layout_constraintTop_toTopOf="@+id/confirmWithdrawButton"
                 tools:visibility="visible" />
 
         </androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/wallet/src/main/res/layout/fragment_review_exchange_tos.xml 
b/wallet/src/main/res/layout/fragment_review_exchange_tos.xml
index 69f5c7c..2587c1a 100644
--- a/wallet/src/main/res/layout/fragment_review_exchange_tos.xml
+++ b/wallet/src/main/res/layout/fragment_review_exchange_tos.xml
@@ -60,45 +60,15 @@
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent">
 
-        <androidx.constraintlayout.widget.ConstraintLayout
-            android:layout_width="match_parent"
+        <CheckBox
+            android:id="@+id/acceptTosCheckBox"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:padding="8dp">
-
-            <CheckBox
-                android:id="@+id/acceptTosCheckBox"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:text="@string/exchange_tos_accept"
-                android:visibility="invisible"
-                app:layout_constraintBottom_toTopOf="@+id/acceptTosButton"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                tools:visibility="visible" />
-
-            <Button
-                android:id="@+id/abortTosButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:backgroundTint="@color/red"
-                android:text="@string/button_cancel"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/acceptTosButton"
-                app:layout_constraintHorizontal_chainStyle="spread_inside"
-                app:layout_constraintStart_toStartOf="parent" />
-
-            <Button
-                android:id="@+id/acceptTosButton"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:backgroundTint="@color/green"
-                android:enabled="false"
-                android:text="@string/exchange_tos_button_continue"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toEndOf="@+id/abortTosButton" />
-
-        </androidx.constraintlayout.widget.ConstraintLayout>
+            android:layout_marginStart="8dp"
+            android:layout_marginEnd="8dp"
+            android:text="@string/exchange_tos_accept"
+            android:visibility="invisible"
+            tools:visibility="visible" />
 
     </com.google.android.material.card.MaterialCardView>
 
diff --git a/wallet/src/main/res/layout/payment_bottom_bar.xml 
b/wallet/src/main/res/layout/payment_bottom_bar.xml
index c17068e..a19ac4e 100644
--- a/wallet/src/main/res/layout/payment_bottom_bar.xml
+++ b/wallet/src/main/res/layout/payment_bottom_bar.xml
@@ -32,13 +32,13 @@
             android:layout_height="wrap_content"
             android:layout_marginStart="8dp"
             android:layout_marginTop="8dp"
-            android:layout_marginBottom="8dp"
+            android:layout_marginBottom="27dp"
             android:text="@string/payment_label_amount_total"
             android:visibility="invisible"
-            app:layout_constraintBottom_toTopOf="@+id/abortButton"
+            app:layout_constraintBottom_toTopOf="@+id/confirmButton"
             app:layout_constraintEnd_toStartOf="@+id/totalView"
             app:layout_constraintHorizontal_bias="1.0"
-            app:layout_constraintHorizontal_chainStyle="spread_inside"
+            app:layout_constraintHorizontal_chainStyle="packed"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"
             app:layout_constraintVertical_bias="0.0"
@@ -79,18 +79,6 @@
             tools:text="@string/payment_fee"
             tools:visibility="visible" />
 
-        <Button
-            android:id="@+id/abortButton"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_margin="8dp"
-            android:backgroundTint="@color/red"
-            android:text="@string/payment_button_abort"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toStartOf="@+id/confirmButton"
-            app:layout_constraintHorizontal_chainStyle="spread_inside"
-            app:layout_constraintStart_toStartOf="parent" />
-
         <Button
             android:id="@+id/confirmButton"
             android:layout_width="wrap_content"
@@ -101,8 +89,8 @@
             android:text="@string/payment_button_confirm"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintHorizontal_bias="0.5"
-            app:layout_constraintStart_toEndOf="@+id/abortButton"
+            app:layout_constraintHorizontal_bias="1.0"
+            app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/feeView"
             tools:enabled="true" />
 
diff --git a/wallet/src/main/res/navigation/nav_graph.xml 
b/wallet/src/main/res/navigation/nav_graph.xml
index 39aa182..9875b8a 100644
--- a/wallet/src/main/res/navigation/nav_graph.xml
+++ b/wallet/src/main/res/navigation/nav_graph.xml
@@ -73,14 +73,13 @@
         android:name="net.taler.wallet.withdraw.PromptWithdrawFragment"
         android:label="@string/nav_prompt_withdraw"
         tools:layout="@layout/fragment_prompt_withdraw">
+        <action
+            android:id="@+id/action_promptWithdraw_to_reviewExchangeTOS"
+            app:destination="@id/reviewExchangeTOS" />
         <action
             android:id="@+id/action_promptWithdraw_to_withdrawSuccessful"
             app:destination="@id/withdrawSuccessful"
             app:popUpTo="@id/showBalance" />
-        <action
-            android:id="@+id/action_promptWithdraw_to_reviewExchangeTOS"
-            app:destination="@id/reviewExchangeTOS"
-            app:popUpTo="@id/showBalance" />
         <action
             android:id="@+id/action_promptWithdraw_to_errorFragment"
             app:destination="@id/errorFragment"
diff --git a/wallet/src/main/res/values/strings.xml 
b/wallet/src/main/res/values/strings.xml
index 6bc073f..8cd2dd8 100644
--- a/wallet/src/main/res/values/strings.xml
+++ b/wallet/src/main/res/values/strings.xml
@@ -26,7 +26,6 @@
     <string name="nav_error">Error</string>
 
     <string name="button_back">Go Back</string>
-    <string name="button_cancel">Cancel</string>
     <string name="button_continue">Continue</string>
     <string name="button_scan_qr_code">Scan Taler QR Code</string>
 
@@ -68,7 +67,6 @@
 
     <string name="payment_fee">+%s payment fee</string>
     <string name="payment_button_confirm">Confirm Payment</string>
-    <string name="payment_button_abort">Abort</string>
     <string name="payment_label_amount_total">Total Amount:</string>
     <string name="payment_label_order_summary">Order</string>
     <string name="payment_error">Error: %s</string>
@@ -81,11 +79,12 @@
 
     <string name="withdraw_accepted">Withdrawal accepted</string>
     <string name="withdraw_success_info">The wire transfer now needs to be 
confirmed with the bank. Once the wire transfer is complete, the digital cash 
will automatically show in this wallet.</string>
-    <string name="withdraw_do_you_want">Do you want to withdraw</string>
-    <string name="withdraw_fees">(minus exchange fees not shown in this 
prototype)</string>
-    <string name="withdraw_exchange">Using the exchange provider</string>
+    <string name="withdraw_total">Withdraw</string>
+    <string name="withdraw_fees">(minus exchange fees)</string>
+    <string name="withdraw_exchange">Exchange</string>
     <string name="withdraw_button_testkudos">Withdraw TESTKUDOS</string>
     <string name="withdraw_button_confirm">Confirm Withdraw</string>
+    <string name="withdraw_button_tos">Review Terms</string>
     <string name="withdraw_error_title">Withdrawal Error</string>
     <string name="withdraw_error_message">Withdrawing is currently not 
possible. Please try again later!</string>
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]