use of net.osmand.plus.activities.MapActivity in project Osmand by osmandapp.
the class PlanRouteFragment method onResume.
@Override
public void onResume() {
super.onResume();
MapActivity mapActivity = getMapActivity();
mapActivity.getMyApplication().getLocationProvider().addLocationListener(this);
mapActivity.getMapLayers().getMapControlsLayer().showMapControlsIfHidden();
}
use of net.osmand.plus.activities.MapActivity in project Osmand by osmandapp.
the class PlanRouteFragment method showHideMarkersList.
private void showHideMarkersList() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null && portrait) {
cancelSnapToRoad = false;
planRouteContext.setMarkersListOpened(!planRouteContext.isMarkersListOpened());
int containerRes = planRouteContext.isMarkersListOpened() ? R.id.fragmentContainer : R.id.bottomFragmentContainer;
mapActivity.getSupportFragmentManager().beginTransaction().remove(this).add(containerRes, new PlanRouteFragment(), PlanRouteFragment.TAG).commitAllowingStateLoss();
}
}
use of net.osmand.plus.activities.MapActivity in project Osmand by osmandapp.
the class PlanRouteFragment method optionsOnClick.
private void optionsOnClick() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
Bundle args = new Bundle();
args.putBoolean(PlanRouteOptionsBottomSheetDialogFragment.SELECT_ALL_KEY, !(selectedCount == markersHelper.getMapMarkers().size() && markersHelper.isStartFromMyLocation()));
PlanRouteOptionsBottomSheetDialogFragment fragment = new PlanRouteOptionsBottomSheetDialogFragment();
fragment.setArguments(args);
fragment.setUsedOnMap(true);
fragment.setListener(createOptionsFragmentListener());
fragment.show(mapActivity.getSupportFragmentManager(), PlanRouteOptionsBottomSheetDialogFragment.TAG);
}
}
use of net.osmand.plus.activities.MapActivity in project Osmand by osmandapp.
the class PlanRouteFragment method moveMapToPosition.
private void moveMapToPosition(double lat, double lon) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
OsmandMapTileView view = mapActivity.getMapView();
view.getAnimatedDraggingThread().startMoving(lat, lon, view.getZoom(), true);
if (planRouteContext.isMarkersListOpened()) {
planRouteContext.setAdjustMapOnStart(false);
showHideMarkersList();
}
}
}
use of net.osmand.plus.activities.MapActivity in project Osmand by osmandapp.
the class PlanRouteFragment method roundTripOnClick.
private void roundTripOnClick() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
OsmandSettings settings = mapActivity.getMyApplication().getSettings();
settings.ROUTE_MAP_MARKERS_ROUND_TRIP.set(!settings.ROUTE_MAP_MARKERS_ROUND_TRIP.get());
adapter.reloadData();
adapter.notifyDataSetChanged();
planRouteContext.recreateSnapTrkSegment(false);
}
}
Aggregations