我正在使用 mikepenz 抽屉。但小问题前:我需要精英包,但在购买 google play 时需要精英包。我需要那里的指导。
如何添加精英项目去精英页面类?
result = new Drawer()
.withActivity(this)
.withToolbar(toolbar)
.withHeader(R.layout.header)
.addDrawerItems(
new PrimaryDrawerItem().withName(R.string.category_all).withIdentifier(Category.ALL.id).withIcon(FontAwesome.Icon.faw_image),
new PrimaryDrawerItem().withName(R.string.category_featured).withIdentifier(Category.FEATURED.id).withIcon(FontAwesome.Icon.faw_star),
new PrimaryDrawerItem().withName(R.string.category_elit).withIcon(FontAwesome.Icon.faw_asterisk),
new SectionDrawerItem().withName(R.string.category_section_categories),
new PrimaryDrawerItem().withName(R.string.category_buildings).withIdentifier(Category.BUILDINGS.id).withIcon(FontAwesome.Icon.faw_building),
new PrimaryDrawerItem().withName(R.string.category_food).withIdentifier(Category.FOOD.id).withIcon(FontAwesome.Icon.faw_cutlery),
new PrimaryDrawerItem().withName(R.string.category_nature).withIdentifier(Category.NATURE.id).withIcon(FontAwesome.Icon.faw_tree),
new PrimaryDrawerItem().withName(R.string.category_animals).withIdentifier(Category.ANIMALS.id).withIcon(FontAwesome.Icon.faw_paw),
new PrimaryDrawerItem().withName(R.string.category_people).withIdentifier(Category.PEOPLE.id).withIcon(FontAwesome.Icon.faw_user),
new PrimaryDrawerItem().withName(R.string.category_fashion).withIdentifier(Category.FASHION.id).withIcon(FontAwesome.Icon.faw_diamond),
new PrimaryDrawerItem().withName(R.string.category_objects).withIdentifier(Category.OBJECTS.id).withIcon(FontAwesome.Icon.faw_book),
new PrimaryDrawerItem().withName(R.string.category_vehicles).withIdentifier(Category.VEHICLES.id).withIcon(FontAwesome.Icon.faw_car),
new PrimaryDrawerItem().withName(R.string.category_technology).withIdentifier(Category.TECHNOLOGY.id).withIcon(FontAwesome.Icon.faw_lightbulb_o),
new PrimaryDrawerItem().withName(R.string.category_games).withIdentifier(Category.GAMES.id).withIcon(FontAwesome.Icon.faw_gamepad),
new PrimaryDrawerItem().withName(R.string.category_space).withIdentifier(Category.SPACE.id).withIcon(FontAwesome.Icon.faw_rocket),
new PrimaryDrawerItem().withName(R.string.category_quotes).withIdentifier(Category.QUOTES.id).withIcon(FontAwesome.Icon.faw_quote_left),
new PrimaryDrawerItem().withName(R.string.category_abstract).withIdentifier(Category.ABSTRACT.id).withIcon(FontAwesome.Icon.faw_paint_brush),
new PrimaryDrawerItem().withName(R.string.category_material).withIdentifier(Category.MATERIAL.id).withIcon(FontAwesome.Icon.faw_dot_circle_o),
new PrimaryDrawerItem().withName(R.string.category_minimal).withIdentifier(Category.MINIMAL.id).withIcon(FontAwesome.Icon.faw_times_circle),
new PrimaryDrawerItem().withName(R.string.category_stocks).withIdentifier(Category.STOCKS.id).withIcon(FontAwesome.Icon.faw_mobile_phone),
new PrimaryDrawerItem().withName(R.string.category_others).withIdentifier(Category.OTHERS.id).withIcon(FontAwesome.Icon.faw_archive)
)
.withSelectedItem(1)
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l, IDrawerItem drawerItem) {
if (drawerItem != null) {
if (drawerItem instanceof Nameable) {
toolbar.setTitle(((Nameable) drawerItem).getNameRes());
}
if (onFilterChangedListener != null) {
onFilterChangedListener.onFilterChanged(drawerItem.getIdentifier());
}
if (drawerItem = category_elite) {
Intent i = new Intent(MainActivity.this, ElitePack.class);
} //it's here!!
}
}
})
.build();