Search in sources :

Example 1 with MiniDrawerItem

use of com.mikepenz.materialdrawer.model.MiniDrawerItem in project MaterialDrawer by mikepenz.

the class MiniDrawer method generateMiniDrawerItem.

/**
     * generates a MiniDrawerItem from a IDrawerItem
     *
     * @param drawerItem
     * @return
     */
public IDrawerItem generateMiniDrawerItem(IDrawerItem drawerItem) {
    if (drawerItem instanceof SecondaryDrawerItem) {
        return mIncludeSecondaryDrawerItems ? new MiniDrawerItem((SecondaryDrawerItem) drawerItem).withEnableSelectedBackground(mEnableSelectedMiniDrawerItemBackground) : null;
    } else if (drawerItem instanceof PrimaryDrawerItem) {
        return new MiniDrawerItem((PrimaryDrawerItem) drawerItem).withEnableSelectedBackground(mEnableSelectedMiniDrawerItemBackground);
    } else if (drawerItem instanceof ProfileDrawerItem) {
        MiniProfileDrawerItem mpdi = new MiniProfileDrawerItem((ProfileDrawerItem) drawerItem);
        mpdi.withEnabled(mEnableProfileClick);
        return mpdi;
    }
    return null;
}
Also used : MiniDrawerItem(com.mikepenz.materialdrawer.model.MiniDrawerItem) PrimaryDrawerItem(com.mikepenz.materialdrawer.model.PrimaryDrawerItem) MiniProfileDrawerItem(com.mikepenz.materialdrawer.model.MiniProfileDrawerItem) ProfileDrawerItem(com.mikepenz.materialdrawer.model.ProfileDrawerItem) SecondaryDrawerItem(com.mikepenz.materialdrawer.model.SecondaryDrawerItem) MiniProfileDrawerItem(com.mikepenz.materialdrawer.model.MiniProfileDrawerItem)

Aggregations

MiniDrawerItem (com.mikepenz.materialdrawer.model.MiniDrawerItem)1 MiniProfileDrawerItem (com.mikepenz.materialdrawer.model.MiniProfileDrawerItem)1 PrimaryDrawerItem (com.mikepenz.materialdrawer.model.PrimaryDrawerItem)1 ProfileDrawerItem (com.mikepenz.materialdrawer.model.ProfileDrawerItem)1 SecondaryDrawerItem (com.mikepenz.materialdrawer.model.SecondaryDrawerItem)1