/*
- * Copyright © 2020 Damyan Ivanov.
+ * Copyright © 2021 Damyan Ivanov.
* This file is part of MoLe.
* MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
import net.ktnx.mobileledger.model.MobileLedgerProfile;
import net.ktnx.mobileledger.ui.MainModel;
import net.ktnx.mobileledger.ui.account_summary.AccountSummaryFragment;
+import net.ktnx.mobileledger.ui.new_transaction.NewTransactionActivity;
import net.ktnx.mobileledger.ui.profiles.ProfilesRecyclerViewAdapter;
+import net.ktnx.mobileledger.ui.templates.TemplatesActivity;
import net.ktnx.mobileledger.ui.transaction_list.TransactionListFragment;
import net.ktnx.mobileledger.utils.Colors;
import net.ktnx.mobileledger.utils.Logger;
if (error == null)
return;
- Snackbar.make(b.mainPager, error, Snackbar.LENGTH_LONG)
+ Snackbar.make(b.mainPager, error, Snackbar.LENGTH_INDEFINITE)
.show();
mainModel.clearUpdateError();
});
Data.lastUpdateDate.observe(this, date -> refreshLastUpdateInfo());
Data.lastUpdateTransactionCount.observe(this, date -> refreshLastUpdateInfo());
Data.lastUpdateAccountCount.observe(this, date -> refreshLastUpdateInfo());
+ b.navAccountSummary.setOnClickListener(this::onAccountSummaryClicked);
+ b.navLatestTransactions.setOnClickListener(this::onLatestTransactionsClicked);
+ b.navPatterns.setOnClickListener(this::onPatternsClick);
+ }
+ private void onPatternsClick(View view) {
+ Intent intent = new Intent(this, TemplatesActivity.class);
+ startActivity(intent);
}
private void scheduleDataRetrievalIfStale(long lastUpdate) {
long now = new Date().getTime();