Search in sources :

Example 1 with MenuFragment

use of de.madcyph3r.example.fragment.MenuFragment in project AdvancedMaterialDrawer by madcyph3r.

the class MainActivity method init.

@Override
public void init(Bundle savedInstanceState) {
    drawer = this;
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", new FragmentInstruction(), "Instruction"));
    menu.add(new MaterialItemDevisor());
    menu.add(new MaterialItemLabel(this, "Examples"));
    menu.add(new MaterialItemSectionFragment(this, "Theme", new ThemeFragment(), "Theme").setSectionColor(Color.parseColor("#ff0000")));
    menu.add(new MaterialItemSectionFragment(this, "Drawer Types", new DrawerTypesFragment(), "Drawer Types").setSectionColor(Color.parseColor("#D35400")));
    menu.add(new MaterialItemSectionFragment(this, "Header Types", new HeaderTypesFragment(), "Header Types").setSectionColor(Color.parseColor("#01AEA1")));
    menu.add(new MaterialItemSectionFragment(this, "Head Item Types", new HeadItemTypesFragment(), "Header Types").setSectionColor(Color.parseColor("#9B59B6")));
    menu.add(new MaterialItemSectionFragment(this, "Menu", new MenuFragment(), "Menu").setSectionColor(Color.parseColor("#3498DB")));
    menu.add(new MaterialItemSectionFragment(this, "Back Pattern", new BackPatternFragment(), "Back Pattern").setSectionColor(Color.parseColor("#3CD876")));
    menu.add(new MaterialItemSectionFragment(this, "Listener", new ListenerFragment(), "Listener").setSectionColor(Color.parseColor("#9D8C84")));
    menu.add(new MaterialItemSectionFragment(this, "Functionally", new FunctionallyFragment(), "Functionally").setSectionColor(Color.parseColor("#F1C40F")));
    // actionbar overlay
    this.setActionBarOverlay(true);
    // load menu
    this.loadMenu(menu);
    // load first MaterialItemSectionFragment in the menu, because there is no start position
    this.loadStartFragmentFromMenu(menu);
    // set back pattern
    this.setBackPattern(MaterialNavigationDrawer.BACKPATTERN_LAST_SECTION_FRAGMENT);
}
Also used : HeaderTypesFragment(de.madcyph3r.example.fragment.HeaderTypesFragment) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) DrawerTypesFragment(de.madcyph3r.example.fragment.DrawerTypesFragment) FunctionallyFragment(de.madcyph3r.example.fragment.FunctionallyFragment) FragmentInstruction(de.madcyph3r.example.example.FragmentInstruction) BackPatternFragment(de.madcyph3r.example.fragment.BackPatternFragment) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) MenuFragment(de.madcyph3r.example.fragment.MenuFragment) MaterialItemDevisor(de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor) MaterialItemLabel(de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemLabel) HeadItemTypesFragment(de.madcyph3r.example.fragment.HeadItemTypesFragment) ListenerFragment(de.madcyph3r.example.fragment.ListenerFragment) ThemeFragment(de.madcyph3r.example.fragment.ThemeFragment)

Aggregations

FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)1 BackPatternFragment (de.madcyph3r.example.fragment.BackPatternFragment)1 DrawerTypesFragment (de.madcyph3r.example.fragment.DrawerTypesFragment)1 FunctionallyFragment (de.madcyph3r.example.fragment.FunctionallyFragment)1 HeadItemTypesFragment (de.madcyph3r.example.fragment.HeadItemTypesFragment)1 HeaderTypesFragment (de.madcyph3r.example.fragment.HeaderTypesFragment)1 ListenerFragment (de.madcyph3r.example.fragment.ListenerFragment)1 MenuFragment (de.madcyph3r.example.fragment.MenuFragment)1 ThemeFragment (de.madcyph3r.example.fragment.ThemeFragment)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 MaterialItemLabel (de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemLabel)1