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


Java PopupMenu.OnMenuItemClickListener方法代码示例

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


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

示例1: setupRecyclerView

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
public HorizontalBookRecyclerView setupRecyclerView(BookCardEventsCallback mListener,
                                                    Cursor bookListCursor,
                                                    String title,
                                                    PopupMenu.OnMenuItemClickListener onMenuItemClickListener,
                                                    int moreMenuRes) {
    setupRecyclerView(mListener, bookListCursor);
    setTitleText(title);
    setOverFlowMenuListener(onMenuItemClickListener, moreMenuRes);
    return this;

}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:12,代码来源:HorizontalBookRecyclerView.java

示例2: setOverFlowMenuListener

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
public void setOverFlowMenuListener(PopupMenu.OnMenuItemClickListener onClickListener, int moreMenuRes) {
    if (moreMenuRes > 0) {
        findViewById(R.id.more_overflow).setOnClickListener(v -> {
            PopupMenu popup = new PopupMenu(getContext(), v);
            popup.setOnMenuItemClickListener(onClickListener);
            popup.inflate(moreMenuRes);
            popup.show();
        });
    }
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:11,代码来源:HorizontalBookRecyclerView.java

示例3: DocumentViewModel

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
public DocumentViewModel(Context context, String fileName) {
    this.context = context;
    this.fileName = fileName;

    repository = DocumentRepository.getInstance();

    rectString = context.getString(R.string.rect);
    triangleString = context.getString(R.string.triangle);
    ovalString = context.getString(R.string.oval);

    rectLayers = new ArrayList<>();
    triangleLayers = new ArrayList<>();
    ovalLayers = new ArrayList<>();

    onMenuItemClickListener = new PopupMenu.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            String title = (String) item.getTitle();
            if (title.equals(rectString)) {
                addRectLayer();
            } else if (title.equals(triangleString)) {
                addTriangleLayer();
            } else if (title.equals(ovalString)) {
                addOvalLayer();
            }
            return true;
        }
    };

    this.document = new Document();
}
 
开发者ID:google,项目名称:spline,代码行数:32,代码来源:DocumentViewModel.java

示例4: getPageOptionsMenuOnItemClickListener

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
@Override
public PopupMenu.OnMenuItemClickListener getPageOptionsMenuOnItemClickListener() {
    return item -> {
        if (item.getItemId() == R.id.menu_help) {
            openHelp();
        }
        return false;
    };
}
 
开发者ID:jruesga,项目名称:rview,代码行数:10,代码来源:AccountPageFragment.java

示例5: showPopupMenu

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
/**
 * 显示Popup菜单
 *
 * @param context  上下文
 * @param v        视图
 * @param menu     菜单资源文件
 * @param listener 菜单项目点击监听器
 */
public static void showPopupMenu(@NonNull Context context, @NonNull View v, @MenuRes int menu,
                                 @NonNull PopupMenu.OnMenuItemClickListener listener) {
    //新建PopupMenu对像
    PopupMenu popupMenu = new PopupMenu(context, v);
    //生成Menu视图
    popupMenu.getMenuInflater().inflate(menu, popupMenu.getMenu());
    //setOnMenuItemClickListener
    popupMenu.setOnMenuItemClickListener(listener);
    //显示PopupMenu
    popupMenu.show();
}
 
开发者ID:Art2Cat,项目名称:MoonlightNote,代码行数:20,代码来源:MenuUtils.java

示例6: getOnMenuItemClickListener

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
public PopupMenu.OnMenuItemClickListener getOnMenuItemClickListener() {
    return onMenuItemClickListener;
}
 
开发者ID:google,项目名称:spline,代码行数:4,代码来源:DocumentViewModel.java

示例7: getPageOptionsMenuOnItemClickListener

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
public PopupMenu.OnMenuItemClickListener getPageOptionsMenuOnItemClickListener() {
    return null;
}
 
开发者ID:jruesga,项目名称:rview,代码行数:4,代码来源:WizardPageFragment.java

示例8: withOnMenuItemClickListener

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
public OverflowMenuDrawerItem withOnMenuItemClickListener(PopupMenu.OnMenuItemClickListener onMenuItemClickListener) {
    this.mOnMenuItemClickListener = onMenuItemClickListener;
    return this;
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:5,代码来源:OverflowMenuDrawerItem.java

示例9: getOnMenuItemClickListener

import android.support.v7.widget.PopupMenu; //导入方法依赖的package包/类
public PopupMenu.OnMenuItemClickListener getOnMenuItemClickListener() {
    return mOnMenuItemClickListener;
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:4,代码来源:OverflowMenuDrawerItem.java


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