Search in sources :

Example 1 with AvailableGPXFragment

use of net.osmand.plus.myplaces.ui.AvailableGPXFragment in project Osmand by osmandapp.

the class OsmEditingPlugin method optionsMenuFragment.

@Override
public void optionsMenuFragment(final FragmentActivity 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_upload_to_openstreetmap).setColor(app, R.color.color_white).setListener((adapter, itemId, pos, isChecked, viewCoordinates) -> {
            f.openSelectionMode(R.string.local_index_mi_upload_gpx, R.drawable.ic_action_upload_to_openstreetmap, R.drawable.ic_action_upload_to_openstreetmap, items -> OsmEditingPlugin.this.sendGPXFiles(activity, f, items.toArray(new GpxInfo[0])));
            return true;
        }).createItem());
    }
}
Also used : ItemBuilder(net.osmand.plus.ContextMenuItem.ItemBuilder) AvailableGPXFragment(net.osmand.plus.myplaces.ui.AvailableGPXFragment)

Aggregations

ItemBuilder (net.osmand.plus.ContextMenuItem.ItemBuilder)1 AvailableGPXFragment (net.osmand.plus.myplaces.ui.AvailableGPXFragment)1