summaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/transactions
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-04-16 13:37:45 -0300
committerTorsten Grote <t@grobox.de>2020-04-16 13:37:45 -0300
commit0682c6b3d3f7cef22725f3db15916346fdc4529e (patch)
tree7f521a8b4f2520a7a83e84cc3c34d261c88a14c9 /wallet/src/main/java/net/taler/wallet/transactions
parentea2abcac101645e429cab734c726e3b6a744dae9 (diff)
downloadtaler-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/transactions')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt6
1 files changed, 3 insertions, 3 deletions
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 4f62547..0d6e9ce 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
@@ -30,7 +30,6 @@ import androidx.fragment.app.activityViewModels
import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.DividerItemDecoration
-import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager.VERTICAL
import kotlinx.android.synthetic.main.fragment_transactions.*
import net.taler.common.fadeIn
@@ -46,6 +45,7 @@ class TransactionsFragment : Fragment(), OnEventClickListener {
private val model: MainViewModel by activityViewModels()
private val transactionManager by lazy { model.transactionManager }
+
private val transactionAdapter by lazy { TransactionAdapter(model.devMode.value == true, this) }
private val currency by lazy { transactionManager.selectedCurrency!! }
@@ -63,7 +63,6 @@ class TransactionsFragment : Fragment(), OnEventClickListener {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
list.apply {
- layoutManager = LinearLayoutManager(context)
adapter = transactionAdapter
addItemDecoration(DividerItemDecoration(context, VERTICAL))
}
@@ -102,7 +101,7 @@ class TransactionsFragment : Fragment(), OnEventClickListener {
override fun onEventClicked(event: Transaction) {
if (event.detailPageLayout != 0) {
transactionManager.selectedEvent = event
- findNavController().navigate(R.id.action_nav_transactions_to_nav_transaction_detail)
+ findNavController().navigate(R.id.action_nav_transaction_detail)
} else if (model.devMode.value == true) {
JsonDialogFragment.new(event.json.toString(2))
.show(parentFragmentManager, null)
@@ -118,6 +117,7 @@ class TransactionsFragment : Fragment(), OnEventClickListener {
is TransactionsResult.Success -> {
emptyState.visibility = if (result.transactions.isEmpty()) VISIBLE else INVISIBLE
transactionAdapter.update(result.transactions)
+ list.fadeIn()
}
}