本文整理汇总了Java中com.mikepenz.materialdrawer.model.MiniDrawerItem类的典型用法代码示例。如果您正苦于以下问题:Java MiniDrawerItem类的具体用法?Java MiniDrawerItem怎么用?Java MiniDrawerItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MiniDrawerItem类属于com.mikepenz.materialdrawer.model包,在下文中一共展示了MiniDrawerItem类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateMiniDrawerItem
import com.mikepenz.materialdrawer.model.MiniDrawerItem; //导入依赖的package包/类
/**
* 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;
}
示例2: getMiniDrawerType
import com.mikepenz.materialdrawer.model.MiniDrawerItem; //导入依赖的package包/类
/**
* gets the type of a IDrawerItem
*
* @param drawerItem
* @return
*/
public int getMiniDrawerType(IDrawerItem drawerItem) {
if (drawerItem instanceof MiniProfileDrawerItem) {
return PROFILE;
} else if (drawerItem instanceof MiniDrawerItem) {
return ITEM;
}
return -1;
}
示例3: generateMiniDrawerItem
import com.mikepenz.materialdrawer.model.MiniDrawerItem; //导入依赖的package包/类
/**
* generates a MiniDrawerItem from a IDrawerItem
*
* @param drawerItem
* @return
*/
public IDrawerItem generateMiniDrawerItem(IDrawerItem drawerItem) {
if (drawerItem instanceof PrimaryDrawerItem) {
return new MiniDrawerItem((PrimaryDrawerItem) drawerItem).withEnableSelectedBackground(mEnableSelectedMiniDrawerItemBackground);
} else if (drawerItem instanceof SecondaryDrawerItem && mIncludeSecondaryDrawerItems) {
return new MiniDrawerItem((SecondaryDrawerItem) drawerItem).withEnableSelectedBackground(mEnableSelectedMiniDrawerItemBackground);
} else if (drawerItem instanceof ProfileDrawerItem) {
MiniProfileDrawerItem mpdi = new MiniProfileDrawerItem((ProfileDrawerItem) drawerItem);
mpdi.withEnabled(mEnableProfileClick);
return mpdi;
}
return null;
}