Search in sources :

Example 21 with FragmentInstruction

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);
}
Also used : MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) Bundle(android.os.Bundle) 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)

Example 22 with FragmentInstruction

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);
}
Also used : MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) Bundle(android.os.Bundle) 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)

Example 23 with FragmentInstruction

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);
}
Also used : MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) Bundle(android.os.Bundle) 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)

Example 24 with FragmentInstruction

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);
}
Also used : MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) Bundle(android.os.Bundle) 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)

Example 25 with FragmentInstruction

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);
}
Also used : MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) Bundle(android.os.Bundle) 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)

Aggregations

FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)49 MaterialMenu (de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu)49 MaterialItemSectionFragment (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)49 Bundle (android.os.Bundle)48 Fragment (android.support.v4.app.Fragment)48 FragmentDummy (de.madcyph3r.example.example.FragmentDummy)43 Bitmap (android.graphics.Bitmap)17 MaterialHeadItem (de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem)17 RoundedCornersDrawable (de.madcyph3r.materialnavigationdrawer.tools.RoundedCornersDrawable)17 MaterialItemDevisor (de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor)11 View (android.view.View)6 MaterialItemSection (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSection)5 MaterialItemLabel (de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemLabel)5 Intent (android.content.Intent)3 MaterialSectionOnClickListener (de.madcyph3r.materialnavigationdrawer.listener.MaterialSectionOnClickListener)3 MaterialItemSectionActivity (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionActivity)3 MaterialItemSectionOnClick (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionOnClick)3 MaterialSectionChangeListener (de.madcyph3r.materialnavigationdrawer.listener.MaterialSectionChangeListener)2 DrawerLayout (android.support.v4.widget.DrawerLayout)1 ImageView (android.widget.ImageView)1