diff options
3 files changed, 9 insertions, 8 deletions
diff --git a/cashier/src/main/java/net/taler/cashier/BalanceFragment.kt b/cashier/src/main/java/net/taler/cashier/BalanceFragment.kt index b246e9f..4fd3143 100644 --- a/cashier/src/main/java/net/taler/cashier/BalanceFragment.kt +++ b/cashier/src/main/java/net/taler/cashier/BalanceFragment.kt @@ -54,19 +54,19 @@ class BalanceFragment : Fragment() { override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?, - ): View? { + ): View { setHasOptionsMenu(true) ui = FragmentBalanceBinding.inflate(layoutInflater, container, false) return ui.root } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - withdrawManager.lastTransaction.observe(viewLifecycleOwner, { lastTransaction -> + withdrawManager.lastTransaction.observe(viewLifecycleOwner) { lastTransaction -> onLastTransaction(lastTransaction) - }) - viewModel.balance.observe(viewLifecycleOwner, { result -> + } + viewModel.balance.observe(viewLifecycleOwner) { result -> onBalanceUpdated(result) - }) + } ui.button5.setOnClickListener { onAmountButtonPressed(5) } ui.button10.setOnClickListener { onAmountButtonPressed(10) } ui.button20.setOnClickListener { onAmountButtonPressed(20) } @@ -81,9 +81,9 @@ class BalanceFragment : Fragment() { true } else false } - configManager.currency.observe(viewLifecycleOwner, { currency -> + configManager.currency.observe(viewLifecycleOwner) { currency -> ui.currencyView.text = currency - }) + } ui.confirmWithdrawalButton.setOnClickListener { onAmountConfirmed(getAmountFromView()) } } diff --git a/cashier/src/main/java/net/taler/cashier/MainActivity.kt b/cashier/src/main/java/net/taler/cashier/MainActivity.kt index 2f4c4ec..aacc225 100644 --- a/cashier/src/main/java/net/taler/cashier/MainActivity.kt +++ b/cashier/src/main/java/net/taler/cashier/MainActivity.kt @@ -52,6 +52,7 @@ class MainActivity : AppCompatActivity() { } } + @Deprecated("Deprecated in Java") override fun onBackPressed() { if (!configManager.hasConfig() && nav.currentDestination?.id == R.id.configFragment) { // we are in the configuration screen and need a config to continue diff --git a/cashier/src/main/java/net/taler/cashier/withdraw/ErrorFragment.kt b/cashier/src/main/java/net/taler/cashier/withdraw/ErrorFragment.kt index 07b7415..c951bb8 100644 --- a/cashier/src/main/java/net/taler/cashier/withdraw/ErrorFragment.kt +++ b/cashier/src/main/java/net/taler/cashier/withdraw/ErrorFragment.kt @@ -37,7 +37,7 @@ class ErrorFragment : Fragment() { override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?, - ): View? { + ): View { ui = FragmentErrorBinding.inflate(inflater, container, false) return ui.root } |