Search in sources :

Example 1 with OsmEditOptionsFragmentListener

use of net.osmand.plus.osmedit.OsmEditOptionsBottomSheetDialogFragment.OsmEditOptionsFragmentListener in project Osmand by osmandapp.

the class OsmEditsFragment method createOsmEditOptionsFragmentListener.

private OsmEditOptionsFragmentListener createOsmEditOptionsFragmentListener() {
    return new OsmEditOptionsFragmentListener() {

        @Override
        public void onUploadClick(OsmPoint osmPoint) {
            uploadItems(new OsmPoint[] { getPointAfterModify(osmPoint) });
        }

        @Override
        public void onShowOnMapClick(OsmPoint osmPoint) {
            OsmandSettings settings = getMyApplication().getSettings();
            settings.setMapLocationToShow(osmPoint.getLatitude(), osmPoint.getLongitude(), settings.getLastKnownMapZoom());
            MapActivity.launchMapActivityMoveToTop(getActivity());
        }

        @Override
        public void onModifyOsmChangeClick(OsmPoint osmPoint) {
            OpenstreetmapPoint i = (OpenstreetmapPoint) getPointAfterModify(osmPoint);
            final Node entity = i.getEntity();
            refreshId = entity.getId();
            EditPoiDialogFragment.createInstance(entity, false).show(getActivity().getSupportFragmentManager(), "edit_poi");
        }

        @Override
        public void onModifyOsmNoteClick(OsmPoint osmPoint) {
            showBugDialog((OsmNotesPoint) osmPoint);
        }

        @Override
        public void onDeleteClick(OsmPoint osmPoint) {
            ArrayList<OsmPoint> points = new ArrayList<>();
            points.add(osmPoint);
            deleteItems(new ArrayList<>(points));
        }
    };
}
Also used : OsmEditOptionsFragmentListener(net.osmand.plus.osmedit.OsmEditOptionsBottomSheetDialogFragment.OsmEditOptionsFragmentListener) Node(net.osmand.osm.edit.Node) ArrayList(java.util.ArrayList) OsmandSettings(net.osmand.plus.OsmandSettings)

Aggregations

ArrayList (java.util.ArrayList)1 Node (net.osmand.osm.edit.Node)1 OsmandSettings (net.osmand.plus.OsmandSettings)1 OsmEditOptionsFragmentListener (net.osmand.plus.osmedit.OsmEditOptionsBottomSheetDialogFragment.OsmEditOptionsFragmentListener)1