当前位置: 首页>>代码示例>>Java>>正文


Java ResourceFolderType.MENU属性代码示例

本文整理汇总了Java中com.android.resources.ResourceFolderType.MENU属性的典型用法代码示例。如果您正苦于以下问题:Java ResourceFolderType.MENU属性的具体用法?Java ResourceFolderType.MENU怎么用?Java ResourceFolderType.MENU使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.android.resources.ResourceFolderType的用法示例。


在下文中一共展示了ResourceFolderType.MENU属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: appliesTo

@Override
public boolean appliesTo(@NonNull ResourceFolderType folderType) {
    return folderType == ResourceFolderType.LAYOUT
            || folderType == ResourceFolderType.MENU
            || folderType == ResourceFolderType.ANIM
            || folderType == ResourceFolderType.ANIMATOR
            || folderType == ResourceFolderType.DRAWABLE
            || folderType == ResourceFolderType.COLOR;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ExtraTextDetector.java

示例2: create

/**
 * Constructs a new {@link LayoutPsiPullParser}, a parser dedicated to the special case of
 * parsing a layout resource files.
 *
 * @param file         The {@link XmlTag} for the root node.
 * @param logger       The logger to emit warnings too, such as missing fragment associations
 */
@NotNull
public static LayoutPsiPullParser create(@NotNull XmlFile file, @NotNull RenderLogger logger) {
  if (ResourceHelper.getFolderType(file) == ResourceFolderType.MENU) {
    return new MenuPsiPullParser(file, logger);
  }
  return new LayoutPsiPullParser(file, logger);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:LayoutPsiPullParser.java

示例3: appliesTo

@Override
public boolean appliesTo(@NonNull ResourceFolderType folderType) {
    return folderType == ResourceFolderType.LAYOUT || folderType == ResourceFolderType.MENU;
}
 
开发者ID:inaka,项目名称:lewis,代码行数:4,代码来源:HardcodedTextDetectorModified.java

示例4: appliesTo

@Override
public boolean appliesTo(@NonNull ResourceFolderType folderType) {
    return folderType == ResourceFolderType.MENU;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AppCompatResourceDetector.java

示例5: handleMenu

private boolean handleMenu(@Nullable RenderedView leaf) {
  boolean showMenu = false;
  if (leaf != null) {
    ViewInfo view = leaf.view;
    if (view != null) {
      ViewType viewType = view.getViewType();
      if (viewType != ViewType.USER) {
        XmlFile xmlFile = myContext.getXmlFile();
        if (ResourceHelper.getFolderType(xmlFile) == ResourceFolderType.MENU) {
          // When rendering a menu file, don't hide menu when clicking outside of it
          showMenu = true;
        }
        if (viewType == ViewType.ACTION_BAR_OVERFLOW) {
          showMenu = !ActionBarHandler.isShowingMenu(myContext);
        } else if (ActionBarHandler.isShowingMenu(myContext)) {
          RenderedView v = leaf.getParent();
          while (v != null) {
            if (v.tag != null) {
              // A view *containing* a system view is the menu
              showMenu = true;
              if (TAG_ITEM.equals(v.tag.getName())) {
                PsiFile file = v.tag.getContainingFile();
                if (file != null && file != xmlFile) {
                  VirtualFile virtualFile = file.getVirtualFile();
                  if (virtualFile != null) {
                    Project project = file.getProject();
                    int offset = v.tag.getTextOffset();
                    OpenFileDescriptor descriptor = new OpenFileDescriptor(project, virtualFile, offset);
                    FileEditorManager.getInstance(project).openEditor(descriptor, true);
                    return true;
                  }
                }
              }
              break;
            }
            v = v.getParent();
          }
        }
      }
    }
  }

  ActionBarHandler.showMenu(showMenu, myContext, true);

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:46,代码来源:RenderedPanel.java

示例6: isOverflowPopupNeeded

@Override
public boolean isOverflowPopupNeeded() {
  return ourShowMenu || ResourceHelper.getFolderType(myRenderTask.getPsiFile()) == ResourceFolderType.MENU;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ActionBarHandler.java


注:本文中的com.android.resources.ResourceFolderType.MENU属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。