Search in sources :

Example 61 with MapActivity

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();
}
Also used : MapActivity(net.osmand.plus.activities.MapActivity)

Example 62 with MapActivity

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();
    }
}
Also used : TargetPoint(net.osmand.plus.TargetPointsHelper.TargetPoint) MapActivity(net.osmand.plus.activities.MapActivity)

Example 63 with MapActivity

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);
    }
}
Also used : Bundle(android.os.Bundle) MapActivity(net.osmand.plus.activities.MapActivity)

Example 64 with MapActivity

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();
        }
    }
}
Also used : OsmandMapTileView(net.osmand.plus.views.OsmandMapTileView) MapActivity(net.osmand.plus.activities.MapActivity)

Example 65 with MapActivity

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);
    }
}
Also used : OsmandSettings(net.osmand.plus.OsmandSettings) MapActivity(net.osmand.plus.activities.MapActivity)

Aggregations

MapActivity (net.osmand.plus.activities.MapActivity)85 View (android.view.View)39 ImageView (android.widget.ImageView)28 TextView (android.widget.TextView)28 RecyclerView (android.support.v7.widget.RecyclerView)15 OsmandMapTileView (net.osmand.plus.views.OsmandMapTileView)14 AlertDialog (android.support.v7.app.AlertDialog)12 Nullable (android.support.annotation.Nullable)11 DialogInterface (android.content.DialogInterface)10 AdapterView (android.widget.AdapterView)9 LatLon (net.osmand.data.LatLon)9 OsmandApplication (net.osmand.plus.OsmandApplication)9 Bundle (android.os.Bundle)7 Button (android.widget.Button)7 EditText (android.widget.EditText)7 ImageButton (android.widget.ImageButton)7 FavouritePoint (net.osmand.data.FavouritePoint)7 Fragment (android.support.v4.app.Fragment)6 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)6 ViewTreeObserver (android.view.ViewTreeObserver)6