aboutsummaryrefslogtreecommitdiff
path: root/merchant-terminal/src/main
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-09-07 11:28:22 -0300
committerTorsten Grote <t@grobox.de>2020-09-07 11:28:22 -0300
commitd78c2003df1db7af448de1c91449201020109190 (patch)
tree32e7c231f05e3f15438e8cae8d157a7f7e5aee75 /merchant-terminal/src/main
parent01acacaecdde368c73414fce86cf320a7fbbddbc (diff)
downloadtaler-android-d78c2003df1db7af448de1c91449201020109190.tar.gz
taler-android-d78c2003df1db7af448de1c91449201020109190.tar.bz2
taler-android-d78c2003df1db7af448de1c91449201020109190.zip
[pos] show snackbar at the bottom instead of top (should resolve UI issues)
Diffstat (limited to 'merchant-terminal/src/main')
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/Utils.kt6
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt4
2 files changed, 5 insertions, 5 deletions
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/Utils.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/Utils.kt
index 578debf..137dd37 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/Utils.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/Utils.kt
@@ -18,15 +18,13 @@ package net.taler.merchantpos
import android.view.View
import androidx.annotation.StringRes
+import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.snackbar.BaseTransientBottomBar.ANIMATION_MODE_FADE
import com.google.android.material.snackbar.BaseTransientBottomBar.Duration
import com.google.android.material.snackbar.Snackbar.make
fun topSnackbar(view: View, text: CharSequence, @Duration duration: Int) {
- make(view, text, duration)
- .setAnimationMode(ANIMATION_MODE_FADE)
- .setAnchorView(R.id.navHostFragment)
- .show()
+ make(view, text, duration).show()
}
fun topSnackbar(view: View, @StringRes resId: Int, @Duration duration: Int) {
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt
index af340f1..b017726 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt
@@ -117,7 +117,9 @@ class PaymentManager(
}
}
}
- mPayment.value = mPayment.value!!.copy(error = error)
+ mPayment.value?.copy(error = error)?.let {
+ mPayment.value = it
+ }
checkTimer.cancel()
checkJob?.isCancelled
checkJob = null