Search in sources :

Example 11 with FragmentDummy

use of de.madcyph3r.example.example.FragmentDummy in project AdvancedMaterialDrawer by madcyph3r.

the class CustomHeaderActivity method init.

@Override
public void init(Bundle savedInstanceState) {
    drawer = this;
    // Important: see example_custom_header.xml . android:fitsSystemWindows="true" is important,
    // otherwise the statusbar overlays the custom header
    // information text for the fragment
    Bundle bundle = new Bundle();
    bundle.putString("instruction", "This example has an custom header in the drawer. " + "Call setCustomHeader(), to set your custom header.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "Custom 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);
    // create and set the recycleview_header
    View view = LayoutInflater.from(this).inflate(R.layout.example_custom_header, null);
    this.setCustomHeader(view, 150);
}
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) View(android.view.View)

Example 12 with FragmentDummy

use of de.madcyph3r.example.example.FragmentDummy in project AdvancedMaterialDrawer by madcyph3r.

the class CustomHeaderBelowToolbarActivity method init.

@Override
public void init(Bundle savedInstanceState) {
    drawer = this;
    // Important: see example_custom_header.xml . android:fitsSystemWindows="true" is important,
    // otherwise the statusbar overlays the custom header
    // information text for the fragment
    Bundle bundle = new Bundle();
    bundle.putString("instruction", "This example has an custom header in the drawer. " + "The drawer is shown under the toolbar. " + "Call setCustomHeader(), to set your custom header.");
    Fragment fragmentInstruction = new FragmentInstruction();
    fragmentInstruction.setArguments(bundle);
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Instruction", fragmentInstruction, "Custom 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);
    // create and set the recycleview_header
    View view = LayoutInflater.from(this).inflate(R.layout.example_custom_header_below_toolbar, null);
    this.setCustomHeader(view, 150);
}
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) View(android.view.View)

Example 13 with FragmentDummy

use of de.madcyph3r.example.example.FragmentDummy in project AdvancedMaterialDrawer by madcyph3r.

the class HeadItemFiveActivity 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);
    return headItem;
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) MaterialHeadItem(de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem) FragmentDummy(de.madcyph3r.example.example.FragmentDummy)

Example 14 with FragmentDummy

use of de.madcyph3r.example.example.FragmentDummy in project AdvancedMaterialDrawer by madcyph3r.

the class HeadItemFiveActivity 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);
    return headItem;
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) MaterialHeadItem(de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem) FragmentDummy(de.madcyph3r.example.example.FragmentDummy)

Example 15 with FragmentDummy

use of de.madcyph3r.example.example.FragmentDummy in project AdvancedMaterialDrawer by madcyph3r.

the class HeadItemFiveActivity 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);
    return headItem;
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) MaterialHeadItem(de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem) FragmentDummy(de.madcyph3r.example.example.FragmentDummy)

Aggregations

FragmentDummy (de.madcyph3r.example.example.FragmentDummy)66 MaterialMenu (de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu)66 MaterialItemSectionFragment (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)66 Bundle (android.os.Bundle)43 Fragment (android.support.v4.app.Fragment)43 FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)43 MaterialHeadItem (de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem)39 TextDrawable (com.amulyakhare.textdrawable.TextDrawable)22 Bitmap (android.graphics.Bitmap)17 RoundedCornersDrawable (de.madcyph3r.materialnavigationdrawer.tools.RoundedCornersDrawable)17 MaterialItemDevisor (de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemDevisor)6 View (android.view.View)5 MaterialItemSection (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSection)4 MaterialItemLabel (de.madcyph3r.materialnavigationdrawer.menu.item.style.MaterialItemLabel)4 MaterialSectionChangeListener (de.madcyph3r.materialnavigationdrawer.listener.MaterialSectionChangeListener)2 MaterialSectionOnClickListener (de.madcyph3r.materialnavigationdrawer.listener.MaterialSectionOnClickListener)2 MaterialItemSectionOnClick (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionOnClick)2 Intent (android.content.Intent)1 DrawerLayout (android.support.v4.widget.DrawerLayout)1 ImageView (android.widget.ImageView)1