use of android.widget.AdapterView.AdapterContextMenuInfo in project Awful.apk by Awful.
the class ForumDisplayFragment method onCreateContextMenu.
@Override
public void onCreateContextMenu(ContextMenu aMenu, View aView, ContextMenuInfo aMenuInfo) {
super.onCreateContextMenu(aMenu, aView, aMenuInfo);
if (aMenuInfo instanceof AdapterContextMenuInfo) {
android.view.MenuInflater inflater = getActivity().getMenuInflater();
AdapterContextMenuInfo info = (AdapterContextMenuInfo) aMenuInfo;
Cursor row = mCursorAdapter.getRow(info.id);
if (row != null && row.getInt(row.getColumnIndex(AwfulThread.BOOKMARKED)) > -1) {
inflater.inflate(R.menu.thread_longpress, aMenu);
if (row.getInt(row.getColumnIndex(AwfulThread.BOOKMARKED)) < 1 || !getPrefs().coloredBookmarks) {
MenuItem bookmarkColor = aMenu.findItem(R.id.thread_bookmark_color);
if (bookmarkColor != null) {
bookmarkColor.setEnabled(false);
bookmarkColor.setVisible(false);
}
}
}
}
}
use of android.widget.AdapterView.AdapterContextMenuInfo in project RoboBinding-gallery by RoboBinding.
the class ContextMenuPresentationModel method deleteProduct.
public void deleteProduct(MenuItem menuItem) {
AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) menuItem.getMenuInfo();
Product deletedProduct = productStore.remove(menuInfo.position);
productOperationListener.onProductDeleted(deletedProduct);
}
use of android.widget.AdapterView.AdapterContextMenuInfo in project DroidShows by ltGuillaume.
the class DroidShows method onCreateContextMenu.
/* context menu */
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
menu.add(0, VIEW_SERIEDETAILS_CONTEXT, VIEW_SERIEDETAILS_CONTEXT, getString(R.string.menu_context_view_serie_details));
if (!logMode && seriesAdapter.getItem(info.position).getUnwatched() > 0)
menu.add(0, VIEW_EPISODEDETAILS_CONTEXT, VIEW_EPISODEDETAILS_CONTEXT, getString(R.string.messsages_view_ep_details));
menu.add(0, EXT_RESOURCES_CONTEXT, EXT_RESOURCES_CONTEXT, getString(R.string.menu_context_ext_resources));
if (!logMode && seriesAdapter.getItem(info.position).getUnwatchedAired() > 0)
menu.add(0, MARK_NEXT_EPISODE_AS_SEEN_CONTEXT, MARK_NEXT_EPISODE_AS_SEEN_CONTEXT, getString(R.string.menu_context_mark_next_episode_as_seen));
if (!logMode) {
menu.add(0, TOGGLE_ARCHIVED_CONTEXT, TOGGLE_ARCHIVED_CONTEXT, getString(R.string.menu_archive));
menu.add(0, PIN_CONTEXT, PIN_CONTEXT, getString(R.string.menu_context_pin));
menu.add(0, DELETE_CONTEXT, DELETE_CONTEXT, getString(R.string.menu_context_delete));
}
menu.add(0, UPDATE_CONTEXT, UPDATE_CONTEXT, getString(R.string.menu_context_update));
menu.add(0, SYNOPSIS_LANGUAGE, SYNOPSIS_LANGUAGE, getString(R.string.dialog_change_language) + " (" + seriesAdapter.getItem(info.position).getLanguage() + ")");
if (!logMode) {
if (seriesAdapter.getItem(info.position).getPassiveStatus())
menu.findItem(TOGGLE_ARCHIVED_CONTEXT).setTitle(R.string.menu_unarchive);
if (pinnedShows.contains(seriesAdapter.getItem(info.position).getSerieId()))
menu.findItem(PIN_CONTEXT).setTitle(R.string.menu_context_unpin);
}
menu.setHeaderTitle(seriesAdapter.getItem(info.position).getName());
}
use of android.widget.AdapterView.AdapterContextMenuInfo in project android-aosp-mms by slvn.
the class SlideshowEditActivity method onContextItemSelected.
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
int position = info.position;
switch(item.getItemId()) {
case MENU_MOVE_UP:
if ((position > 0) && (position < mSlideshowModel.size())) {
mSlideshowEditor.moveSlideUp(position);
mSlideListAdapter.notifyDataSetChanged();
mList.setSelection(position - 1);
}
break;
case MENU_MOVE_DOWN:
if ((position >= 0) && (position < mSlideshowModel.size() - 1)) {
mSlideshowEditor.moveSlideDown(position);
mSlideListAdapter.notifyDataSetChanged();
mList.setSelection(position + 1);
}
break;
case MENU_REMOVE_SLIDE:
if ((position >= 0) && (position < mSlideshowModel.size())) {
mSlideshowEditor.removeSlide(position);
mSlideListAdapter.notifyDataSetChanged();
}
break;
case MENU_ADD_SLIDE:
addNewSlide();
break;
default:
break;
}
return true;
}
Aggregations