taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

commit c90356e99fec4b4ba39a08e7910880bd7accfa3c
parent 7915c0c6b6e035909c72000175cb509e67490718
Author: Iván Ávalos <avalos@disroot.org>
Date:   Tue,  4 Jun 2024 10:50:03 -0600

[pos] pre-select new config and add deprecation warning for old config

bug 0008838

Diffstat:
Mmerchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigManager.kt | 2+-
Mmerchant-terminal/src/main/res/layout/fragment_merchant_config.xml | 20+++++++++++++++++++-
Mmerchant-terminal/src/main/res/values/strings.xml | 1+
3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigManager.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigManager.kt @@ -90,7 +90,7 @@ class ConfigManager( private val prefs = context.getSharedPreferences(SETTINGS_NAME, MODE_PRIVATE) private val configurationReceivers = ArrayList<ConfigurationReceiver>() - var config: Config = if (prefs.getInt(SETTINGS_CONFIG_VERSION, CONFIG_VERSION_OLD) == CONFIG_VERSION_NEW) { + var config: Config = if (prefs.getInt(SETTINGS_CONFIG_VERSION, CONFIG_VERSION_NEW) == CONFIG_VERSION_NEW) { Config.New( merchantUrl = prefs.getString(SETTINGS_MERCHANT_URL, "")!!, accessToken = prefs.getString(SETTINGS_ACCESS_TOKEN, NEW_CONFIG_ACCESS_TOKEN_DEMO)!!, diff --git a/merchant-terminal/src/main/res/layout/fragment_merchant_config.xml b/merchant-terminal/src/main/res/layout/fragment_merchant_config.xml @@ -56,6 +56,24 @@ android:visibility="gone" tools:visibility="visible"> + <androidx.cardview.widget.CardView + android:id="@+id/deprecationCard" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:contentPadding="10dp" + android:layout_margin="16dp" + app:cardBackgroundColor="@color/red" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent"> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAlignment="center" + android:textColor="@android:color/white" + android:text="@string/config_old_deprecation" /> + </androidx.cardview.widget.CardView> + <com.google.android.material.textfield.TextInputLayout android:id="@+id/configUrlView" android:layout_width="0dp" @@ -66,7 +84,7 @@ app:boxBackgroundMode="outline" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent"> + app:layout_constraintTop_toBottomOf="@id/deprecationCard"> <com.google.android.material.textfield.TextInputEditText android:layout_width="match_parent" diff --git a/merchant-terminal/src/main/res/values/strings.xml b/merchant-terminal/src/main/res/values/strings.xml @@ -23,6 +23,7 @@ <string name="config_label">Merchant settings</string> <string name="config_old_label">JSON file (old)</string> <string name="config_new_label">Merchant (new)</string> + <string name="config_old_deprecation">This configuration method is deprecated, please use the new merchant API configuration.</string> <string name="config_url">Configuration URL</string> <string name="config_merchant_url">Merchant URL</string> <string name="config_username">Username</string>