diff options
Diffstat (limited to 'cashier/src/main')
4 files changed, 8 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 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")) { diff --git a/cashier/src/main/res/layout-w550dp/fragment_balance.xml b/cashier/src/main/res/layout-w550dp/fragment_balance.xml index 40fa6af..bcfffc7 100644 --- a/cashier/src/main/res/layout-w550dp/fragment_balance.xml +++ b/cashier/src/main/res/layout-w550dp/fragment_balance.xml @@ -27,13 +27,13 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:background="?attr/colorPrimaryDark" - android:drawableStart="@drawable/ic_check_circle" android:drawablePadding="8dp" - android:drawableTint="?attr/colorOnPrimarySurface" android:gravity="center_vertical" android:padding="8dp" android:textColor="?attr/colorOnPrimarySurface" android:visibility="gone" + app:drawableStartCompat="@drawable/ic_check_circle" + app:drawableTint="?attr/colorOnPrimarySurface" app:layout_constraintEnd_toStartOf="@+id/guideline" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" diff --git a/cashier/src/main/res/layout/fragment_balance.xml b/cashier/src/main/res/layout/fragment_balance.xml index fcd0e0a..5a11b2a 100644 --- a/cashier/src/main/res/layout/fragment_balance.xml +++ b/cashier/src/main/res/layout/fragment_balance.xml @@ -27,13 +27,13 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:background="?attr/colorPrimaryDark" - android:drawableStart="@drawable/ic_check_circle" android:drawablePadding="8dp" - android:drawableTint="?attr/colorOnPrimarySurface" android:gravity="center_vertical" android:padding="8dp" android:textColor="?attr/colorOnPrimarySurface" android:visibility="gone" + app:drawableStartCompat="@drawable/ic_check_circle" + app:drawableTint="?attr/colorOnPrimarySurface" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" |