aboutsummaryrefslogtreecommitdiff
path: root/merchant-terminal
diff options
context:
space:
mode:
Diffstat (limited to 'merchant-terminal')
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFetcherFragment.kt8
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderFragment.kt5
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentSuccessFragment.kt3
3 files changed, 9 insertions, 7 deletions
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFetcherFragment.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFetcherFragment.kt
index b5b7be7..5564447 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFetcherFragment.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigFetcherFragment.kt
@@ -22,7 +22,6 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
-import androidx.lifecycle.Observer
import com.google.android.material.snackbar.BaseTransientBottomBar.LENGTH_SHORT
import com.google.android.material.snackbar.Snackbar
import net.taler.common.navigate
@@ -46,18 +45,19 @@ class ConfigFetcherFragment : Fragment() {
return ui.root
}
+ @Deprecated("Deprecated in Java")
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
configManager.fetchConfig(configManager.config, false)
- configManager.configUpdateResult.observe(viewLifecycleOwner, Observer { result ->
+ configManager.configUpdateResult.observe(viewLifecycleOwner) { result ->
when (result) {
- null -> return@Observer
+ null -> return@observe
is ConfigUpdateResult.Error -> onNetworkError(result.msg)
is ConfigUpdateResult.Success -> {
navigate(actionConfigFetcherToOrder())
}
}
- })
+ }
}
private fun onNetworkError(msg: String) {
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderFragment.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderFragment.kt
index 25a1874..0de5939 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderFragment.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderFragment.kt
@@ -50,9 +50,10 @@ class OrderFragment : Fragment() {
return ui.root
}
+ @Deprecated("Deprecated in Java")
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
- orderManager.currentOrderId.observe(viewLifecycleOwner, { orderId ->
+ orderManager.currentOrderId.observe(viewLifecycleOwner) { orderId ->
val liveOrder = orderManager.getOrder(orderId)
onOrderSwitched(orderId, liveOrder)
// add a new OrderStateFragment for each order
@@ -60,7 +61,7 @@ class OrderFragment : Fragment() {
childFragmentManager.beginTransaction()
.replace(R.id.fragment1, OrderStateFragment())
.commit()
- })
+ }
}
override fun onStart() {
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentSuccessFragment.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentSuccessFragment.kt
index 5b95dea..c2635c7 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentSuccessFragment.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentSuccessFragment.kt
@@ -31,11 +31,12 @@ class PaymentSuccessFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
- ): View? {
+ ): View {
ui = FragmentPaymentSuccessBinding.inflate(inflater, container, false)
return ui.root
}
+ @Deprecated("Deprecated in Java")
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
ui.paymentButton.setOnClickListener {