If "One tap make active" for markers is on, make active after click in list too

This commit is contained in:
alex 2017-12-08 13:51:08 +02:00
parent 6831b78385
commit 640a54cdbc
2 changed files with 42 additions and 32 deletions

View file

@ -63,24 +63,29 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL
return;
}
MapMarker marker = adapter.getItem(pos);
WptPt wptPt = marker.wptPt;
FavouritePoint favouritePoint = marker.favouritePoint;
Object objectToShow;
PointDescription pointDescription;
if (wptPt != null) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_WPT, wptPt.name);
objectToShow = wptPt;
} else if (favouritePoint != null) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_FAVORITE, favouritePoint.getName());
objectToShow = favouritePoint;
if (mapActivity.getMyApplication().getSettings().SELECT_MARKER_ON_SINGLE_TAP.get()) {
mapActivity.getMyApplication().getMapMarkersHelper().moveMarkerToTop(marker);
updateAdapter();
} else {
pointDescription = marker.getPointDescription(mapActivity);
objectToShow = marker;
WptPt wptPt = marker.wptPt;
FavouritePoint favouritePoint = marker.favouritePoint;
Object objectToShow;
PointDescription pointDescription;
if (wptPt != null) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_WPT, wptPt.name);
objectToShow = wptPt;
} else if (favouritePoint != null) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_FAVORITE, favouritePoint.getName());
objectToShow = favouritePoint;
} else {
pointDescription = marker.getPointDescription(mapActivity);
objectToShow = marker;
}
mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(),
15, pointDescription, true, objectToShow);
MapActivity.launchMapActivityMoveToTop(mapActivity);
((DialogFragment) getParentFragment()).dismiss();
}
mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(),
15, pointDescription, true, objectToShow);
MapActivity.launchMapActivityMoveToTop(mapActivity);
((DialogFragment) getParentFragment()).dismiss();
}
@Override

View file

@ -231,24 +231,29 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
if (item instanceof MapMarker) {
MapMarker marker = (MapMarker) item;
if (!marker.history) {
WptPt wptPt = marker.wptPt;
FavouritePoint favouritePoint = marker.favouritePoint;
Object objectToShow;
PointDescription pointDescription;
if (wptPt != null) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_WPT, wptPt.name);
objectToShow = wptPt;
} else if (favouritePoint != null) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_FAVORITE, favouritePoint.getName());
objectToShow = favouritePoint;
if (mapActivity.getMyApplication().getSettings().SELECT_MARKER_ON_SINGLE_TAP.get()) {
mapActivity.getMyApplication().getMapMarkersHelper().moveMarkerToTop(marker);
updateAdapter();
} else {
pointDescription = marker.getPointDescription(mapActivity);
objectToShow = marker;
WptPt wptPt = marker.wptPt;
FavouritePoint favouritePoint = marker.favouritePoint;
Object objectToShow;
PointDescription pointDescription;
if (wptPt != null) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_WPT, wptPt.name);
objectToShow = wptPt;
} else if (favouritePoint != null) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_FAVORITE, favouritePoint.getName());
objectToShow = favouritePoint;
} else {
pointDescription = marker.getPointDescription(mapActivity);
objectToShow = marker;
}
mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(),
15, pointDescription, true, objectToShow);
MapActivity.launchMapActivityMoveToTop(mapActivity);
((DialogFragment) getParentFragment()).dismiss();
}
mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(),
15, pointDescription, true, objectToShow);
MapActivity.launchMapActivityMoveToTop(mapActivity);
((DialogFragment) getParentFragment()).dismiss();
} else {
HistoryMarkerMenuBottomSheetDialogFragment fragment = new HistoryMarkerMenuBottomSheetDialogFragment();
fragment.setUsedOnMap(false);