]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
whitespace
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / MainActivity.java
index 2fc09379873faa8d030c094c709a9451270f568e..d0517b8a481271b8f53f5b0af901eb2054f52702 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -54,7 +54,9 @@ import net.ktnx.mobileledger.model.Data;
 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;
@@ -293,7 +295,7 @@ public class MainActivity extends ProfileThemedActivity {
                      if (error == null)
                          return;
 
-                     Snackbar.make(b.mainPager, error, Snackbar.LENGTH_LONG)
+                     Snackbar.make(b.mainPager, error, Snackbar.LENGTH_INDEFINITE)
                              .show();
                      mainModel.clearUpdateError();
                  });
@@ -301,6 +303,13 @@ public class MainActivity extends ProfileThemedActivity {
         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();