use of de.madcyph3r.example.example.FragmentInstruction in project AdvancedMaterialDrawer by madcyph3r.
the class OnlyIconsActivity method init.
@Override
public void init(Bundle savedInstanceState) {
drawer = this;
// information text for the fragment
Bundle bundle = new Bundle();
bundle.putString("instruction", "The Menu has Only Icons");
Fragment fragmentInstruction = new FragmentInstruction();
fragmentInstruction.setArguments(bundle);
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, this.getResources().getDrawable(R.drawable.app_drawer_icon), true, new FragmentDummy(), "Fragment Section Icon Banner"));
menu.add(new MaterialItemSectionFragment(this, this.getResources().getDrawable(R.drawable.ic_extension_black_36dp), true, new FragmentDummy(), "Extension"));
menu.add(new MaterialItemSectionFragment(this, this.getResources().getDrawable(R.drawable.ic_list_black_36dp), true, new FragmentDummy(), "List"));
menu.add(new MaterialItemSectionFragment(this, this.getResources().getDrawable(R.drawable.ic_favorite_black_36dp), true, new FragmentDummy(), "Favorite").setSectionColor(Color.parseColor("#ff0858")));
// load menu
this.loadMenu(menu);
// load the MaterialItemSectionFragment, from the given startIndex
this.loadStartFragmentFromMenu(menu);
}
use of de.madcyph3r.example.example.FragmentInstruction in project AdvancedMaterialDrawer by madcyph3r.
the class NoHeaderActivity method init.
@Override
public void init(Bundle savedInstanceState) {
drawer = this;
// information text for the fragment
Bundle bundle = new Bundle();
bundle.putString("instruction", "This example has no header in the drawer. " + "Call " + "setCustomMenu(), to set your menu.");
Fragment fragmentInstruction = new FragmentInstruction();
fragmentInstruction.setArguments(bundle);
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "No Header"));
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);
}
use of de.madcyph3r.example.example.FragmentInstruction in project AdvancedMaterialDrawer by madcyph3r.
the class NoHeaderBelowToolbarActivity method init.
@Override
public void init(Bundle savedInstanceState) {
drawer = this;
// information text for the fragment
Bundle bundle = new Bundle();
bundle.putString("instruction", "This example has no header in the drawer. " + "The drawer is shown under the toolbar. " + "Call " + "setCustomMenu(), to set your menu.");
Fragment fragmentInstruction = new FragmentInstruction();
fragmentInstruction.setArguments(bundle);
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "No Header Below Toolbar"));
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);
}
use of de.madcyph3r.example.example.FragmentInstruction in project AdvancedMaterialDrawer by madcyph3r.
the class LightThemeActivity 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 light theme. You can set the light theme to the application " + "or activity tag in the AndroidManifest.xml . See android:theme=\"@style/MaterialNavigationDrawerTheme.Light\" in the " + "activity tag for this activity.");
Fragment fragmentInstruction = new FragmentInstruction();
fragmentInstruction.setArguments(bundle);
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "Light Theme"));
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);
}
use of de.madcyph3r.example.example.FragmentInstruction in project AdvancedMaterialDrawer by madcyph3r.
the class BackPatternCustomActivity 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 custom back pattern. " + "Go to 'Section 2' and then press back. It will open section 1 and then instruction and then" + " it goes back to the latest activity.");
Fragment fragmentInstruction = new FragmentInstruction();
fragmentInstruction.setArguments(bundle);
// create menu
MaterialMenu menu = new MaterialMenu();
menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "Custom Back Pattern"));
menu.add(new MaterialItemSectionFragment(this, "Section 1", new FragmentDummy(), "Section 1"));
menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
// 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_CUSTOM);
}
Aggregations