[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-android] branch master updated (757b1db -> 86b1647)
From: |
gnunet |
Subject: |
[taler-taler-android] branch master updated (757b1db -> 86b1647) |
Date: |
Wed, 17 Aug 2022 19:41:27 +0200 |
This is an automated email from the git hooks/post-receive script.
torsten-grote pushed a change to branch master
in repository taler-android.
from 757b1db [cashier] show error message when bank is reporting
mismatching currencies
new ec08d9f [wallet] upgrade core to v0.9.0-dev.12
new 86b1647 [wallet] Show FAB also in transaction list when having more
than one currency
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.idea/gradle.xml | 1 -
wallet/build.gradle | 4 +--
.../src/main/java/net/taler/wallet/MainActivity.kt | 8 +++---
.../src/main/java/net/taler/wallet/MainFragment.kt | 8 +++---
.../net/taler/wallet/balances/BalancesFragment.kt | 6 ++---
.../wallet/transactions/TransactionsFragment.kt | 31 +++++++++++++---------
.../src/main/res/layout/fragment_transactions.xml | 9 +++++++
wallet/src/main/res/navigation/nav_graph.xml | 6 ++++-
8 files changed, 46 insertions(+), 27 deletions(-)
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 2277df3..4b336ce 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -19,7 +19,6 @@
<option value="$PROJECT_DIR$/wallet" />
</set>
</option>
- <option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
diff --git a/wallet/build.gradle b/wallet/build.gradle
index ae3266c..33d6124 100644
--- a/wallet/build.gradle
+++ b/wallet/build.gradle
@@ -23,8 +23,8 @@ plugins {
id "de.undercouch.download"
}
-def walletCoreVersion = "v0.9.0-dev.11"
-def walletCoreSha256 =
"0ee5eae7d0afd6f251f7d33975758055d06926ccb67ae9099d589a79d34be39d"
+def walletCoreVersion = "v0.9.0-dev.12"
+def walletCoreSha256 =
"647a82384a57ec23777439259b030da17101a8e754a85bd6c4b32e60a4d158ef"
static def versionCodeEpoch() {
return (new Date().getTime() / 1000).toInteger()
diff --git a/wallet/src/main/java/net/taler/wallet/MainActivity.kt
b/wallet/src/main/java/net/taler/wallet/MainActivity.kt
index baf0609..0e04f44 100644
--- a/wallet/src/main/java/net/taler/wallet/MainActivity.kt
+++ b/wallet/src/main/java/net/taler/wallet/MainActivity.kt
@@ -94,19 +94,19 @@ class MainActivity : AppCompatActivity(),
OnNavigationItemSelectedListener,
)
ui.content.toolbar.setupWithNavController(nav, appBarConfiguration)
- model.showProgressBar.observe(this, { show ->
+ model.showProgressBar.observe(this) { show ->
ui.content.progressBar.visibility = if (show) VISIBLE else
INVISIBLE
- })
+ }
val versionView: TextView =
ui.navView.getHeaderView(0).findViewById(R.id.versionView)
- model.devMode.observe(this, { enabled ->
+ model.devMode.observe(this) { enabled ->
ui.navView.menu.findItem(R.id.nav_dev).isVisible = enabled
if (enabled) {
@SuppressLint("SetTextI18n")
versionView.text = "$VERSION_NAME ($VERSION_CODE)"
versionView.visibility = VISIBLE
} else versionView.visibility = GONE
- })
+ }
if (intent.action == ACTION_VIEW) intent.dataString?.let { uri ->
handleTalerUri(uri, "intent")
diff --git a/wallet/src/main/java/net/taler/wallet/MainFragment.kt
b/wallet/src/main/java/net/taler/wallet/MainFragment.kt
index 1479bc0..6c84925 100644
--- a/wallet/src/main/java/net/taler/wallet/MainFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/MainFragment.kt
@@ -43,16 +43,16 @@ class MainFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
+ savedInstanceState: Bundle?,
+ ): View {
ui = FragmentMainBinding.inflate(inflater, container, false)
return ui.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- model.balances.observe(viewLifecycleOwner, {
+ model.balances.observe(viewLifecycleOwner) {
onBalancesChanged(it)
- })
+ }
model.transactionsEvent.observe(viewLifecycleOwner, EventObserver {
currency ->
// we only need to navigate to a dedicated list, when in
multi-currency mode
if (currencyMode == MULTI) {
diff --git a/wallet/src/main/java/net/taler/wallet/balances/BalancesFragment.kt
b/wallet/src/main/java/net/taler/wallet/balances/BalancesFragment.kt
index afd9a23..c1be674 100644
--- a/wallet/src/main/java/net/taler/wallet/balances/BalancesFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/balances/BalancesFragment.kt
@@ -48,7 +48,7 @@ class BalancesFragment : Fragment(),
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
- ): View? {
+ ): View {
ui = FragmentBalancesBinding.inflate(inflater, container, false)
return ui.root
}
@@ -59,9 +59,9 @@ class BalancesFragment : Fragment(),
addItemDecoration(DividerItemDecoration(context, VERTICAL))
}
- model.balances.observe(viewLifecycleOwner, {
+ model.balances.observe(viewLifecycleOwner) {
onBalancesChanged(it)
- })
+ }
}
private fun onBalancesChanged(balances: List<BalanceItem>) {
diff --git
a/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
b/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
index e63d451..ff2574f 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
@@ -23,6 +23,7 @@ import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import android.view.View
+import android.view.View.INVISIBLE
import android.view.ViewGroup
import android.widget.Toast
import android.widget.Toast.LENGTH_LONG
@@ -42,6 +43,7 @@ import net.taler.common.fadeOut
import net.taler.wallet.MainViewModel
import net.taler.wallet.R
import net.taler.wallet.databinding.FragmentTransactionsBinding
+import net.taler.wallet.scanQrCode
interface OnTransactionClickListener {
fun onTransactionClicked(transaction: Transaction)
@@ -65,8 +67,8 @@ class TransactionsFragment : Fragment(),
OnTransactionClickListener, ActionMode.
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
+ savedInstanceState: Bundle?,
+ ): View {
ui = FragmentTransactionsBinding.inflate(inflater, container, false)
return ui.root
}
@@ -103,22 +105,27 @@ class TransactionsFragment : Fragment(),
OnTransactionClickListener, ActionMode.
}
})
- transactionManager.progress.observe(viewLifecycleOwner, { show ->
- if (show) ui.progressBar.fadeIn() else ui.progressBar.fadeOut()
- })
- transactionManager.transactions.observe(viewLifecycleOwner, { result ->
- onTransactionsResult(result)
- })
- }
-
- override fun onActivityCreated(savedInstanceState: Bundle?) {
- super.onActivityCreated(savedInstanceState)
model.balances.observe(viewLifecycleOwner) { balances ->
+ // hide extra fab when in single currency mode (uses
MainFragment's FAB)
+ if (balances.size == 1) ui.mainFab.visibility = INVISIBLE
balances.find { it.currency == currency }?.available?.let {
amount: Amount ->
requireActivity().title =
getString(R.string.transactions_detail_title_balance,
amount)
}
}
+ transactionManager.progress.observe(viewLifecycleOwner) { show ->
+ if (show) ui.progressBar.fadeIn() else ui.progressBar.fadeOut()
+ }
+ transactionManager.transactions.observe(viewLifecycleOwner) { result ->
+ onTransactionsResult(result)
+ }
+ ui.mainFab.setOnClickListener {
+ scanQrCode(requireActivity())
+ }
+ ui.mainFab.setOnLongClickListener {
+
findNavController().navigate(R.id.action_nav_transactions_to_nav_uri_input)
+ true
+ }
}
override fun onSaveInstanceState(outState: Bundle) {
diff --git a/wallet/src/main/res/layout/fragment_transactions.xml
b/wallet/src/main/res/layout/fragment_transactions.xml
index aaf638c..22d6d48 100644
--- a/wallet/src/main/res/layout/fragment_transactions.xml
+++ b/wallet/src/main/res/layout/fragment_transactions.xml
@@ -48,4 +48,13 @@
android:visibility="invisible"
tools:visibility="visible" />
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/mainFab"
+ style="@style/FabStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/button_scan_qr_code"
+ android:src="@drawable/ic_scan_qr"
+
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
/>
+
</FrameLayout>
diff --git a/wallet/src/main/res/navigation/nav_graph.xml
b/wallet/src/main/res/navigation/nav_graph.xml
index b3f96c5..f0048d9 100644
--- a/wallet/src/main/res/navigation/nav_graph.xml
+++ b/wallet/src/main/res/navigation/nav_graph.xml
@@ -118,7 +118,11 @@
android:id="@+id/nav_transactions"
android:name="net.taler.wallet.transactions.TransactionsFragment"
android:label="@string/transactions_title"
- tools:layout="@layout/fragment_transactions" />
+ tools:layout="@layout/fragment_transactions" >
+ <action
+ android:id="@+id/action_nav_transactions_to_nav_uri_input"
+ app:destination="@id/nav_uri_input" />
+ </fragment>
<fragment
android:id="@+id/nav_transactions_detail_withdrawal"
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-android] branch master updated (757b1db -> 86b1647),
gnunet <=