use of android.widget.AdapterView.AdapterContextMenuInfo in project xabber-android by redsolution.
the class BaseListEditor method onCreateContextMenu.
@SuppressWarnings("unchecked")
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
final AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
actionWith = (T) getListView().getItemAtPosition(info.position);
if (actionWith == null)
// Add button
return;
onCreateContextMenu(menu, actionWith);
}
use of android.widget.AdapterView.AdapterContextMenuInfo in project xabber-android by redsolution.
the class StatusEditor method onCreateContextMenu.
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
actionWithItem = (SavedStatus) getListView().getItemAtPosition(info.position);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.status_context_menu, menu);
}
use of android.widget.AdapterView.AdapterContextMenuInfo in project routerkeygenAndroid by routerkeygen.
the class NetworksListFragment method onCreateContextMenu.
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
final AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
if (networksFound == null || wifiListAdapter.getCount() <= info.position)
return;
final WiFiNetwork wiFiNetwork = wifiListAdapter.getItem(info.position).wifiNetwork;
if (// the list is unstable and it can happen
wiFiNetwork == null)
return;
MenuInflater inflater = getActivity().getMenuInflater();
inflater.inflate(R.menu.networks_context_menu, menu);
// We are copying the values right away as the networks list is
// unstable.
menu.findItem(R.id.copy_ssid).setIntent(new Intent().putExtra(MENU_VALUE, wiFiNetwork.getSsidName()));
menu.findItem(R.id.copy_mac).setIntent(new Intent().putExtra(MENU_VALUE, wiFiNetwork.getMacAddress()));
menu.findItem(R.id.use_mac).setIntent(new Intent().putExtra(MENU_VALUE, wiFiNetwork.getMacAddress()));
}
use of android.widget.AdapterView.AdapterContextMenuInfo in project platform_frameworks_base by android.
the class SelectPrinterActivity method onCreateContextMenu.
@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
if (view == mListView) {
final int position = ((AdapterContextMenuInfo) menuInfo).position;
PrinterInfo printer = (PrinterInfo) mListView.getAdapter().getItem(position);
menu.setHeaderTitle(printer.getName());
// Add the select menu item if applicable.
if (printer.getStatus() != PrinterInfo.STATUS_UNAVAILABLE) {
MenuItem selectItem = menu.add(Menu.NONE, R.string.print_select_printer, Menu.NONE, R.string.print_select_printer);
Intent intent = new Intent();
intent.putExtra(EXTRA_PRINTER, printer);
selectItem.setIntent(intent);
}
// Add the forget menu item if applicable.
if (mPrinterRegistry.isFavoritePrinter(printer.getId())) {
MenuItem forgetItem = menu.add(Menu.NONE, R.string.print_forget_printer, Menu.NONE, R.string.print_forget_printer);
Intent intent = new Intent();
intent.putExtra(EXTRA_PRINTER_ID, printer.getId());
forgetItem.setIntent(intent);
}
}
}
use of android.widget.AdapterView.AdapterContextMenuInfo in project Conversations by siacs.
the class ConversationFragment method onCreateContextMenu.
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
synchronized (this.messageList) {
super.onCreateContextMenu(menu, v, menuInfo);
AdapterView.AdapterContextMenuInfo acmi = (AdapterContextMenuInfo) menuInfo;
this.selectedMessage = this.messageList.get(acmi.position);
populateContextMenu(menu);
}
}
Aggregations