Materialdrawer: How to implement Xpandable items dropdown in menu bar

Created on 18 Jul 2017  路  2Comments  路  Source: mikepenz/MaterialDrawer

Please help me to implement menu bar item drop down with icon on right of item how to do

question

Most helpful comment

You can do something like this to get Expandable Drawer Item:

    Drawer result = new DrawerBuilder()
            .withActivity(this)
            .withAccountHeader(header)
            .addDrawerItems(
                    new ExpandableDrawerItem().withName("Item 1").withSubItems(
                            new SecondaryDrawerItem().withName("sub1"),
                            new SecondaryDrawerItem().withName("sub2")
                    ),
                    new ExpandableDrawerItem().withName("item 2.").withSubItems(
                            new SecondaryDrawerItem().withName("one"),
                            new SecondaryDrawerItem().withName("two")
                    ),
                    new ExpandableDrawerItem().withName("Item 3").withSubItems(
                            new SecondaryDrawerItem().withName("one"),
                            new SecondaryDrawerItem().withName("two")
                    )
)
            .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
                @Override
                public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
                    return false;
                }
            })
            .build();

All 2 comments

You can do something like this to get Expandable Drawer Item:

    Drawer result = new DrawerBuilder()
            .withActivity(this)
            .withAccountHeader(header)
            .addDrawerItems(
                    new ExpandableDrawerItem().withName("Item 1").withSubItems(
                            new SecondaryDrawerItem().withName("sub1"),
                            new SecondaryDrawerItem().withName("sub2")
                    ),
                    new ExpandableDrawerItem().withName("item 2.").withSubItems(
                            new SecondaryDrawerItem().withName("one"),
                            new SecondaryDrawerItem().withName("two")
                    ),
                    new ExpandableDrawerItem().withName("Item 3").withSubItems(
                            new SecondaryDrawerItem().withName("one"),
                            new SecondaryDrawerItem().withName("two")
                    )
)
            .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
                @Override
                public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
                    return false;
                }
            })
            .build();
Was this page helpful?
0 / 5 - 0 ratings

Related issues

oleynikd picture oleynikd  路  4Comments

meness picture meness  路  3Comments

singhalavi picture singhalavi  路  4Comments

armoun picture armoun  路  3Comments

jd-alexander picture jd-alexander  路  4Comments