Java files and their corresponding XML layout files:
- MainActivity.java
- nav_drawer_base.xml
- This file contains the xml for Navigation drawer and menu layout. It also contains the FrameLayout used as the canvas for the app content.
- BaseFragment.java
- MainFragment.java
- main_frag.xml
- This layout file is wrapped in a CoordinatorLayout
- Toolbar to replace the default ActionBar,
- TabLayout bar for tabbing, and a
- ViewPager element to support
How to get the main_fragment layout swapped into the container view slot:
How to get the Navigation Drawer working:
DrawerLayout drawer = listener.getDrawer();ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(ACA, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);toggle.syncState();drawer.setDrawerListener(toggle);
navigationView.setNavigationItemSelectedListener(this);
//swap home bar and give it a title
ACA.setSupportActionBar(toolbar);ACA.getSupportActionBar().setTitle("WASSUP");