本文整理汇总了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;
}
示例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);
}
示例3: appliesTo
@Override
public boolean appliesTo(@NonNull ResourceFolderType folderType) {
return folderType == ResourceFolderType.LAYOUT || folderType == ResourceFolderType.MENU;
}
示例4: appliesTo
@Override
public boolean appliesTo(@NonNull ResourceFolderType folderType) {
return folderType == ResourceFolderType.MENU;
}
示例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;
}
示例6: isOverflowPopupNeeded
@Override
public boolean isOverflowPopupNeeded() {
return ourShowMenu || ResourceHelper.getFolderType(myRenderTask.getPsiFile()) == ResourceFolderType.MENU;
}