diff options
Diffstat (limited to 'wallet')
-rw-r--r-- | wallet/build.gradle | 7 | ||||
-rw-r--r-- | wallet/fastlane/Fastfile | 2 | ||||
-rw-r--r-- | wallet/proguard-rules.pro | 1 | ||||
-rw-r--r-- | wallet/src/main/AndroidManifest.xml | 5 | ||||
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/UriInputFragment.kt | 5 | ||||
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/Utils.kt | 20 | ||||
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt | 7 | ||||
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt | 2 | ||||
-rw-r--r-- | wallet/src/main/res/layout/fragment_transaction_withdrawal.xml | 2 | ||||
-rw-r--r-- | wallet/src/main/res/layout/fragment_uri_input.xml | 2 | ||||
-rw-r--r-- | wallet/src/main/res/layout/list_item_exchange.xml | 3 | ||||
-rw-r--r-- | wallet/src/main/res/layout/list_item_transaction.xml | 3 |
12 files changed, 24 insertions, 35 deletions
diff --git a/wallet/build.gradle b/wallet/build.gradle index b5720be..02123ee 100644 --- a/wallet/build.gradle +++ b/wallet/build.gradle @@ -45,7 +45,7 @@ android { defaultConfig { applicationId "net.taler.wallet" - minSdkVersion 24 + minSdkVersion 21 targetSdkVersion 29 versionCode 8 versionName "v0.8.0-rc.3" @@ -82,6 +82,9 @@ android { compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 + + // Flag to enable support for the new language APIs for zxing + coreLibraryDesugaringEnabled true } kotlinOptions { @@ -129,6 +132,8 @@ dependencies { // QR codes implementation 'com.journeyapps:zxing-android-embedded:4.0.2@aar' + // needed to support zxing library in taler-kotlin-android on API < 24 + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10' // Nicer ProgressBar implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1' diff --git a/wallet/fastlane/Fastfile b/wallet/fastlane/Fastfile index 3c2f8cd..695540c 100644 --- a/wallet/fastlane/Fastfile +++ b/wallet/fastlane/Fastfile @@ -42,7 +42,7 @@ platform :android do skip_upload_images: 'true', skip_upload_screenshots: 'true', skip_upload_apk: 'true', # This is an app bundle, so APK is not possible - validate_only: 'true' + validate_only: 'false' ) end end diff --git a/wallet/proguard-rules.pro b/wallet/proguard-rules.pro index 27f3799..ca6bc15 100644 --- a/wallet/proguard-rules.pro +++ b/wallet/proguard-rules.pro @@ -22,4 +22,5 @@ -keep class akono.AkonoJni {*;} +#noinspection ShrinkerUnresolvedReference -keep class net.taler.wallet.** {*;} diff --git a/wallet/src/main/AndroidManifest.xml b/wallet/src/main/AndroidManifest.xml index e2a79da..b011583 100644 --- a/wallet/src/main/AndroidManifest.xml +++ b/wallet/src/main/AndroidManifest.xml @@ -32,14 +32,15 @@ <application android:allowBackup="true" + android:extractNativeLibs="true" android:fullBackupContent="@xml/backup_descriptor" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" - android:extractNativeLibs="true" - tools:ignore="GoogleAppIndexingWarning"> + tools:ignore="GoogleAppIndexingWarning" + tools:targetApi="m"> <activity android:name=".MainActivity" diff --git a/wallet/src/main/java/net/taler/wallet/UriInputFragment.kt b/wallet/src/main/java/net/taler/wallet/UriInputFragment.kt index d17977b..f4a5f23 100644 --- a/wallet/src/main/java/net/taler/wallet/UriInputFragment.kt +++ b/wallet/src/main/java/net/taler/wallet/UriInputFragment.kt @@ -26,6 +26,7 @@ import android.view.View import android.view.ViewGroup import android.widget.Toast import android.widget.Toast.LENGTH_LONG +import androidx.core.content.getSystemService import androidx.fragment.app.Fragment import net.taler.wallet.databinding.FragmentUriInputBinding @@ -43,10 +44,10 @@ class UriInputFragment : Fragment() { } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - val clipboard = requireContext().getSystemService(ClipboardManager::class.java)!! + val clipboard = requireContext().getSystemService<ClipboardManager>() ui.pasteButton.setOnClickListener { - val item = clipboard.primaryClip?.getItemAt(0) + val item = clipboard?.primaryClip?.getItemAt(0) if (item?.text != null) { ui.uriView.setText(item.text) } else { diff --git a/wallet/src/main/java/net/taler/wallet/Utils.kt b/wallet/src/main/java/net/taler/wallet/Utils.kt index ea01552..388bf61 100644 --- a/wallet/src/main/java/net/taler/wallet/Utils.kt +++ b/wallet/src/main/java/net/taler/wallet/Utils.kt @@ -29,8 +29,8 @@ import android.os.Build.VERSION.SDK_INT import android.widget.Toast import android.widget.Toast.LENGTH_LONG import androidx.annotation.RequiresApi +import androidx.core.content.getSystemService import com.google.zxing.integration.android.IntentIntegrator -import org.json.JSONObject fun scanQrCode(activity: Activity) { IntentIntegrator(activity).apply { @@ -69,7 +69,7 @@ private fun connectToWifi29(context: Context, ssid: String) { @Suppress("DEPRECATION") private fun connectToWifiDeprecated(context: Context, ssid: String) { - context.getSystemService(WifiManager::class.java)?.apply { + context.getSystemService<WifiManager>()?.apply { if (!isWifiEnabled) { val enabledResult = setWifiEnabled(true) while (enabledResult && !isWifiEnabled) Thread.sleep(25) @@ -91,22 +91,6 @@ private fun connectToWifiDeprecated(context: Context, ssid: String) { } } -fun getErrorString(json: JSONObject): String { - return StringBuilder().apply { - append(json.getString("talerErrorCode")) - append(" ") - append(json.getString("message")) - json.optJSONObject("details")?.let { details -> - details.optJSONObject("errorResponse")?.let { errorResponse -> - append("\n\n") - append(errorResponse.optString("code")) - append(" ") - append(errorResponse.optString("hint")) - } - } - }.toString() -} - fun cleanExchange(exchange: String) = exchange.let { if (it.startsWith("https://")) it.substring(8) else it }.trimEnd('/') diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt index 936bbbd..5e492f5 100644 --- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt +++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt @@ -25,6 +25,7 @@ import android.view.View.VISIBLE import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView +import androidx.core.content.ContextCompat.getColor import androidx.recyclerview.selection.ItemDetailsLookup import androidx.recyclerview.selection.ItemKeyProvider import androidx.recyclerview.selection.SelectionTracker @@ -80,13 +81,11 @@ internal class TransactionAdapter( private val amount: TextView = v.findViewById(R.id.amount) private val pendingView: TextView = v.findViewById(R.id.pendingView) - private val selectableForeground = v.foreground private val amountColor = amount.currentTextColor - private val red = context.getColor(R.color.red) - private val green = context.getColor(R.color.green) + private val red = getColor(context, R.color.red) + private val green = getColor(context, R.color.green) fun bind(transaction: Transaction, selected: Boolean) { - v.foreground = selectableForeground v.setOnClickListener { listener.onTransactionClicked(transaction) } v.isActivated = selected if (transaction.error == null) { diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt b/wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt index 4b56dd0..f368c68 100644 --- a/wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt +++ b/wallet/src/main/java/net/taler/wallet/withdraw/ManualWithdrawFragment.kt @@ -53,7 +53,7 @@ class ManualWithdrawFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { ui.qrCodeButton.setOnClickListener { scanQrCode(requireActivity()) } ui.currencyView.text = exchangeItem.currency - val paymentOptions = exchangeItem.paytoUris.mapNotNull {paytoUri -> + val paymentOptions = exchangeItem.paytoUris.mapNotNull { paytoUri -> Uri.parse(paytoUri).authority?.toUpperCase(Locale.getDefault()) }.joinToString(separator = "\n", prefix = "• ") ui.paymentOptionsLabel.text = diff --git a/wallet/src/main/res/layout/fragment_transaction_withdrawal.xml b/wallet/src/main/res/layout/fragment_transaction_withdrawal.xml index 5a1e82f..8fe3247 100644 --- a/wallet/src/main/res/layout/fragment_transaction_withdrawal.xml +++ b/wallet/src/main/res/layout/fragment_transaction_withdrawal.xml @@ -60,8 +60,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableLeft="@drawable/ic_account_balance" - android:drawableTint="?attr/colorOnPrimarySurface" android:text="@string/withdraw_button_confirm_bank" + app:drawableTint="?attr/colorOnPrimarySurface" app:layout_constraintBottom_toTopOf="@+id/chosenAmountLabel" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/wallet/src/main/res/layout/fragment_uri_input.xml b/wallet/src/main/res/layout/fragment_uri_input.xml index 60155e3..1e9934f 100644 --- a/wallet/src/main/res/layout/fragment_uri_input.xml +++ b/wallet/src/main/res/layout/fragment_uri_input.xml @@ -51,8 +51,8 @@ android:layout_marginEnd="16dp" android:layout_weight="1" android:drawableLeft="@drawable/ic_content_paste" - android:drawableTint="?attr/colorOnPrimarySurface" android:text="@string/paste" + app:drawableTint="?attr/colorOnPrimarySurface" app:layout_constraintEnd_toStartOf="@+id/okButton" app:layout_constraintHorizontal_chainStyle="spread_inside" app:layout_constraintStart_toStartOf="parent" diff --git a/wallet/src/main/res/layout/list_item_exchange.xml b/wallet/src/main/res/layout/list_item_exchange.xml index c9d1df4..d81e759 100644 --- a/wallet/src/main/res/layout/list_item_exchange.xml +++ b/wallet/src/main/res/layout/list_item_exchange.xml @@ -19,8 +19,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/selectable_background" - android:foreground="?attr/selectableItemBackground" + android:background="?attr/selectableItemBackground" android:paddingTop="16dp" android:paddingBottom="16dp"> diff --git a/wallet/src/main/res/layout/list_item_transaction.xml b/wallet/src/main/res/layout/list_item_transaction.xml index 239e656..ed031c3 100644 --- a/wallet/src/main/res/layout/list_item_transaction.xml +++ b/wallet/src/main/res/layout/list_item_transaction.xml @@ -19,8 +19,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/selectable_background" - android:foreground="?attr/selectableItemBackground" + android:background="?attr/selectableItemBackground" android:paddingStart="16dp" android:paddingTop="8dp" android:paddingEnd="16dp" |