From c35e4a8b31cfe9d6f8970015a533fb144a90789a Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 23 Jul 2019 07:51:39 +0200 Subject: [PATCH] Added comments --- .../main/java/eu/faircode/email/ActivityView.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 35fc7bf4ce..b317b28bf2 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -152,11 +152,13 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB drawerContainer = findViewById(R.id.drawer_container); + // Accounts rvAccount = drawerContainer.findViewById(R.id.rvAccount); rvAccount.setLayoutManager(new LinearLayoutManager(this)); final AdapterNavAccount aadapter = new AdapterNavAccount(this, this); rvAccount.setAdapter(aadapter); + // Unified system folders ivExpanderUnified = drawerContainer.findViewById(R.id.ivExpanderUnified); ivExpanderUnified.setVisibility(View.GONE); @@ -182,6 +184,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB } }); + // Navigation folders rvFolder = drawerContainer.findViewById(R.id.rvFolder); rvFolder.setLayoutManager(new LinearLayoutManager(this)); final AdapterNavFolder fadapter = new AdapterNavFolder(this, this); @@ -192,6 +195,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB final AdapterNavMenu madapter = new AdapterNavMenu(this, this); rvMenu.setAdapter(madapter); + // Extra menus ivExpanderExtra = drawerContainer.findViewById(R.id.ivExpanderExtra); rvMenuExtra = drawerContainer.findViewById(R.id.rvMenuExtra); @@ -235,6 +239,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB getSupportFragmentManager().addOnBackStackChangedListener(this); + // Fixed menus + PackageManager pm = getPackageManager(); final List menus = new ArrayList<>(); @@ -280,6 +286,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB madapter.set(menus); + // Collapsible menus + List extra = new ArrayList<>(); extra.add(new NavMenuItem(R.drawable.baseline_help_24, R.string.menu_legend, new Runnable() { @@ -376,6 +384,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB eadapter.set(extra); + // Live data + DB db = DB.getInstance(this); db.account().liveAccountsEx(false).observe(this, new Observer>() { @@ -417,6 +427,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB } }); + // Initialize + if (getSupportFragmentManager().getFragments().size() == 0 && !getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT)) init();