Search in sources :

Example 1 with MasterFragment

use of de.madcyph3r.example.example.functionally.masterChildNavActivity.MasterFragment in project AdvancedMaterialDrawer by madcyph3r.

the class MasterChildNavActivity method init.

@Override
public void init(Bundle savedInstanceState) {
    drawer = this;
    // information text for the fragment
    Bundle bundle = new Bundle();
    bundle.putString("instruction", "This example shows a master child navigation. At the child in 'Master 2' you can open the menu with sliding." + "At the child in 'Master 1' the menu is locked. You can't open it.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "Master Child Navigation"));
    menu.add(new MaterialItemDevisor());
    menu.add(new MaterialItemSectionFragment(this, "Master 1", new MasterFragment(), "Master 1"));
    menu.add(new MaterialItemSectionFragment(this, "Master 2", new MasterFragment2(), "Master 2"));
    // load menu
    this.loadMenu(menu);
    // load first MaterialItemSectionFragment in the menu, because there is no start position
    this.loadStartFragmentFromMenu(menu);
}
Also used : MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) Bundle(android.os.Bundle) MaterialItemDevisor(de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) FragmentInstruction(de.madcyph3r.example.example.FragmentInstruction) MasterFragment(de.madcyph3r.example.example.functionally.masterChildNavActivity.MasterFragment) Fragment(android.support.v4.app.Fragment) MasterFragment(de.madcyph3r.example.example.functionally.masterChildNavActivity.MasterFragment) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) MasterFragment2(de.madcyph3r.example.example.functionally.masterChildNavActivity.MasterFragment2)

Aggregations

Bundle (android.os.Bundle)1 Fragment (android.support.v4.app.Fragment)1 FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)1 MasterFragment (de.madcyph3r.example.example.functionally.masterChildNavActivity.MasterFragment)1 MasterFragment2 (de.madcyph3r.example.example.functionally.masterChildNavActivity.MasterFragment2)1 MaterialMenu (de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu)1 MaterialItemSectionFragment (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)1 MaterialItemDevisor (de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor)1