Search in sources :

Example 1 with MaterialItemDevisor

use of de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor in project AdvancedMaterialDrawer by madcyph3r.

the class NoClosePrevDrawerActivity_Activity 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 'start activity' section. Then press back, \" +\n" + "                \"you will get back to this activity.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "No Close Previous Drawer Activity"));
    menu.add(new MaterialItemDevisor());
    menu.add(new MaterialItemSectionActivity(this, "start Activity", new Intent(this, NoCloseActivity.class)));
    // load menu
    this.loadMenu(menu);
    // load first MaterialItemSectionFragment in the menu, because there is no start position
    this.loadStartFragmentFromMenu(menu);
}
Also used : MaterialItemSectionActivity(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionActivity) 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) Intent(android.content.Intent) FragmentInstruction(de.madcyph3r.example.example.FragmentInstruction) Fragment(android.support.v4.app.Fragment) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)

Example 2 with MaterialItemDevisor

use of de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor in project AdvancedMaterialDrawer by madcyph3r.

the class HeadItemOneBlackThemeActivity 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 the head item style with the white theme.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "HeadItem Black Style (One Item)"));
    menu.add(new MaterialItemDevisor());
    menu.add(new MaterialItemSectionFragment(this, "Section 1", new FragmentDummy(), "Section 1"));
    menu.add(new MaterialItemLabel(this, "other sections"));
    menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
    menu.add(new MaterialItemSectionFragment(this, "Section 3", new FragmentDummy(), "Section 3"));
    // create Head Item
    // use bitmap and make a circle photo
    final Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.head_item_icon);
    final RoundedCornersDrawable drawableAppIcon = new RoundedCornersDrawable(getResources(), bitmap);
    MaterialHeadItem headItem = new MaterialHeadItem(this, "My HeadItem", "My Subtitle", drawableAppIcon, R.drawable.mat1, menu);
    this.addHeadItem(headItem);
    // load menu
    this.loadMenu(getCurrentHeadItem().getMenu());
    // load the MaterialItemSectionFragment, from the given startIndex
    this.loadStartFragmentFromMenu(getCurrentHeadItem().getMenu());
}
Also used : Bitmap(android.graphics.Bitmap) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) Bundle(android.os.Bundle) RoundedCornersDrawable(de.madcyph3r.materialnavigationdrawer.tools.RoundedCornersDrawable) MaterialItemDevisor(de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) MaterialHeadItem(de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem) FragmentDummy(de.madcyph3r.example.example.FragmentDummy) MaterialItemLabel(de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemLabel) FragmentInstruction(de.madcyph3r.example.example.FragmentInstruction) Fragment(android.support.v4.app.Fragment) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)

Example 3 with MaterialItemDevisor

use of de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor in project AdvancedMaterialDrawer by madcyph3r.

the class MultiPaneSupportActivity method init.

@Override
public void init(Bundle savedInstanceState) {
    drawer = this;
    // information text for the fragment
    Bundle bundle = new Bundle();
    bundle.putString("instruction", "If you have a tablet, the drawer will be always shown. See " + "the styles.xml for the tablet support.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "MultiPane (Tablet) Support"));
    menu.add(new MaterialItemDevisor());
    menu.add(new MaterialItemLabel(this, "Sections"));
    menu.add(new MaterialItemSectionFragment(this, "Section 1", new FragmentDummy(), "Section 1"));
    //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) MaterialItemLabel(de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemLabel) 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)

Example 4 with MaterialItemDevisor

use of de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor in project AdvancedMaterialDrawer by madcyph3r.

the class MultiPaneSupportBelowToolbarActivity method init.

@Override
public void init(Bundle savedInstanceState) {
    drawer = this;
    // information text for the fragment
    Bundle bundle = new Bundle();
    bundle.putString("instruction", "If you have a tablet, the drawer will be always shown under the toolbar.\" +\n" + "                \" See the styles.xml for the tablet and below toolbar support.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "MultiPane (Tablet) And Below ToolBar Support"));
    menu.add(new MaterialItemDevisor());
    menu.add(new MaterialItemLabel(this, "Sections"));
    menu.add(new MaterialItemSectionFragment(this, "Section 1", new FragmentDummy(), "Section 1"));
    //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) MaterialItemLabel(de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemLabel) 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)

Example 5 with MaterialItemDevisor

use of de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor 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

MaterialItemDevisor (de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor)12 FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)11 MaterialMenu (de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu)11 MaterialItemSectionFragment (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)11 Bundle (android.os.Bundle)10 Fragment (android.support.v4.app.Fragment)10 FragmentDummy (de.madcyph3r.example.example.FragmentDummy)6 MaterialItemLabel (de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemLabel)6 Intent (android.content.Intent)3 MaterialItemSection (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSection)3 MaterialItemSectionActivity (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionActivity)3 View (android.view.View)2 MaterialSectionOnClickListener (de.madcyph3r.materialnavigationdrawer.listener.MaterialSectionOnClickListener)2 MaterialItemCustom (de.madcyph3r.materialnavigationdrawer.menu.item.custom.MaterialItemCustom)2 MaterialItemSectionOnClick (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionOnClick)2 SuppressLint (android.annotation.SuppressLint)1 Bitmap (android.graphics.Bitmap)1 ImageView (android.widget.ImageView)1 FragmentActionBarButtons (de.madcyph3r.example.example.functionally.actionBarButtonsActivity.FragmentActionBarButtons)1 MasterFragment (de.madcyph3r.example.example.functionally.masterChildNavActivity.MasterFragment)1