[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-terminal-android] 02/08: Improve config fragment: remove
From: |
gnunet |
Subject: |
[taler-merchant-terminal-android] 02/08: Improve config fragment: remove currency and move fetch button up |
Date: |
Tue, 25 Feb 2020 17:07:41 +0100 |
This is an automated email from the git hooks/post-receive script.
torsten-grote pushed a commit to branch master
in repository merchant-terminal-android.
commit 76301acf1768f43c4347b801257da3a9b680d7c4
Author: Torsten Grote <address@hidden>
AuthorDate: Tue Feb 25 09:38:24 2020 -0300
Improve config fragment: remove currency and move fetch button up
---
.../merchantpos/config/MerchantConfigFragment.kt | 13 ++-------
...t_settings.xml => fragment_merchant_config.xml} | 34 ++++++++--------------
app/src/main/res/navigation/nav_graph.xml | 2 +-
3 files changed, 15 insertions(+), 34 deletions(-)
diff --git
a/app/src/main/java/net/taler/merchantpos/config/MerchantConfigFragment.kt
b/app/src/main/java/net/taler/merchantpos/config/MerchantConfigFragment.kt
index abee7e3..8b4f5a8 100644
--- a/app/src/main/java/net/taler/merchantpos/config/MerchantConfigFragment.kt
+++ b/app/src/main/java/net/taler/merchantpos/config/MerchantConfigFragment.kt
@@ -13,7 +13,7 @@ import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.snackbar.Snackbar.LENGTH_SHORT
-import kotlinx.android.synthetic.main.fragment_merchant_settings.*
+import kotlinx.android.synthetic.main.fragment_merchant_config.*
import net.taler.merchantpos.MainViewModel
import net.taler.merchantpos.R
@@ -30,7 +30,7 @@ class MerchantConfigFragment : Fragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
- return inflater.inflate(R.layout.fragment_merchant_settings,
container, false)
+ return inflater.inflate(R.layout.fragment_merchant_config, container,
false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@@ -58,7 +58,6 @@ class MerchantConfigFragment : Fragment() {
configManager.forgetPassword()
passwordView.editText!!.text = null
forgetPasswordButton.visibility = GONE
- currencyView.visibility = GONE
}
updateView()
}
@@ -80,14 +79,6 @@ class MerchantConfigFragment : Fragment() {
passwordView.editText!!.setText(configManager.config.password)
forgetPasswordButton.visibility = if
(configManager.config.hasPassword()) VISIBLE else GONE
-
- val currency = configManager.merchantConfig?.currency
- if (currency == null) {
- currencyView.visibility = GONE
- } else {
- currencyView.text = getString(R.string.config_currency, currency)
- currencyView.visibility = VISIBLE
- }
}
private fun checkInput(): Boolean {
diff --git a/app/src/main/res/layout/fragment_merchant_settings.xml
b/app/src/main/res/layout/fragment_merchant_config.xml
similarity index 84%
rename from app/src/main/res/layout/fragment_merchant_settings.xml
rename to app/src/main/res/layout/fragment_merchant_config.xml
index 93874b8..0f0b96f 100644
--- a/app/src/main/res/layout/fragment_merchant_settings.xml
+++ b/app/src/main/res/layout/fragment_merchant_config.xml
@@ -9,7 +9,6 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_margin="16dp"
tools:context=".config.MerchantConfigFragment">
<com.google.android.material.textfield.TextInputLayout
@@ -86,27 +85,19 @@
android:id="@+id/savePasswordCheckBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_margin="16dp"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="16dp"
+ android:layout_marginBottom="16dp"
android:checked="true"
android:text="@string/config_save_password"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/passwordView" />
-
- <TextView
- android:id="@+id/currencyView"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- android:textSize="18sp"
- android:visibility="gone"
- app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/okButton"
+ app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/savePasswordCheckBox"
- tools:text="@string/config_currency"
- tools:visibility="visible" />
+ app:layout_constraintTop_toBottomOf="@+id/passwordView"
+ app:layout_constraintVertical_bias="0.0" />
- <Button
+ <com.google.android.material.button.MaterialButton
android:id="@+id/okButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -114,10 +105,9 @@
android:text="@string/config_ok"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="1.0"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/currencyView"
- app:layout_constraintVertical_bias="1.0" />
+ app:layout_constraintStart_toEndOf="@+id/savePasswordCheckBox"
+ app:layout_constraintTop_toBottomOf="@+id/passwordView"
+ app:layout_constraintVertical_bias="0.0" />
<ProgressBar
android:id="@+id/progressBar"
diff --git a/app/src/main/res/navigation/nav_graph.xml
b/app/src/main/res/navigation/nav_graph.xml
index 227cd3a..adaf1c4 100644
--- a/app/src/main/res/navigation/nav_graph.xml
+++ b/app/src/main/res/navigation/nav_graph.xml
@@ -43,7 +43,7 @@
android:id="@+id/merchantSettings"
android:name="net.taler.merchantpos.config.MerchantConfigFragment"
android:label="Merchant Settings"
- tools:layout="@layout/fragment_merchant_settings" />
+ tools:layout="@layout/fragment_merchant_config" />
<fragment
android:id="@+id/configFetcher"
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [taler-merchant-terminal-android] branch master updated (a78fac0 -> 4aa8591), gnunet, 2020/02/25
- [taler-merchant-terminal-android] 01/08: Add CI file for automatic nightly repo, gnunet, 2020/02/25
- [taler-merchant-terminal-android] 07/08: Make fragment titles translatable, gnunet, 2020/02/25
- [taler-merchant-terminal-android] 05/08: Redesign payment successful screen, gnunet, 2020/02/25
- [taler-merchant-terminal-android] 02/08: Improve config fragment: remove currency and move fetch button up,
gnunet <=
- [taler-merchant-terminal-android] 06/08: Improve display of order total, gnunet, 2020/02/25
- [taler-merchant-terminal-android] 08/08: Scroll to last added product and select it, gnunet, 2020/02/25
- [taler-merchant-terminal-android] 04/08: Show snackbars at the top of the order, not at the bottom, gnunet, 2020/02/25
- [taler-merchant-terminal-android] 03/08: Redo payment fragment and upgrade gradle/kotlin, gnunet, 2020/02/25