use of net.osmand.plus.myplaces.AvailableGPXFragment in project Osmand by osmandapp.
the class OsmEditingPlugin method optionsMenuFragment.
@Override
public void optionsMenuFragment(final Activity activity, final Fragment fragment, ContextMenuAdapter optionsMenuAdapter) {
if (fragment instanceof AvailableGPXFragment) {
final AvailableGPXFragment f = ((AvailableGPXFragment) fragment);
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.local_index_mi_upload_gpx, activity).setIcon(R.drawable.ic_action_export).setColor(R.color.color_white).setListener(new ItemClickListener() {
@Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
f.openSelectionMode(R.string.local_index_mi_upload_gpx, R.drawable.ic_action_export, R.drawable.ic_action_export, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
List<GpxInfo> selectedItems = f.getSelectedItems();
sendGPXFiles(activity, f, selectedItems.toArray(new GpxInfo[selectedItems.size()]));
}
});
return true;
}
}).setPosition(5).createItem());
}
}
Aggregations