Added comments

This commit is contained in:
M66B 2019-07-23 07:51:39 +02:00
parent 8489ca28d5
commit c35e4a8b31
1 changed files with 12 additions and 0 deletions

View File

@ -152,11 +152,13 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
drawerContainer = findViewById(R.id.drawer_container); drawerContainer = findViewById(R.id.drawer_container);
// Accounts
rvAccount = drawerContainer.findViewById(R.id.rvAccount); rvAccount = drawerContainer.findViewById(R.id.rvAccount);
rvAccount.setLayoutManager(new LinearLayoutManager(this)); rvAccount.setLayoutManager(new LinearLayoutManager(this));
final AdapterNavAccount aadapter = new AdapterNavAccount(this, this); final AdapterNavAccount aadapter = new AdapterNavAccount(this, this);
rvAccount.setAdapter(aadapter); rvAccount.setAdapter(aadapter);
// Unified system folders
ivExpanderUnified = drawerContainer.findViewById(R.id.ivExpanderUnified); ivExpanderUnified = drawerContainer.findViewById(R.id.ivExpanderUnified);
ivExpanderUnified.setVisibility(View.GONE); 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 = drawerContainer.findViewById(R.id.rvFolder);
rvFolder.setLayoutManager(new LinearLayoutManager(this)); rvFolder.setLayoutManager(new LinearLayoutManager(this));
final AdapterNavFolder fadapter = new AdapterNavFolder(this, 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); final AdapterNavMenu madapter = new AdapterNavMenu(this, this);
rvMenu.setAdapter(madapter); rvMenu.setAdapter(madapter);
// Extra menus
ivExpanderExtra = drawerContainer.findViewById(R.id.ivExpanderExtra); ivExpanderExtra = drawerContainer.findViewById(R.id.ivExpanderExtra);
rvMenuExtra = drawerContainer.findViewById(R.id.rvMenuExtra); rvMenuExtra = drawerContainer.findViewById(R.id.rvMenuExtra);
@ -235,6 +239,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
getSupportFragmentManager().addOnBackStackChangedListener(this); getSupportFragmentManager().addOnBackStackChangedListener(this);
// Fixed menus
PackageManager pm = getPackageManager(); PackageManager pm = getPackageManager();
final List<NavMenuItem> menus = new ArrayList<>(); final List<NavMenuItem> menus = new ArrayList<>();
@ -280,6 +286,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
madapter.set(menus); madapter.set(menus);
// Collapsible menus
List<NavMenuItem> extra = new ArrayList<>(); List<NavMenuItem> extra = new ArrayList<>();
extra.add(new NavMenuItem(R.drawable.baseline_help_24, R.string.menu_legend, new Runnable() { 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); eadapter.set(extra);
// Live data
DB db = DB.getInstance(this); DB db = DB.getInstance(this);
db.account().liveAccountsEx(false).observe(this, new Observer<List<TupleAccountEx>>() { db.account().liveAccountsEx(false).observe(this, new Observer<List<TupleAccountEx>>() {
@ -417,6 +427,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
} }
}); });
// Initialize
if (getSupportFragmentManager().getFragments().size() == 0 && if (getSupportFragmentManager().getFragments().size() == 0 &&
!getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT)) !getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT))
init(); init();