com.mikepenz.materialdrawer.Drawer.getDrawerItem()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中com.mikepenz.materialdrawer.Drawer.getDrawerItem()方法的一些代码示例,展示了Drawer.getDrawerItem()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Drawer.getDrawerItem()方法的具体详情如下:
包路径:com.mikepenz.materialdrawer.Drawer
类名称:Drawer
方法名:getDrawerItem

Drawer.getDrawerItem介绍

[英]returns the DrawerItem by the given identifier
[中]按给定的标识符返回DrawerItem

代码示例

代码示例来源:origin: mikepenz/MaterialDrawer

/**
 * update the badge for a specific drawerItem
 * identified by its id
 *
 * @param identifier
 * @param badge
 */
public void updateBadge(long identifier, StringHolder badge) {
  IDrawerItem drawerItem = getDrawerItem(identifier);
  if (drawerItem instanceof Badgeable) {
    Badgeable badgeable = (Badgeable) drawerItem;
    badgeable.withBadge(badge);
    updateItem((IDrawerItem) badgeable);
  }
}

代码示例来源:origin: mikepenz/MaterialDrawer

/**
 * update the name for a specific drawerItem
 * identified by its id
 *
 * @param identifier
 * @param image
 */
public void updateIcon(long identifier, ImageHolder image) {
  IDrawerItem drawerItem = getDrawerItem(identifier);
  if (drawerItem instanceof Iconable) {
    Iconable pdi = (Iconable) drawerItem;
    pdi.withIcon(image);
    updateItem((IDrawerItem) pdi);
  }
}

代码示例来源:origin: mikepenz/MaterialDrawer

/**
 * update the name for a specific drawerItem
 * identified by its id
 *
 * @param identifier
 * @param name
 */
public void updateName(long identifier, StringHolder name) {
  IDrawerItem drawerItem = getDrawerItem(identifier);
  if (drawerItem instanceof Nameable) {
    Nameable pdi = (Nameable) drawerItem;
    pdi.withName(name);
    updateItem((IDrawerItem) pdi);
  }
}

代码示例来源:origin: k9mail/k-9

private void updateFolderSettingsItem() {
  IDrawerItem drawerItem = drawer.getDrawerItem(DRAWER_ID_FOLDERS);
  drawerItem.withEnabled(!unifiedInboxSelected);
  drawer.updateItem(drawerItem);
}

代码示例来源:origin: k9mail/k-9

public void selectFolder(String folderServerId) {
  unifiedInboxSelected = false;
  openedFolderServerId = folderServerId;
  for (long drawerId : userFolderDrawerIds) {
    Folder folder = (Folder) drawer.getDrawerItem(drawerId).getTag();
    if (folder.getServerId().equals(folderServerId)) {
      drawer.setSelection(drawerId, false);
      return;
    }
  }
  updateFolderSettingsItem();
}

代码示例来源:origin: mikepenz/MaterialDrawer

mAccountHeader.toggleSelectionList(v.getContext());
IDrawerItem drawerItem = mDrawer.getDrawerItem(item.getIdentifier());
if (drawerItem != null && !drawerItem.isSelected()) {

代码示例来源:origin: FreedomZZQ/YouJoin-Android

/**
 * update the badge for a specific drawerItem
 * identified by its id
 *
 * @param identifier
 * @param badge
 */
public void updateBadge(int identifier, StringHolder badge) {
  IDrawerItem drawerItem = getDrawerItem(identifier);
  if (drawerItem instanceof Badgeable) {
    Badgeable badgeable = (Badgeable) drawerItem;
    badgeable.withBadge(badge);
    updateItem((IDrawerItem) badgeable);
  }
}

代码示例来源:origin: FreedomZZQ/YouJoin-Android

/**
 * update the name for a specific drawerItem
 * identified by its id
 *
 * @param identifier
 * @param name
 */
public void updateName(int identifier, StringHolder name) {
  IDrawerItem drawerItem = getDrawerItem(identifier);
  if (drawerItem instanceof Nameable) {
    Nameable pdi = (Nameable) drawerItem;
    pdi.withName(name);
    updateItem((IDrawerItem) pdi);
  }
}

代码示例来源:origin: FreedomZZQ/YouJoin-Android

/**
 * update the name for a specific drawerItem
 * identified by its id
 *
 * @param identifier
 * @param image
 */
public void updateIcon(int identifier, ImageHolder image) {
  IDrawerItem drawerItem = getDrawerItem(identifier);
  if (drawerItem instanceof Iconable) {
    Iconable pdi = (Iconable) drawerItem;
    pdi.withIcon(image);
    updateItem((IDrawerItem) pdi);
  }
}

代码示例来源:origin: n76/wifi_backend

private void updateTitle() {
  IDrawerItem item = drawer == null ? null : drawer.getDrawerItem(drawer.getCurrentSelection());
  if (item != null && item instanceof PrimaryDrawerItem) {
    toolbar.setSubtitle(((PrimaryDrawerItem) item).getName().getText(this));
  } else {
    toolbar.setSubtitle(null);
  }
}

相关文章