taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

commit 699367b94f6ff17e673f0d06287389a548da2a46
parent afeddc3f665297904a8a06c152a67fec6bb13217
Author: Torsten Grote <t@grobox.de>
Date:   Tue, 23 Aug 2022 14:59:37 -0300

[wallet] Fix lint error

Diffstat:
Mwallet/build.gradle | 5+----
Mwallet/lint.xml | 1+
Dwallet/src/androidTest/java/net/taler/wallet/ExampleInstrumentedTest.kt | 38--------------------------------------
Mwallet/src/main/java/net/taler/wallet/settings/SettingsFragment.kt | 10+++-------
Mwallet/src/main/java/net/taler/wallet/withdraw/manual/ManualWithdrawFragment.kt | 2+-
Mwallet/src/test/java/net/taler/wallet/tip/TipResponsesTest.kt | 14++------------
6 files changed, 8 insertions(+), 62 deletions(-)

diff --git a/wallet/build.gradle b/wallet/build.gradle @@ -109,11 +109,9 @@ android { lint { abortOnError true - ignore 'WrongConstant' ignoreWarnings false } namespace 'net.taler.wallet' - } dependencies { @@ -198,4 +196,4 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" } -} -\ No newline at end of file +} diff --git a/wallet/lint.xml b/wallet/lint.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <lint> <issue id="MissingTranslation" severity="ignore" /> + <issue id="ExtraTranslation" severity="ignore" /> <issue id="all"> <ignore path="fastlane" /> </issue> diff --git a/wallet/src/androidTest/java/net/taler/wallet/ExampleInstrumentedTest.kt b/wallet/src/androidTest/java/net/taler/wallet/ExampleInstrumentedTest.kt @@ -1,38 +0,0 @@ -/* - * This file is part of GNU Taler - * (C) 2020 Taler Systems S.A. - * - * GNU Taler is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 3, or (at your option) any later version. - * - * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -package net.taler.wallet - -import androidx.test.InstrumentationRegistry -import androidx.test.runner.AndroidJUnit4 -import org.junit.Assert.assertEquals -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getTargetContext() - assertEquals("net.taler.wallet", appContext.packageName) - } -} diff --git a/wallet/src/main/java/net/taler/wallet/settings/SettingsFragment.kt b/wallet/src/main/java/net/taler/wallet/settings/SettingsFragment.kt @@ -19,7 +19,6 @@ package net.taler.wallet.settings import android.os.Bundle import android.view.View import android.widget.Toast -import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AlertDialog import androidx.fragment.app.activityViewModels import androidx.preference.Preference @@ -65,11 +64,6 @@ class SettingsFragment : PreferenceFragmentCompat() { ) } - val createDocumentActivity = - registerForActivityResult(ActivityResultContracts.CreateDocument()) { uri -> - - } - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.settings_main, rootKey) prefBackup = findPreference("pref_backup")!! @@ -123,7 +117,9 @@ class SettingsFragment : PreferenceFragmentCompat() { prefLogcat.setOnPreferenceClickListener { val toast = - Toast.makeText(requireActivity(), "Log export currently unavailable", Toast.LENGTH_LONG) + Toast.makeText(requireActivity(), + "Log export currently unavailable", + Toast.LENGTH_LONG) toast.show() // val myPid = android.os.Process.myPid() diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/manual/ManualWithdrawFragment.kt b/wallet/src/main/java/net/taler/wallet/withdraw/manual/ManualWithdrawFragment.kt @@ -1,6 +1,6 @@ /* * This file is part of GNU Taler - * (C) 2020 Taler Systems S.A. + * (C) 2022 Taler Systems S.A. * * GNU Taler is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software diff --git a/wallet/src/test/java/net/taler/wallet/tip/TipResponsesTest.kt b/wallet/src/test/java/net/taler/wallet/tip/TipResponsesTest.kt @@ -14,12 +14,10 @@ * GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -package net.taler.wallet.payment +package net.taler.wallet.tip import kotlinx.serialization.json.Json import net.taler.common.Amount -import net.taler.wallet.tip.ConfirmTipResult -import net.taler.wallet.tip.PrepareTipResponse import org.junit.Test class TipResponsesTest { @@ -38,16 +36,9 @@ class TipResponsesTest { "result": {} } """.trimIndent() - val response = json.decodeFromString(ConfirmTipResult.serializer(), jsonStr) - response as ConfirmTipResult - assert(response != null) + json.decodeFromString(ConfirmTipResult.serializer(), jsonStr) } -/* - -*/ - - @Test fun testTipPossibleSerializer() { val jsonStr = """ @@ -69,7 +60,6 @@ class TipResponsesTest { assert(response.tipAmountEffective == Amount(currency = "ARS", fraction = 40000000, value = 1)) } - @Test fun testTipAcceptedSerializer() { val jsonStr = """