private PrimaryDrawerItem drawerItemForClass(AppCompatActivity activeActivity, Class<?> targetActivityClass, @StringRes int targetActivityTitleRessource, @DrawableRes int iconResource) { return new PrimaryDrawerItem() .withName(activeActivity.getString(targetActivityTitleRessource)) .withSelectable(false) .withSelectedTextColorRes(COLOR_ICON_PRIMARY_ACTIVE) .withIcon(iconResource) .withIconColorRes(COLOR_ICON_PRIMARY) .withIconTintingEnabled(true) .withSelectedIconColorRes(COLOR_ICON_PRIMARY_ACTIVE) .withTag(targetActivityClass) .withIdentifier(targetActivityClass.hashCode()); } private SecondaryDrawerItem secondaryDrawerItemForClass(AppCompatActivity activeActivity, Class<?> targetActivityClass, @StringRes int targetActivityTitleRessource, @DrawableRes int iconResource) {
/** * @return the list of items */ public ArrayList<IDrawerItem> getDrawerItems() { // The menu items in the drawer ArrayList<IDrawerItem> items = new ArrayList<>(); // Dashboard //if you want to update the items at a later time it is recommended to keep it in a variable //@formatter:off items.add(new PrimaryDrawerItem() .withName(MenuItem.MENU_ITEM1.mLabel).withIcon(Octicons.Icon.oct_dashboard) .withIconColorRes(R.color.menu_item_1).withSelectedIconColorRes(R.color.menu_item_1)); items.add(new PrimaryDrawerItem() .withName(MenuItem.MENU_ITEM2.mLabel).withIcon(Octicons.Icon.oct_graph) .withIconColorRes(R.color.menu_item_2).withSelectedIconColorRes(R.color.menu_item_2)); items.add(new PrimaryDrawerItem() .withName(MenuItem.MENU_ITEM3.mLabel).withIcon(FontAwesome.Icon.faw_sign_out) .withIconColorRes(R.color.menu_item_3).withSelectedIconColorRes(R.color.menu_item_3)); items.add(new PrimaryDrawerItem() .withName(MenuItem.MENU_ITEM4.mLabel).withIcon(FontAwesome.Icon.faw_sign_out) .withIconColorRes(R.color.menu_item_4).withSelectedIconColorRes(R.color.menu_item_4)); items.add(new PrimaryDrawerItem() .withName(MenuItem.MENU_ITEM5.mLabel).withIcon(FontAwesome.Icon.faw_sign_out) .withIconColorRes(R.color.menu_item_5).withSelectedIconColorRes(R.color.menu_item_5)); //@formatter:on decorate(items); return items; }