use of de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu 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);
}
use of de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu in project AdvancedMaterialDrawer by madcyph3r.
the class HeadItem100StaticBackgroundActivity method getHeadItem1.
private MaterialHeadItem getHeadItem1() {
// information text for the fragment
Bundle bundle = new Bundle();
bundle.putString("instruction", "This example shows the head item style with five items. " + "The first three head items ar shown with a picture. To get the other head items, " + "press the down arrow button in the header. " + "Under the items, you see the extra menu. ");
Fragment fragmentInstruction = new FragmentInstruction();
fragmentInstruction.setArguments(bundle);
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "100 static HeadItems"));
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"));
// create Head Item
// use bitmap and make a circle photo
final Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.app_drawer_icon);
final RoundedCornersDrawable drawableAppIcon = new RoundedCornersDrawable(getResources(), bitmap);
MaterialHeadItem headItem = new MaterialHeadItem(this, "A HeadItem", "A Subtitle", drawableAppIcon, menu);
return headItem;
}
use of de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu in project AdvancedMaterialDrawer by madcyph3r.
the class HeadItemFiveDontCloseOnChangeActivity method getHeadItem5.
private MaterialHeadItem getHeadItem5() {
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 5)", new FragmentDummy(), "Section 1 (Head 5)"));
menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
// create Head Item
TextDrawable headPhoto = TextDrawable.builder().buildRound("E", Color.GRAY);
MaterialHeadItem headItem = new MaterialHeadItem(this, "E HeadItem", "E Subtitle", headPhoto, R.drawable.mat6, menu);
// don't close the drawer, if this head item chosen
headItem.setCloseDrawerOnChanged(false);
return headItem;
}
use of de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu in project AdvancedMaterialDrawer by madcyph3r.
the class HeadItemFiveDontCloseOnChangeActivity method getHeadItem4.
private MaterialHeadItem getHeadItem4() {
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 4)", new FragmentDummy(), "Section 1 (Head 4)"));
menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
// create Head Item
TextDrawable headPhoto = TextDrawable.builder().buildRound("D", Color.GRAY);
MaterialHeadItem headItem = new MaterialHeadItem(this, "D HeadItem", "D Subtitle", headPhoto, R.drawable.mat6, menu);
// don't close the drawer, if this head item chosen
headItem.setCloseDrawerOnChanged(false);
return headItem;
}
use of de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu in project AdvancedMaterialDrawer by madcyph3r.
the class HeadItemFiveDontCloseOnChangeActivity method getHeadItem3.
private MaterialHeadItem getHeadItem3() {
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 3)", new FragmentDummy(), "Section 1 (Head 3)"));
menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
// create Head Item
TextDrawable headPhoto = TextDrawable.builder().buildRound("C", Color.GRAY);
MaterialHeadItem headItem = new MaterialHeadItem(this, "C HeadItem", "C Subtitle", headPhoto, R.drawable.mat6, menu);
// don't close the drawer, if this head item chosen
headItem.setCloseDrawerOnChanged(false);
return headItem;
}
Aggregations