summaryrefslogtreecommitdiff
path: root/app/src/main/java/net
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/net')
-rw-r--r--app/src/main/java/net/taler/wallet/AlreadyPaid.kt20
-rw-r--r--app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt16
-rw-r--r--app/src/main/java/net/taler/wallet/MainActivity.kt17
-rw-r--r--app/src/main/java/net/taler/wallet/PaymentSuccessful.kt29
-rw-r--r--app/src/main/java/net/taler/wallet/PromptPayment.kt27
-rw-r--r--app/src/main/java/net/taler/wallet/PromptWithdraw.kt16
-rw-r--r--app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt16
-rw-r--r--app/src/main/java/net/taler/wallet/Settings.kt23
-rw-r--r--app/src/main/java/net/taler/wallet/ShowBalance.kt16
-rw-r--r--app/src/main/java/net/taler/wallet/WalletHistory.kt16
-rw-r--r--app/src/main/java/net/taler/wallet/WalletViewModel.kt18
-rw-r--r--app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt16
-rw-r--r--app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt17
-rw-r--r--app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt17
14 files changed, 236 insertions, 28 deletions
diff --git a/app/src/main/java/net/taler/wallet/AlreadyPaid.kt b/app/src/main/java/net/taler/wallet/AlreadyPaid.kt
index 40903f9..65785b9 100644
--- a/app/src/main/java/net/taler/wallet/AlreadyPaid.kt
+++ b/app/src/main/java/net/taler/wallet/AlreadyPaid.kt
@@ -1,5 +1,20 @@
-package net.taler.wallet
+/*
+ This file is part of GNU Taler
+ (C) 2019 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 android.os.Bundle
import androidx.fragment.app.Fragment
@@ -10,7 +25,8 @@ import android.widget.Button
import androidx.navigation.findNavController
/**
- * A simple [Fragment] subclass.
+ * Display the message that the user already paid for the order
+ * that the merchant is proposing.
*/
class AlreadyPaid : Fragment() {
diff --git a/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt b/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt
index 9134df4..77f3153 100644
--- a/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt
+++ b/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt
@@ -1,3 +1,19 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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 android.content.*
diff --git a/app/src/main/java/net/taler/wallet/MainActivity.kt b/app/src/main/java/net/taler/wallet/MainActivity.kt
index b3090b8..5ea96a0 100644
--- a/app/src/main/java/net/taler/wallet/MainActivity.kt
+++ b/app/src/main/java/net/taler/wallet/MainActivity.kt
@@ -1,3 +1,20 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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
diff --git a/app/src/main/java/net/taler/wallet/PaymentSuccessful.kt b/app/src/main/java/net/taler/wallet/PaymentSuccessful.kt
index 039fa73..6332c39 100644
--- a/app/src/main/java/net/taler/wallet/PaymentSuccessful.kt
+++ b/app/src/main/java/net/taler/wallet/PaymentSuccessful.kt
@@ -1,22 +1,33 @@
-package net.taler.wallet
+/*
+ This file is part of GNU Taler
+ (C) 2019 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 android.os.Bundle
-import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
+import androidx.fragment.app.Fragment
import androidx.navigation.findNavController
-// TODO: Rename parameter arguments, choose names that match
-// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
-private const val ARG_PARAM1 = "param1"
-private const val ARG_PARAM2 = "param2"
-
/**
- * A simple [Fragment] subclass.
+ * Fragment that shows the success message for a payment.
*
*/
class PaymentSuccessful : Fragment() {
@@ -32,6 +43,4 @@ class PaymentSuccessful : Fragment() {
}
return view
}
-
-
}
diff --git a/app/src/main/java/net/taler/wallet/PromptPayment.kt b/app/src/main/java/net/taler/wallet/PromptPayment.kt
index e9652be..42a9b39 100644
--- a/app/src/main/java/net/taler/wallet/PromptPayment.kt
+++ b/app/src/main/java/net/taler/wallet/PromptPayment.kt
@@ -1,5 +1,20 @@
-package net.taler.wallet
+/*
+ This file is part of GNU Taler
+ (C) 2019 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 android.annotation.SuppressLint
import android.os.Bundle
@@ -17,8 +32,7 @@ import com.google.android.material.snackbar.Snackbar
import me.zhanghai.android.materialprogressbar.MaterialProgressBar
/**
- * A simple [Fragment] subclass.
- *
+ * Show a payment and ask the user to accept/decline.
*/
class PromptPayment : Fragment() {
@@ -28,8 +42,7 @@ class PromptPayment : Fragment() {
private fun triggerLoading() {
val loading = model.payStatus.value == null || (model.payStatus.value is PayStatus.Loading)
- val myActivity = activity!!
- val progressBar = myActivity.findViewById<MaterialProgressBar>(R.id.progress_bar)
+ val progressBar = requireActivity().findViewById<MaterialProgressBar>(R.id.progress_bar)
if (loading) {
progressBar.visibility = View.VISIBLE
} else {
@@ -43,8 +56,6 @@ class PromptPayment : Fragment() {
model = activity?.run {
ViewModelProviders.of(this)[WalletViewModel::class.java]
} ?: throw Exception("Invalid Activity")
-
- triggerLoading()
}
override fun onResume() {
@@ -139,7 +150,7 @@ class PromptPayment : Fragment() {
triggerLoading()
- model.payStatus.observe(this, Observer {
+ model.payStatus.observe(viewLifecycleOwner, Observer {
triggerLoading()
showPayStatus(view, it)
})
diff --git a/app/src/main/java/net/taler/wallet/PromptWithdraw.kt b/app/src/main/java/net/taler/wallet/PromptWithdraw.kt
index 57965f5..0e0e680 100644
--- a/app/src/main/java/net/taler/wallet/PromptWithdraw.kt
+++ b/app/src/main/java/net/taler/wallet/PromptWithdraw.kt
@@ -1,3 +1,19 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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 android.annotation.SuppressLint
diff --git a/app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt b/app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt
index 542b855..ffde82e 100644
--- a/app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt
+++ b/app/src/main/java/net/taler/wallet/ReviewExchangeTOS.kt
@@ -1,3 +1,19 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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
diff --git a/app/src/main/java/net/taler/wallet/Settings.kt b/app/src/main/java/net/taler/wallet/Settings.kt
index bf67f56..46bf2e3 100644
--- a/app/src/main/java/net/taler/wallet/Settings.kt
+++ b/app/src/main/java/net/taler/wallet/Settings.kt
@@ -1,5 +1,20 @@
-package net.taler.wallet
+/*
+ This file is part of GNU Taler
+ (C) 2019 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 android.os.Bundle
import androidx.fragment.app.Fragment
@@ -9,12 +24,6 @@ import android.view.ViewGroup
import android.widget.Button
import androidx.lifecycle.ViewModelProviders
-
-// TODO: Rename parameter arguments, choose names that match
-// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
-private const val ARG_PARAM1 = "param1"
-private const val ARG_PARAM2 = "param2"
-
/**
* A simple [Fragment] subclass.
*
diff --git a/app/src/main/java/net/taler/wallet/ShowBalance.kt b/app/src/main/java/net/taler/wallet/ShowBalance.kt
index 81de260..5d4c35e 100644
--- a/app/src/main/java/net/taler/wallet/ShowBalance.kt
+++ b/app/src/main/java/net/taler/wallet/ShowBalance.kt
@@ -1,3 +1,19 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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
diff --git a/app/src/main/java/net/taler/wallet/WalletHistory.kt b/app/src/main/java/net/taler/wallet/WalletHistory.kt
index d5cd3b6..20e6688 100644
--- a/app/src/main/java/net/taler/wallet/WalletHistory.kt
+++ b/app/src/main/java/net/taler/wallet/WalletHistory.kt
@@ -1,3 +1,19 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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
diff --git a/app/src/main/java/net/taler/wallet/WalletViewModel.kt b/app/src/main/java/net/taler/wallet/WalletViewModel.kt
index 1ae9a80..9e93fcf 100644
--- a/app/src/main/java/net/taler/wallet/WalletViewModel.kt
+++ b/app/src/main/java/net/taler/wallet/WalletViewModel.kt
@@ -1,3 +1,19 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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 android.app.Application
@@ -205,7 +221,7 @@ class WalletViewModel(val app: Application) : AndroidViewModel(app) {
Log.v(TAG, "got history entry $h")
val type = h.getString("type")
Log.v(TAG, "got history entry type $type")
- val detail = h.getJSONObject("detail")
+ val detail = h
val timestamp = h.getJSONObject("timestamp")
historyEntries.add(HistoryEntry(detail, type, timestamp))
}
diff --git a/app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt b/app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt
index c16dced..127f8f7 100644
--- a/app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt
+++ b/app/src/main/java/net/taler/wallet/WithdrawSuccessful.kt
@@ -1,3 +1,19 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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
diff --git a/app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt b/app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
index 1c5b170..36795f5 100644
--- a/app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
+++ b/app/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
@@ -1,3 +1,20 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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.backend
import android.app.Application
diff --git a/app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt b/app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt
index 65cbeaf..297f0f7 100644
--- a/app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt
+++ b/app/src/main/java/net/taler/wallet/backend/WalletBackendService.kt
@@ -1,3 +1,20 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 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.backend
import akono.AkonoJni