diff options
Diffstat (limited to 'cashier/src/main/java/net')
-rw-r--r-- | cashier/src/main/java/net/taler/cashier/BalanceFragment.kt | 6 | ||||
-rw-r--r-- | cashier/src/main/java/net/taler/cashier/MainViewModel.kt | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/cashier/src/main/java/net/taler/cashier/BalanceFragment.kt b/cashier/src/main/java/net/taler/cashier/BalanceFragment.kt index 1114080..541bca2 100644 --- a/cashier/src/main/java/net/taler/cashier/BalanceFragment.kt +++ b/cashier/src/main/java/net/taler/cashier/BalanceFragment.kt @@ -62,10 +62,10 @@ class BalanceFragment : Fragment() { } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - withdrawManager.lastTransaction.observe(viewLifecycleOwner, Observer { lastTransaction -> + withdrawManager.lastTransaction.observe(viewLifecycleOwner, { lastTransaction -> onLastTransaction(lastTransaction) }) - viewModel.balance.observe(viewLifecycleOwner, Observer { result -> + viewModel.balance.observe(viewLifecycleOwner, { result -> onBalanceUpdated(result) }) ui.button5.setOnClickListener { onAmountButtonPressed(5) } @@ -82,7 +82,7 @@ class BalanceFragment : Fragment() { true } else false } - configManager.currency.observe(viewLifecycleOwner, Observer { 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/MainViewModel.kt b/cashier/src/main/java/net/taler/cashier/MainViewModel.kt index 2cce8cd..253c7d5 100644 --- a/cashier/src/main/java/net/taler/cashier/MainViewModel.kt +++ b/cashier/src/main/java/net/taler/cashier/MainViewModel.kt @@ -69,7 +69,7 @@ class MainViewModel(private val app: Application) : AndroidViewModel(app) { val result = when (val response = makeJsonGetRequest(url, config)) { is HttpJsonResult.Success -> { try { - val balanceObj = response.json.getJSONObject("balance"); + val balanceObj = response.json.getJSONObject("balance") val balanceAmount = balanceObj.getString("amount") val positive = when (val creditDebitIndicator = balanceObj.getString("credit_debit_indicator")) { |