X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2FTransactionListActivity.java;h=fcaf9d5f9bc48ee3d64f616c820ee5362b27aa21;hb=be608a16168cd370022a42463e51b4ce202c8a1e;hp=1dc5f026d900cb9961805e5465855dbc93febf40;hpb=a983099d6150044a08a1fbc601d9af9bd8d0c0a8;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java b/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java index 1dc5f026..fcaf9d5f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java @@ -95,11 +95,13 @@ public class TransactionListActivity extends AppCompatActivity { llm.setOrientation(LinearLayoutManager.VERTICAL); root.setLayoutManager(llm); - ((SwipeRefreshLayout) findViewById(R.id.transaction_swipe)).setOnRefreshListener(() -> { + swiper.setOnRefreshListener(() -> { Log.d("ui", "refreshing transactions via swipe"); update_transactions(); }); + swiper.setColorSchemeResources(R.color.colorPrimary, R.color.colorAccent); + // update_transactions(); } private void setupActionBar() { @@ -149,13 +151,13 @@ public class TransactionListActivity extends AppCompatActivity { public void onRetrieveDone(boolean success) { progressBar.setVisibility(View.GONE); - SwipeRefreshLayout srl = findViewById(R.id.transaction_swipe); - srl.setRefreshing(false); + swiper.setRefreshing(false); if (success) { MobileLedgerDatabase dbh = new MobileLedgerDatabase(this); Date now = new Date(); dbh.set_option_value("transaction_list_last_update", now.getTime()); updateLastUpdateText(now); + modelAdapter.notifyDataSetChanged(); } } private void updateLastUpdateText(Date now) {