Search in sources :

Example 1 with FragmentActionBarOverlay

use of de.madcyph3r.example.example.theme.actionBarOverlayActivity.FragmentActionBarOverlay in project AdvancedMaterialDrawer by madcyph3r.

the class ActionBarOverlayActivity method init.

@Override
public void init(Bundle savedInstanceState) {
    drawer = this;
    // information text for the fragment
    Bundle bundle = new Bundle();
    bundle.putString("instruction", "Open the menu and press the section 'Show Overlay', to see it." + " To add overlay support, see 'android:theme=\"@style/ActionBarOverlayTheme\"' in the AndroidManifest.xml and the" + " part for this activity." + " The style is defined in the styles.xml with the name ActionBarOverlayTheme. " + "Or set it on runtime. For this, see the source code from this example.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "Actionbar Overlay"));
    menu.add(new MaterialItemSectionFragment(this, "Show Overlay", new FragmentActionBarOverlay(), "Show Overlay"));
    menu.add(new MaterialItemDevisor());
    menu.add(new MaterialItemSectionFragment(this, "Section 1", new FragmentDummy(), "Section 1"));
    menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
    menu.add(new MaterialItemSectionFragment(this, "Section 3", new FragmentDummy(), "Section 3"));
    // load menu
    this.loadMenu(menu);
    // load the MaterialItemSectionFragment, from the given startIndex
    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) FragmentDummy(de.madcyph3r.example.example.FragmentDummy) FragmentInstruction(de.madcyph3r.example.example.FragmentInstruction) Fragment(android.support.v4.app.Fragment) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) FragmentActionBarOverlay(de.madcyph3r.example.example.theme.actionBarOverlayActivity.FragmentActionBarOverlay)

Aggregations

Bundle (android.os.Bundle)1 Fragment (android.support.v4.app.Fragment)1 FragmentDummy (de.madcyph3r.example.example.FragmentDummy)1 FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)1 FragmentActionBarOverlay (de.madcyph3r.example.example.theme.actionBarOverlayActivity.FragmentActionBarOverlay)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