From 56c84b5e933b47432215d78b59b5a7bda1091a71 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 15 Dec 2018 19:33:31 +0000 Subject: [PATCH] instance-wide dbg --- .../java/net/ktnx/mobileledger/TransactionListActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java b/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java index 497a1d2e..9ef8fce2 100644 --- a/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java @@ -60,6 +60,8 @@ public class TransactionListActivity extends AppCompatActivity { setupActionBar(); + MobileLedgerDatabase dbh = new MobileLedgerDatabase(this); + swiper = findViewById(R.id.transaction_swipe); if (swiper == null) throw new RuntimeException("Can't get hold on the swipe layout"); root = findViewById(R.id.transaction_root); @@ -84,14 +86,14 @@ public class TransactionListActivity extends AppCompatActivity { } } model = ViewModelProviders.of(this).get(TransactionListViewModel.class); - List transactions = - model.getTransactions(new MobileLedgerDatabase(this)); + List transactions = model.getTransactions(dbh); modelAdapter = new TransactionListAdapter(transactions); RecyclerView root = findViewById(R.id.transaction_root); root.setAdapter(modelAdapter); LinearLayoutManager llm = new LinearLayoutManager(this); + llm.setOrientation(LinearLayoutManager.VERTICAL); root.setLayoutManager(llm); -- 2.39.5