Estoy usando los recursos de MaterialDrawer - Mikepenz
Pero no logro encontrar un atributo que me permita hacer invisible ciertos items del NavigationDrawer.
MainActivity.java
private void createNavigationDrawer(Bundle savedInstanceState){
//Handle Toolbar
setSupportActionBar(toolbar);
//Create Header Drawer
accountHeader = new AccountHeaderBuilder()
.withActivity(this)
.withTranslucentStatusBar(true)
//.withHeaderBackground(R.drawable.header)
.withSavedInstance(savedInstanceState)
.build();
//Create Drawer Layout
drawer = new DrawerBuilder()
.withActivity(this)
.withToolbar(toolbar)
.withHasStableIds(true)
.withItemAnimator(new AlphaCrossFadeAnimator())
.withAccountHeader(accountHeader)
.addDrawerItems(
new PrimaryDrawerItem().withName("Item 1").withIdentifier(1).withSelectable(true).withEnabled(true),
new SectionDrawerItem().withName("Group Item").withEnabled(true),
new ExpandableBadgeDrawerItem().withName("Item 2").withIdentifier(2).withSelectable(true).withEnabled(true).withSubItems(
new SecondaryDrawerItem().withName("Item 2.1").withIdentifier(21).withSelectable(true).withLevel(2),
new SecondaryDrawerItem().withName("Item 2.2").withIdentifier(21).withSelectable(true).withLevel(2)
)
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
/*switch ((int) drawerItem.getIdentifier()){
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
}*/
return false;
}
})
.withSavedInstance(savedInstanceState)
.withShowDrawerOnFirstLaunch(false)
.withShowDrawerUntilDraggedOpened(false)
.build();
}