Search in sources :

Example 1 with FragmentActionBarButtons

use of de.madcyph3r.example.example.functionally.actionBarButtonsActivity.FragmentActionBarButtons in project AdvancedMaterialDrawer by madcyph3r.

the class ActionBarButtonsActivity method init.

@Override
public void init(Bundle savedInstanceState) {
    drawer = this;
    // information text for the fragment
    Bundle bundle = new Bundle();
    bundle.putString("instruction", "Open the drawer and choose the section \"Change Actionbar Buttons Section\". \" +\n" + "                \"Now you get a view, there you can change the actionbar button.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "Change/Hide Actionbar Button"));
    menu.add(new MaterialItemDevisor());
    menu.add(new MaterialItemSectionFragment(this, "Change Actionbar Button", new FragmentActionBarButtons(), "Change Actionbar Button"));
    //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) FragmentActionBarButtons(de.madcyph3r.example.example.functionally.actionBarButtonsActivity.FragmentActionBarButtons) FragmentInstruction(de.madcyph3r.example.example.FragmentInstruction) Fragment(android.support.v4.app.Fragment) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)

Aggregations

Bundle (android.os.Bundle)1 Fragment (android.support.v4.app.Fragment)1 FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)1 FragmentActionBarButtons (de.madcyph3r.example.example.functionally.actionBarButtonsActivity.FragmentActionBarButtons)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