use of org.holoeverywhere.widget.PopupMenu in project mobile-android by photo.
the class UploadManagerFragment method onItemClick.
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
TrackerUtils.trackButtonClickEvent("upload_manager_item", UploadManagerFragment.this);
mSelectedItem = mAdapter.getItem(position);
PopupMenu contextMenu = new PopupMenu(getActivity(), view);
contextMenu.setOnMenuItemClickListener(mOnMenuItemClickListener);
MenuInflater inflater = getSupportActivity().getSupportMenuInflater();
Menu menu = contextMenu.getMenu();
inflater.inflate(R.menu.upload_manager_item, menu);
UploadStatus uploadStatus = mSelectedItem.getUploadStatus();
if (uploadStatus == UploadStatus.DONE) {
menu.findItem(R.id.menu_cancel).setVisible(false);
} else {
menu.findItem(R.id.menu_clear).setVisible(false);
}
contextMenu.show();
}
Aggregations