Androidで固定ミニナビドロワーを構築したい。アイコンのみで、常に表示され、拡張できません。
https://github.com/mikepenz/MaterialDrawerミニ引き出しのようなもの。彼のライブラリを使用してみましたが、修正する方法がわかりません。
ここに私のコードがあります:
private Drawer result = null;
private MiniDrawer miniResult = null;
result = new DrawerBuilder()
.withActivity(this)
.withToolbar(toolbar)
.withTranslucentStatusBar(false)
.addDrawerItems(
new PrimaryDrawerItem().withName("1").withIcon(FontAwesome.Icon.faw_home).withIdentifier(1),
new PrimaryDrawerItem().withName("2").withIcon(FontAwesome.Icon.faw_home).withBadge("22").withBadgeStyle(new BadgeStyle(Color.RED, Color.RED)).withIdentifier(2).withSelectable(false),
new DividerDrawerItem(),
new ToggleDrawerItem().withName("3").withIcon(FontAwesome.Icon.faw_home).withChecked(true).withOnCheckedChangeListener(onCheckedChangeListener)
) // add the items we want to use with our Drawer
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
if (drawerItem instanceof Nameable) {
Toast.makeText(MainActivity.this, ((Nameable) drawerItem).getName().getText(MainActivity.this), Toast.LENGTH_SHORT).show();
}
return false;
}
})
.withGenerateMiniDrawer(true)
.withSavedInstance(savedInstanceState)
// build only the view of the Drawer (don't inflate it automatically in our layout which is done with .build())
.buildView();
miniResult = result.getMiniDrawer();
View view = miniResult.build(this);