本文整理了Java中android.view.ContextMenu.setHeaderView()
方法的一些代码示例,展示了ContextMenu.setHeaderView()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ContextMenu.setHeaderView()
方法的具体详情如下:
包路径:android.view.ContextMenu
类名称:ContextMenu
方法名:setHeaderView
暂无
代码示例来源:origin: andstatus/andstatus
public ContextMenuHeader(Context context, ContextMenu contextMenu) {
header = View.inflate(context, R.layout.context_menu_header, null);
contextMenu.setHeaderView(header);
}
代码示例来源:origin: derry/delion
private void setHeaderText(Context context, ContextMenu menu, String text) {
ContextMenuTitleView title = new ContextMenuTitleView(context, text);
menu.setHeaderView(title);
}
}
代码示例来源:origin: SecUSo/privacy-friendly-todo-list
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
//TODO ask touchlistener for swipe action
menu.setHeaderView(Helper.getMenuHeader(contextActivity, contextActivity.getString(R.string.select_option)));
MenuInflater inflater = contextActivity.getMenuInflater();
inflater.inflate(R.menu.todo_list_long_click, menu);
}
}
代码示例来源:origin: SecUSo/privacy-friendly-todo-list
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuInfo) {
ExpandableListView.ExpandableListContextMenuInfo info =
(ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
int type = ExpandableListView.getPackedPositionType(info.packedPosition);
MenuInflater inflater = this.getMenuInflater();
menu.setHeaderView(Helper.getMenuHeader(getBaseContext(), getBaseContext().getString(R.string.select_option)));
// context menu for child items
if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
inflater.inflate(R.menu.todo_subtask_long_click, menu);
} else { // context menu for group items
inflater.inflate(R.menu.todo_task_long_click, menu);
}
}
代码示例来源:origin: SecUSo/privacy-friendly-todo-list
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuInfo) {
ExpandableListView.ExpandableListContextMenuInfo info =
(ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
int type = ExpandableListView.getPackedPositionType(info.packedPosition);
MenuInflater inflater = getActivity().getMenuInflater();
menu.setHeaderView(Helper.getMenuHeader(getContext(), getContext().getString(R.string.select_option)));
// context menu for child items
if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
inflater.inflate(R.menu.todo_subtask_long_click, menu);
} else { // context menu for group items
inflater.inflate(R.menu.todo_task_long_click, menu);
}
}
代码示例来源:origin: SecUSo/privacy-friendly-todo-list
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
ExpandableListView.ExpandableListContextMenuInfo info =
(ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
int type = ExpandableListView.getPackedPositionType(info.packedPosition);
MenuInflater inflater = this.getMenuInflater();
menu.setHeaderView(Helper.getMenuHeader(getBaseContext(), getBaseContext().getString(R.string.select_option)));
inflater.inflate(R.menu.deleted_task_long_click, menu);
}
内容来源于网络,如有侵权,请联系作者删除!