diff options
author | Torsten Grote <t@grobox.de> | 2020-04-16 13:37:45 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-04-16 13:37:45 -0300 |
commit | 0682c6b3d3f7cef22725f3db15916346fdc4529e (patch) | |
tree | 7f521a8b4f2520a7a83e84cc3c34d261c88a14c9 /wallet/src/main/java/net/taler/wallet/Utils.kt | |
parent | ea2abcac101645e429cab734c726e3b6a744dae9 (diff) | |
download | taler-android-0682c6b3d3f7cef22725f3db15916346fdc4529e.tar.gz taler-android-0682c6b3d3f7cef22725f3db15916346fdc4529e.tar.bz2 taler-android-0682c6b3d3f7cef22725f3db15916346fdc4529e.zip |
[wallet] change main screen if there is only one currency
If there is more than one currency, the screen shows a list of balances
per currency like it used to.
If there is only one currency, the main screen directly shows the list
of transactions with the balance in the toolbar.
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/Utils.kt')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/Utils.kt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/Utils.kt b/wallet/src/main/java/net/taler/wallet/Utils.kt index ae8712f..b41a202 100644 --- a/wallet/src/main/java/net/taler/wallet/Utils.kt +++ b/wallet/src/main/java/net/taler/wallet/Utils.kt @@ -16,6 +16,17 @@ package net.taler.wallet +import android.app.Activity +import com.google.zxing.integration.android.IntentIntegrator + +fun scanQrCode(activity: Activity) { + IntentIntegrator(activity).apply { + setPrompt("") + setBeepEnabled(true) + setOrientationLocked(false) + }.initiateScan(listOf(IntentIntegrator.QR_CODE)) +} + fun cleanExchange(exchange: String) = exchange.let { if (it.startsWith("https://")) it.substring(8) else it }.trimEnd('/') |