diff --git a/OsmAnd/res/color/bottom_navigation_color_selector_dark.xml b/OsmAnd/res/color/bottom_navigation_color_selector_dark.xml
new file mode 100644
index 0000000000..803c0606b2
--- /dev/null
+++ b/OsmAnd/res/color/bottom_navigation_color_selector_dark.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/OsmAnd/res/color/bottom_navigation_color_selector_light.xml b/OsmAnd/res/color/bottom_navigation_color_selector_light.xml
new file mode 100644
index 0000000000..d1537744a1
--- /dev/null
+++ b/OsmAnd/res/color/bottom_navigation_color_selector_light.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/OsmAnd/res/layout/fragment_map_markers_dialog.xml b/OsmAnd/res/layout/fragment_map_markers_dialog.xml
index d7b9dda1a9..6bc81c6b5e 100644
--- a/OsmAnd/res/layout/fragment_map_markers_dialog.xml
+++ b/OsmAnd/res/layout/fragment_map_markers_dialog.xml
@@ -98,7 +98,7 @@
android:layout_height="wrap_content"
android:background="?attr/bg_color"
app:itemBackground="?attr/bg_color"
- app:itemIconTint="@drawable/bottom_navigation_color_selector"
- app:itemTextColor="@drawable/bottom_navigation_color_selector"
+ app:itemIconTint="@color/bottom_navigation_color_selector_light"
+ app:itemTextColor="@color/bottom_navigation_color_selector_light"
app:menu="@menu/map_markers_bottom_navigation"/>
diff --git a/OsmAnd/res/layout/fragment_marker_show_direction_bottom_sheet_dialog.xml b/OsmAnd/res/layout/fragment_marker_show_direction_bottom_sheet_dialog.xml
index 1e0030de66..d92053dc9c 100644
--- a/OsmAnd/res/layout/fragment_marker_show_direction_bottom_sheet_dialog.xml
+++ b/OsmAnd/res/layout/fragment_marker_show_direction_bottom_sheet_dialog.xml
@@ -115,6 +115,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:background="@null"
+ android:clickable="false"
+ android:focusable="false"/>
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:background="@null"
+ android:clickable="false"
+ android:focusable="false"/>
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:background="@null"
+ android:clickable="false"
+ android:focusable="false"/>
diff --git a/OsmAnd/res/layout/map_marker_item_header.xml b/OsmAnd/res/layout/map_marker_item_header.xml
index 884449ea96..bea554a14b 100644
--- a/OsmAnd/res/layout/map_marker_item_header.xml
+++ b/OsmAnd/res/layout/map_marker_item_header.xml
@@ -14,24 +14,35 @@
android:orientation="horizontal"
android:background="?attr/bg_color">
+
+
+
+
-
+
diff --git a/OsmAnd/res/layout/map_marker_item_new.xml b/OsmAnd/res/layout/map_marker_item_new.xml
index 0f4ddb6a42..da0e14678c 100644
--- a/OsmAnd/res/layout/map_marker_item_new.xml
+++ b/OsmAnd/res/layout/map_marker_item_new.xml
@@ -55,7 +55,6 @@
android:layout_height="28dp">
diff --git a/OsmAnd/res/layout/map_marker_item_show_hide_history.xml b/OsmAnd/res/layout/map_marker_item_show_hide_history.xml
new file mode 100644
index 0000000000..2454538048
--- /dev/null
+++ b/OsmAnd/res/layout/map_marker_item_show_hide_history.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 034ca5acff..953168a80d 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -9,6 +9,10 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
+ Show guide line
+ Show arrows on the map
+ Show passed
+ Hide passed
Remove from Map Markers
Descendingly
Ascendingly
diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java
index 1830656109..9c65a13f1b 100644
--- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java
+++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java
@@ -15,7 +15,6 @@ import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
-import net.osmand.plus.helpers.ColorDialogs;
import net.osmand.plus.mapmarkers.MapMarkersDbHelper;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
@@ -40,6 +39,7 @@ public class MapMarkersHelper {
private List mapMarkers = new LinkedList<>();
private List mapMarkersHistory = new LinkedList<>();
+ private List mapMarkersGroups = new ArrayList<>();
private OsmandSettings settings;
private List listeners = new ArrayList<>();
private OsmandApplication ctx;
@@ -175,6 +175,11 @@ public class MapMarkersHelper {
}
}
+ @Nullable
+ public MarkersSyncGroup getGroup(String id) {
+ return markersDbHelper.getGroup(id);
+ }
+
public static class MarkersSyncGroup {
public static final int FAVORITES_TYPE = 0;
@@ -214,6 +219,10 @@ public class MapMarkersHelper {
public int getColor() {
return color;
}
+
+ public void setColor(int color) {
+ this.color = color;
+ }
}
public MapMarkersHelper(OsmandApplication ctx) {
@@ -222,6 +231,7 @@ public class MapMarkersHelper {
markersDbHelper = ctx.getMapMarkersDbHelper();
startFromMyLocation = settings.ROUTE_MAP_MARKERS_START_MY_LOC.get();
loadMarkers();
+ createMapMarkersGroups();
}
public boolean isStartFromMyLocation() {
@@ -251,7 +261,7 @@ public class MapMarkersHelper {
checkAndFixActiveMarkersOrderIfNeeded();
List markersHistory = markersDbHelper.getMarkersHistory();
- sortHistoryMarkers();
+ sortMarkers(markersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
mapMarkersHistory.addAll(markersHistory);
if (!ctx.isApplicationInitializing()) {
@@ -279,73 +289,20 @@ public class MapMarkersHelper {
}
}
- public List getMarkersSortedByGroup() {
- Map groupsMap = new LinkedHashMap<>();
- List noGroup = new ArrayList<>();
- for (MapMarker marker : mapMarkers) {
- String groupName = marker.groupName;
- if (groupName == null) {
- noGroup.add(marker);
- } else {
- MapMarkerGroup group = groupsMap.get(groupName);
- if (group == null) {
- group = new MapMarkerGroup(groupName, marker.creationDate);
- groupsMap.put(groupName, group);
- } else {
- long markerCreationDate = marker.creationDate;
- if (markerCreationDate < group.getCreationDate()) {
- group.setCreationDate(markerCreationDate);
- }
- }
- group.getMapMarkers().add(marker);
- }
- }
- List groups = new ArrayList<>(groupsMap.values());
- sortGroups(groups);
-
- List markers = new ArrayList<>();
- markers.addAll(noGroup);
- for (MapMarkerGroup group : groups) {
- markers.addAll(group.getMapMarkers());
- }
- return markers;
- }
-
- private void sortGroups(List groups) {
- Collections.sort(groups, new Comparator() {
- @Override
- public int compare(MapMarkerGroup group1, MapMarkerGroup group2) {
- long t1 = group1.creationDate;
- long t2 = group2.creationDate;
- if (t1 > t2) {
- return -1;
- } else if (t1 == t2) {
- return 0;
- } else {
- return 1;
- }
- }
- });
- }
-
- private void sortHistoryMarkers() {
- sortMarkers(true, null);
- }
-
- private void sortMarkers(final boolean history, final OsmandSettings.MapMarkersOrderByMode orderByMode) {
+ public void sortMarkers(List markers, final boolean visited, final OsmandSettings.MapMarkersOrderByMode orderByMode) {
final LatLon location = ctx.getSettings().getLastKnownMapLocation();
- Collections.sort(history ? mapMarkersHistory : mapMarkers, new Comparator() {
+ Collections.sort(markers, new Comparator() {
@Override
public int compare(MapMarker mapMarker1, MapMarker mapMarker2) {
- if (history || orderByMode.isDateAddedDescending() || orderByMode.isDateAddedAscending()) {
- long t1 = history ? mapMarker1.visitedDate : mapMarker1.creationDate;
- long t2 = history ? mapMarker2.visitedDate : mapMarker2.creationDate;
+ if (orderByMode.isDateAddedDescending() || orderByMode.isDateAddedAscending()) {
+ long t1 = visited ? mapMarker1.visitedDate : mapMarker1.creationDate;
+ long t2 = visited ? mapMarker2.visitedDate : mapMarker2.creationDate;
if (t1 > t2) {
- return history || orderByMode.isDateAddedDescending() ? -1 : 1;
+ return orderByMode.isDateAddedDescending() ? -1 : 1;
} else if (t1 == t2) {
return 0;
} else {
- return history || orderByMode.isDateAddedDescending() ? 1 : -1;
+ return orderByMode.isDateAddedDescending() ? 1 : -1;
}
} else if (orderByMode.isDistanceDescending() || orderByMode.isDistanceAscending()) {
int d1 = (int) MapUtils.getDistance(location, mapMarker1.getLatitude(), mapMarker1.getLongitude());
@@ -367,7 +324,7 @@ public class MapMarkersHelper {
}
public void orderMarkers(OsmandSettings.MapMarkersOrderByMode orderByMode) {
- sortMarkers(false, orderByMode);
+ sortMarkers(getMapMarkers(), false, orderByMode);
checkAndFixActiveMarkersOrderIfNeeded();
}
@@ -417,6 +374,9 @@ public class MapMarkersHelper {
removeActiveMarkersFromSyncGroup(group.getId());
return;
}
+ if (group.getColor() == -1) {
+ group.setColor(favGroup.color);
+ }
for (FavouritePoint fp : favGroup.points) {
addNewMarkerIfNeeded(group, dbMarkers, new LatLon(fp.getLatitude(), fp.getLongitude()), fp.getName());
@@ -438,7 +398,9 @@ public class MapMarkersHelper {
}
List gpxPoints = new LinkedList<>(gpx.getPoints());
+ int defColor = ContextCompat.getColor(ctx, R.color.marker_red);
for (WptPt pt : gpxPoints) {
+ group.setColor(pt.getColor(defColor));
addNewMarkerIfNeeded(group, dbMarkers, new LatLon(pt.lat, pt.lon), pt.name);
}
@@ -452,13 +414,10 @@ public class MapMarkersHelper {
for (MapMarker marker : markers) {
if (marker.id.equals(group.getId() + name)) {
exists = true;
- int colorIndex = MapMarker.getColorIndex(ctx, ColorDialogs.getNearestColor(group.getColor(), MapMarker.getColors(ctx)));
- boolean updateColor = group.getColor() != -1 && marker.colorIndex != colorIndex;
- if (!marker.history && (!marker.point.equals(latLon) || updateColor)) {
+ if (!marker.history && (!marker.point.equals(latLon))) {
for (MapMarker m : mapMarkers) {
if (m.id.equals(marker.id)) {
m.point = latLon;
- m.colorIndex = colorIndex;
updateMapMarker(m, true);
break;
}
@@ -501,7 +460,7 @@ public class MapMarkersHelper {
marker.nextKey = MapMarkersDbHelper.HISTORY_NEXT_VALUE;
mapMarkersHistory.add(marker);
checkAndFixActiveMarkersOrderIfNeeded();
- sortHistoryMarkers();
+ sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
refresh();
}
}
@@ -511,11 +470,12 @@ public class MapMarkersHelper {
markersDbHelper.addMarker(marker);
if (marker.history) {
mapMarkersHistory.add(marker);
- sortHistoryMarkers();
+ sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
} else {
mapMarkers.add(marker);
checkAndFixActiveMarkersOrderIfNeeded();
}
+ addMarkerToGroup(marker);
refresh();
}
}
@@ -527,7 +487,7 @@ public class MapMarkersHelper {
marker.history = false;
mapMarkers.add(position, marker);
checkAndFixActiveMarkersOrderIfNeeded();
- sortHistoryMarkers();
+ sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
refresh();
}
}
@@ -541,7 +501,7 @@ public class MapMarkersHelper {
mapMarkers.add(marker);
}
checkAndFixActiveMarkersOrderIfNeeded();
- sortHistoryMarkers();
+ sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
refresh();
}
}
@@ -551,6 +511,7 @@ public class MapMarkersHelper {
markersDbHelper.removeMarker(marker, true);
mapMarkersHistory.remove(marker);
refresh();
+ removeMarkerFromGroup(marker);
}
}
@@ -623,7 +584,7 @@ public class MapMarkersHelper {
}
mapMarkersHistory.addAll(mapMarkers);
mapMarkers.clear();
- sortHistoryMarkers();
+ sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
refresh();
}
@@ -632,6 +593,7 @@ public class MapMarkersHelper {
markersDbHelper.clearAllMarkersHistory();
mapMarkersHistory.clear();
refresh();
+ removeHistoryMarkersFromGroups();
}
public void addMarkersSyncGroup(MarkersSyncGroup group) {
@@ -675,8 +637,7 @@ public class MapMarkersHelper {
private void addMarkers(List points, List historyNames, @Nullable MarkersSyncGroup group) {
if (points.size() > 0) {
- boolean randomColor = group == null || group.getColor() == -1;
- int colorIndex = randomColor ? -1 : MapMarker.getColorIndex(ctx, ColorDialogs.getNearestColor(group.getColor(), MapMarker.getColors(ctx)));
+ int colorIndex = -1;
for (int i = 0; i < points.size(); i++) {
LatLon point = points.get(i);
PointDescription historyName = historyNames.get(i);
@@ -689,16 +650,14 @@ public class MapMarkersHelper {
if (pointDescription.isLocation() && Algorithms.isEmpty(pointDescription.getName())) {
pointDescription.setName(PointDescription.getSearchAddressStr(ctx));
}
- if (randomColor) {
- if (colorIndex == -1) {
- if (mapMarkers.size() > 0) {
- colorIndex = (mapMarkers.get(mapMarkers.size() - 1).colorIndex + 1) % MAP_MARKERS_COLORS_COUNT;
- } else {
- colorIndex = 0;
- }
+ if (colorIndex == -1) {
+ if (mapMarkers.size() > 0) {
+ colorIndex = (mapMarkers.get(mapMarkers.size() - 1).colorIndex + 1) % MAP_MARKERS_COLORS_COUNT;
} else {
- colorIndex = (colorIndex + 1) % MAP_MARKERS_COLORS_COUNT;
+ colorIndex = 0;
}
+ } else {
+ colorIndex = (colorIndex + 1) % MAP_MARKERS_COLORS_COUNT;
}
MapMarker marker = new MapMarker(point, pointDescription, colorIndex, false, 0);
@@ -714,6 +673,7 @@ public class MapMarkersHelper {
marker.nextKey = MapMarkersDbHelper.TAIL_NEXT_VALUE;
markersDbHelper.addMarker(marker);
mapMarkers.add(marker);
+ addMarkerToGroup(marker);
checkAndFixActiveMarkersOrderIfNeeded();
}
}
@@ -856,15 +816,165 @@ public class MapMarkersHelper {
GPXUtilities.writeGpxFile(fout, file, ctx);
}
- public static class MapMarkerGroup {
- private String name;
- private List mapMarkers = new ArrayList<>();
- private long creationDate;
-
- public MapMarkerGroup(String name, long creationDate) {
- this.name = name;
- this.creationDate = creationDate;
+ private void removeHistoryMarkersFromGroups() {
+ for (MapMarkersGroup markersGroup : mapMarkersGroups) {
+ List activeMarkers = new ArrayList<>();
+ for (MapMarker marker : markersGroup.getMarkers()) {
+ if (!marker.history) {
+ activeMarkers.add(marker);
+ }
+ }
+ markersGroup.setMarkers(activeMarkers);
+ updateShowHideHistoryButtonInGroup(markersGroup);
}
+ }
+
+ private void updateShowHideHistoryButtonInGroup(MapMarkersGroup mapMarkersGroup) {
+ int historyMarkersCount = mapMarkersGroup.getHistoryMarkers().size();
+ ShowHideHistoryButton showHideHistoryButton = mapMarkersGroup.getShowHideHistoryButton();
+ if (showHideHistoryButton != null && historyMarkersCount == 0) {
+ mapMarkersGroup.setShowHideHistoryButton(null);
+ } else if (historyMarkersCount > 0) {
+ showHideHistoryButton = new ShowHideHistoryButton();
+ showHideHistoryButton.setShowHistory(false);
+ showHideHistoryButton.setMarkerGroup(mapMarkersGroup);
+ mapMarkersGroup.setShowHideHistoryButton(showHideHistoryButton);
+ }
+ }
+
+ private void addMarkerToGroup(MapMarker marker) {
+ if (marker != null) {
+ MapMarkersGroup mapMarkersGroup = getMapMarkerGroupByName(marker.groupName);
+ if (mapMarkersGroup != null) {
+ mapMarkersGroup.getMarkers().add(marker);
+ updateShowHideHistoryButtonInGroup(mapMarkersGroup);
+ if (mapMarkersGroup.getName() == null) {
+ sortMarkers(mapMarkersGroup.getMarkers(), false, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
+ }
+ } else {
+ MapMarkersGroup group = createMapMarkerGroup(marker);
+ group.getMarkers().add(marker);
+ createHeaderAndHistoryButtonInGroup(group);
+ }
+ }
+ }
+
+ private MapMarkersGroup createMapMarkerGroup(MapMarker marker) {
+ MapMarkersGroup group = new MapMarkersGroup();
+ group.setName(marker.groupName);
+ MapMarkersHelper.MarkersSyncGroup syncGroup = getGroup(marker.groupKey);
+ if (syncGroup != null) {
+ group.setType(syncGroup.getType());
+ }
+ group.setColor(MapMarker.getColorId(marker.colorIndex));
+ group.setCreationDate(marker.creationDate);
+ mapMarkersGroups.add(group);
+ return group;
+ }
+
+ private void createHeaderAndHistoryButtonInGroup(MapMarkersGroup group) {
+ GroupHeader header = new GroupHeader();
+ int type = group.getType();
+ if (type != -1) {
+ header.setIconRes(type == MapMarkersHelper.MarkersSyncGroup.FAVORITES_TYPE ? R.drawable.ic_action_fav_dark : R.drawable.ic_action_track_16);
+ }
+ header.setGroup(group);
+ group.setGroupHeader(header);
+ updateShowHideHistoryButtonInGroup(group);
+ }
+
+ private void removeMarkerFromGroup(MapMarker marker) {
+ if (marker != null) {
+ MapMarkersGroup mapMarkersGroup = getMapMarkerGroupByName(marker.groupName);
+ if (mapMarkersGroup != null) {
+ mapMarkersGroup.getMarkers().remove(marker);
+ updateShowHideHistoryButtonInGroup(mapMarkersGroup);
+ }
+ }
+ }
+
+ public List getMapMarkersGroups() {
+ return mapMarkersGroups;
+ }
+
+ private void createMapMarkersGroups() {
+ List markers = new ArrayList<>();
+ markers.addAll(mapMarkers);
+ markers.addAll(mapMarkersHistory);
+
+ Map groupsMap = new LinkedHashMap<>();
+ MapMarkersGroup noGroup = null;
+ for (MapMarker marker : markers) {
+ String groupName = marker.groupName;
+ if (groupName == null) {
+ if (noGroup == null) {
+ noGroup = new MapMarkersGroup();
+ noGroup.setCreationDate(marker.creationDate);
+ }
+ noGroup.getMarkers().add(marker);
+ } else {
+ MapMarkersGroup group = groupsMap.get(groupName);
+ if (group == null) {
+ group = createMapMarkerGroup(marker);
+ groupsMap.put(groupName, group);
+ } else {
+ long markerCreationDate = marker.creationDate;
+ if (markerCreationDate < group.getCreationDate()) {
+ group.setCreationDate(markerCreationDate);
+ }
+ }
+ group.getMarkers().add(marker);
+ }
+ }
+ mapMarkersGroups = new ArrayList<>(groupsMap.values());
+ sortGroups(mapMarkersGroups);
+
+ for (MapMarkersGroup group : mapMarkersGroups) {
+ createHeaderAndHistoryButtonInGroup(group);
+ }
+
+ if (noGroup != null) {
+ sortMarkers(noGroup.getMarkers(), false, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
+ mapMarkersGroups.add(0, noGroup);
+ }
+ }
+
+ private void sortGroups(List groups) {
+ Collections.sort(groups, new Comparator() {
+ @Override
+ public int compare(MapMarkersGroup group1, MapMarkersGroup group2) {
+ long t1 = group1.getCreationDate();
+ long t2 = group2.getCreationDate();
+ if (t1 > t2) {
+ return -1;
+ } else if (t1 == t2) {
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+ });
+ }
+
+ public MapMarkersGroup getMapMarkerGroupByName(String name) {
+ for (MapMarkersGroup group : mapMarkersGroups) {
+ if ((name == null && group.getName() == null)
+ || (group.getName() != null && group.getName().equals(name))) {
+ return group;
+ }
+ }
+ return null;
+ }
+
+ public static class MapMarkersGroup {
+ private String name;
+ private GroupHeader header;
+ private int type = -1;
+ private List markers = new ArrayList<>();
+ private long creationDate;
+ private ShowHideHistoryButton showHideHistoryButton;
+ private int color;
+ private boolean disabled;
public String getName() {
return name;
@@ -874,12 +984,48 @@ public class MapMarkersHelper {
this.name = name;
}
- public List getMapMarkers() {
- return mapMarkers;
+ public GroupHeader getGroupHeader() {
+ return header;
}
- public void setMapMarkers(List mapMarkers) {
- this.mapMarkers = mapMarkers;
+ public void setGroupHeader(GroupHeader header) {
+ this.header = header;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+
+ public List getActiveMarkers() {
+ List activeMarkers = new ArrayList<>();
+ for (MapMarker marker : markers) {
+ if (!marker.history) {
+ activeMarkers.add(marker);
+ }
+ }
+ return activeMarkers;
+ }
+
+ public List getHistoryMarkers() {
+ List historyMarkers = new ArrayList<>();
+ for (MapMarker marker : markers) {
+ if (marker.history) {
+ historyMarkers.add(marker);
+ }
+ }
+ return historyMarkers;
+ }
+
+ public List getMarkers() {
+ return markers;
+ }
+
+ public void setMarkers(List markers) {
+ this.markers = markers;
}
public long getCreationDate() {
@@ -889,5 +1035,71 @@ public class MapMarkersHelper {
public void setCreationDate(long creationDate) {
this.creationDate = creationDate;
}
+
+ public ShowHideHistoryButton getShowHideHistoryButton() {
+ return showHideHistoryButton;
+ }
+
+ public void setShowHideHistoryButton(ShowHideHistoryButton showHideHistoryButton) {
+ this.showHideHistoryButton = showHideHistoryButton;
+ }
+
+ public int getColor() {
+ return color;
+ }
+
+ public void setColor(int color) {
+ this.color = color;
+ }
+
+ public boolean isDisabled() {
+ return disabled;
+ }
+
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
+ }
+
+ public static class ShowHideHistoryButton {
+ private boolean showHistory;
+ private MapMarkersGroup group;
+
+ public boolean isShowHistory() {
+ return showHistory;
+ }
+
+ public void setShowHistory(boolean showHistory) {
+ this.showHistory = showHistory;
+ }
+
+ public MapMarkersGroup getMapMarkerGroup() {
+ return group;
+ }
+
+ public void setMarkerGroup(MapMarkersGroup group) {
+ this.group = group;
+ }
+ }
+
+ public static class GroupHeader {
+ private int iconRes;
+ private MapMarkersGroup group;
+
+ public int getIconRes() {
+ return iconRes;
+ }
+
+ public void setIconRes(int iconRes) {
+ this.iconRes = iconRes;
+ }
+
+ public MapMarkersGroup getGroup() {
+ return group;
+ }
+
+ public void setGroup(MapMarkersGroup group) {
+ this.group = group;
+ }
}
}
diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java
index d07a2b40d4..ad96b84af6 100644
--- a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java
+++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java
@@ -38,6 +38,7 @@ import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
+import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.util.Log;
@@ -69,11 +70,14 @@ public class OsmAndLocationProvider implements SensorEventListener {
private static final int GPS_DIST_REQUEST = 0;
private static final int NOT_SWITCH_TO_NETWORK_WHEN_GPS_LOST_MS = 12000;
- private static final long STALE_LOCATION_TIMEOUT = 1000 * 60 * 60; // 60 minutes
- public static final long STALE_LOCATION_TIMEOUT_FOR_ICON = 1000 * 60 * 5; // 5 minutes
+ private static final long STALE_LOCATION_TIMEOUT = 1000 * 60 * 5; // 5 minutes
+ private static final long STALE_LOCATION_TIMEOUT_FOR_UI = 1000 * 60 * 15; // 15 minutes
private static final int UPDATES_BEFORE_CHECK_LOCATION = 100;
private int updatesCounter;
+ private int updatesCounterUi;
+
+ private net.osmand.Location cachedLocation;
private long lastTimeGPSLocationFixed = 0;
private boolean gpsSignalLost;
@@ -877,6 +881,26 @@ public class OsmAndLocationProvider implements SensorEventListener {
return location;
}
+ @Nullable
+ public net.osmand.Location getLastStaleKnownLocation() {
+ if (updatesCounterUi == 0) {
+ net.osmand.Location newLoc = getLastKnownLocation();
+ if (newLoc == null) {
+ if (cachedLocation != null && System.currentTimeMillis() - cachedLocation.getTime() > STALE_LOCATION_TIMEOUT_FOR_UI) {
+ cachedLocation = null;
+ }
+ } else {
+ cachedLocation = newLoc;
+ }
+ }
+ if (updatesCounterUi == UPDATES_BEFORE_CHECK_LOCATION) {
+ updatesCounterUi = 0;
+ } else {
+ updatesCounterUi++;
+ }
+ return cachedLocation;
+ }
+
public void showNavigationInfo(TargetPoint pointToNavigate, Context uiActivity) {
getNavigationInfo().show(pointToNavigate, getHeading(), uiActivity);
diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
index b533b3857e..34216131d9 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
@@ -713,6 +713,9 @@ public class OsmandSettings {
public final CommonPreference RULER_MODE = new EnumIntPreference<>("ruler_mode", RulerMode.FIRST, RulerMode.values()).makeGlobal();
+ public final CommonPreference SHOW_LINES_TO_FIRST_MARKERS = new BooleanPreference("show_lines_to_first_markers", false).makeGlobal();
+ public final CommonPreference SHOW_ARROWS_TO_FIRST_MARKERS = new BooleanPreference("show_arrows_to_first_markers", false).makeGlobal();
+
public final CommonPreference USE_MAPILLARY_FILTER = new BooleanPreference("use_mapillary_filters", false).makeGlobal();
public final CommonPreference MAPILLARY_FILTER_USER_KEY = new StringPreference("mapillary_filter_user_key", "").makeGlobal();
public final CommonPreference MAPILLARY_FILTER_USERNAME = new StringPreference("mapillary_filter_username", "").makeGlobal();
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
index 5b8dddc12d..300df40f42 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
@@ -24,9 +24,9 @@ import net.osmand.plus.OsmandSettings.MapMarkersOrderByMode;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dashboard.DashboardOnMap;
-import net.osmand.plus.mapmarkers.ShowDirectionBottomSheetDialogFragment.ShowDirectionFragmentListener;
import net.osmand.plus.mapmarkers.OptionsBottomSheetDialogFragment.MarkerOptionsFragmentListener;
import net.osmand.plus.mapmarkers.OrderByBottomSheetDialogFragment.OrderByFragmentListener;
+import net.osmand.plus.mapmarkers.ShowDirectionBottomSheetDialogFragment.ShowDirectionFragmentListener;
import java.util.ArrayList;
import java.util.Arrays;
@@ -44,12 +44,14 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
private LockableViewPager viewPager;
private TextView orderByModeTitle;
+ private boolean lightTheme;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OsmandApplication app = getMyApplication();
- boolean isLightTheme = app.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
- int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
+ lightTheme = app.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
+ int themeId = lightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
setStyle(STYLE_NO_FRAME, themeId);
}
@@ -95,6 +97,9 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
View mainView = inflater.inflate(R.layout.fragment_map_markers_dialog, container);
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.map_markers_toolbar);
+ if (!lightTheme) {
+ toolbar.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.actionbar_dark_color));
+ }
orderByModeTitle = toolbar.findViewById(R.id.order_by_mode_text);
setOrderByMode(getMyApplication().getSettings().MAP_MARKERS_ORDER_BY_MODE.get());
@@ -121,6 +126,10 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
viewPager.setAdapter(adapter);
BottomNavigationView bottomNav = mainView.findViewById(R.id.map_markers_bottom_navigation);
+ if (!lightTheme) {
+ bottomNav.setItemIconTintList(ContextCompat.getColorStateList(getContext(), R.color.bottom_navigation_color_selector_dark));
+ bottomNav.setItemTextColor(ContextCompat.getColorStateList(getContext(), R.color.bottom_navigation_color_selector_dark));
+ }
bottomNav.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java
index 6ef6cbd9fa..c340f1dff7 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java
@@ -22,43 +22,45 @@ import net.osmand.util.MapUtils;
public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassListener, OsmAndLocationListener {
- public static final String TAG = "MapMarkersGroupsFragment";
+ public static final String TAG = "MapMarkersGroupsFragment";
- private MapMarkersGroupsAdapter adapter;
+ private MapMarkersGroupsAdapter adapter;
private Float heading;
private Location location;
private boolean locationUpdateStarted;
- @Nullable
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- final RecyclerView recyclerView = new RecyclerView(getContext());
- recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
- final MapActivity mapActivity = (MapActivity) getActivity();
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ final RecyclerView recyclerView = new RecyclerView(getContext());
+ recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
+ final MapActivity mapActivity = (MapActivity) getActivity();
- adapter = new MapMarkersGroupsAdapter(mapActivity);
+ adapter = new MapMarkersGroupsAdapter(mapActivity);
recyclerView.setAdapter(adapter);
- return recyclerView;
- }
+ return recyclerView;
+ }
- void updateAdapter() {
- if (adapter != null) {
- adapter.notifyDataSetChanged();
- }
- }
+ void updateAdapter() {
+ if (adapter != null) {
+ adapter.createDisplayGroups();
+ adapter.updateShowDirectionMarkers();
+ adapter.notifyDataSetChanged();
+ }
+ }
- @Override
- public void onResume() {
- super.onResume();
- adapter.setScreenOrientation(DashLocationFragment.getScreenOrientation(getActivity()));
- startLocationUpdate();
- }
+ @Override
+ public void onResume() {
+ super.onResume();
+ adapter.setScreenOrientation(DashLocationFragment.getScreenOrientation(getActivity()));
+ startLocationUpdate();
+ }
- @Override
- public void onPause() {
- super.onPause();
- stopLocationUpdate();
- }
+ @Override
+ public void onPause() {
+ super.onPause();
+ stopLocationUpdate();
+ }
void startLocationUpdate() {
OsmandApplication app = getMyApplication();
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/OptionsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/OptionsBottomSheetDialogFragment.java
index 48063aef11..3e26135a91 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/OptionsBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/OptionsBottomSheetDialogFragment.java
@@ -1,7 +1,9 @@
package net.osmand.plus.mapmarkers;
+import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
+import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
@@ -43,7 +45,7 @@ public class OptionsBottomSheetDialogFragment extends BottomSheetDialogFragment
}
((ImageView) mainView.findViewById(R.id.sort_by_icon))
- .setImageDrawable(getIcon(R.drawable.ic_sort_waypoint_dark, R.color.on_map_icon_color));
+ .setImageDrawable(getContentIcon(R.drawable.ic_sort_waypoint_dark));
OsmandSettings.MapMarkersMode mode = getMyApplication().getSettings().MAP_MARKERS_MODE.get();
ImageView showDirectionIcon = (ImageView) mainView.findViewById(R.id.show_direction_icon);
int imageResId = 0;
@@ -55,16 +57,16 @@ public class OptionsBottomSheetDialogFragment extends BottomSheetDialogFragment
imageResId = R.drawable.ic_action_device_widget;
break;
}
- showDirectionIcon.setBackgroundDrawable(getIcon(R.drawable.ic_action_device_top, R.color.on_map_icon_color));
+ showDirectionIcon.setBackgroundDrawable(getContentIcon(R.drawable.ic_action_device_top));
if (imageResId != 0) {
showDirectionIcon.setImageDrawable(getIcon(imageResId, R.color.dashboard_blue));
}
((ImageView) mainView.findViewById(R.id.build_route_icon))
- .setImageDrawable(getIcon(R.drawable.map_directions, R.color.on_map_icon_color));
+ .setImageDrawable(getContentIcon(R.drawable.map_directions));
((ImageView) mainView.findViewById(R.id.save_as_new_track_icon))
- .setImageDrawable(getIcon(R.drawable.ic_action_polygom_dark, R.color.on_map_icon_color));
+ .setImageDrawable(getContentIcon(R.drawable.ic_action_polygom_dark));
((ImageView) mainView.findViewById(R.id.move_all_to_history_icon))
- .setImageDrawable(getIcon(R.drawable.ic_action_history2, R.color.on_map_icon_color));
+ .setImageDrawable(getContentIcon(R.drawable.ic_action_history2));
((TextView) mainView.findViewById(R.id.show_direction_text_view)).setText(getMyApplication().getSettings().MAP_MARKERS_MODE.get().toHumanString(getActivity()));
@@ -171,6 +173,11 @@ public class OptionsBottomSheetDialogFragment extends BottomSheetDialogFragment
}
}
+ @Override
+ protected Drawable getContentIcon(@DrawableRes int id) {
+ return getIcon(id, getMyApplication().getSettings().isLightContent() ? R.color.on_map_icon_color : R.color.ctx_menu_info_text_dark);
+ }
+
interface MarkerOptionsFragmentListener {
void sortByOnClick();
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/OrderByBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/OrderByBottomSheetDialogFragment.java
index 168f9e281a..cd044f5ff6 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/OrderByBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/OrderByBottomSheetDialogFragment.java
@@ -1,7 +1,9 @@
package net.osmand.plus.mapmarkers;
+import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
+import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
@@ -121,6 +123,11 @@ public class OrderByBottomSheetDialogFragment extends BottomSheetDialogFragment
}
}
+ @Override
+ protected Drawable getContentIcon(@DrawableRes int id) {
+ return getIcon(id, settings.isLightContent() ? R.color.on_map_icon_color : R.color.ctx_menu_info_text_dark);
+ }
+
private View.OnClickListener orderByModeOnClickListener = new View.OnClickListener() {
@Override
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/ShowDirectionBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/ShowDirectionBottomSheetDialogFragment.java
index 43148b2a13..a7d10456db 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/ShowDirectionBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/ShowDirectionBottomSheetDialogFragment.java
@@ -1,7 +1,10 @@
package net.osmand.plus.mapmarkers;
+import android.app.Activity;
+import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
+import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.view.ContextThemeWrapper;
@@ -12,6 +15,7 @@ import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.WindowManager;
+import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
@@ -19,6 +23,7 @@ import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
+import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.BottomSheetDialogFragment;
import net.osmand.plus.helpers.AndroidUiHelper;
@@ -38,8 +43,9 @@ public class ShowDirectionBottomSheetDialogFragment extends BottomSheetDialogFra
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ final OsmandSettings settings = getMyApplication().getSettings();
portrait = AndroidUiHelper.isOrientationPortrait(getActivity());
- night = !getMyApplication().getSettings().isLightContent();
+ night = !settings.isLightContent();
final int themeRes = night ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_marker_show_direction_bottom_sheet_dialog, container);
@@ -47,7 +53,7 @@ public class ShowDirectionBottomSheetDialogFragment extends BottomSheetDialogFra
AndroidUtils.setBackground(getActivity(), mainView, night, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
}
- OsmandSettings.MapMarkersMode mode = getMyApplication().getSettings().MAP_MARKERS_MODE.get();
+ OsmandSettings.MapMarkersMode mode = settings.MAP_MARKERS_MODE.get();
highlightSelectedItem(mode, true);
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
@@ -84,16 +90,44 @@ public class ShowDirectionBottomSheetDialogFragment extends BottomSheetDialogFra
((TextView) mainView.findViewById(R.id.show_direction_title)).setTextColor(getResources().getColor(R.color.ctx_menu_info_text_dark));
}
+ final CompoundButton showArrowsToggle = (CompoundButton) mainView.findViewById(R.id.show_arrows_switch);
+ showArrowsToggle.setChecked(settings.SHOW_ARROWS_TO_FIRST_MARKERS.get());
+ mainView.findViewById(R.id.show_arrows_row).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ boolean newState = !settings.SHOW_ARROWS_TO_FIRST_MARKERS.get();
+ settings.SHOW_ARROWS_TO_FIRST_MARKERS.set(newState);
+ showArrowsToggle.setChecked(newState);
+ if (getMapActivity() != null) {
+ getMapActivity().refreshMap();
+ }
+ }
+ });
+
+ final CompoundButton showLinesToggle = (CompoundButton) mainView.findViewById(R.id.show_guide_line_switch);
+ showLinesToggle.setChecked(settings.SHOW_LINES_TO_FIRST_MARKERS.get());
+ mainView.findViewById(R.id.show_guide_line_row).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ boolean newState = !settings.SHOW_LINES_TO_FIRST_MARKERS.get();
+ settings.SHOW_LINES_TO_FIRST_MARKERS.set(newState);
+ showLinesToggle.setChecked(newState);
+ if (getMapActivity() != null) {
+ getMapActivity().refreshMap();
+ }
+ }
+ });
+
ImageView topBarIcon = (ImageView) mainView.findViewById(R.id.top_bar_icon);
topBarIcon.setBackgroundDrawable(getIcon(R.drawable.ic_action_device_top, R.color.on_map_icon_color));
- topBarIcon.setImageDrawable(getIcon(R.drawable.ic_action_device_topbar, R.color.dashboard_blue));
+ topBarIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_device_topbar));
ImageView widgetIcon = (ImageView) mainView.findViewById(R.id.widget_icon);
widgetIcon.setBackgroundDrawable(getIcon(R.drawable.ic_action_device_top, R.color.on_map_icon_color));
- widgetIcon.setImageDrawable(getIcon(R.drawable.ic_action_device_widget, R.color.dashboard_blue));
+ widgetIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_device_widget));
ImageView noneIcon = (ImageView) mainView.findViewById(R.id.none_icon);
- noneIcon.setBackgroundDrawable(getIcon(R.drawable.ic_action_device_top, R.color.on_map_icon_color));
+ noneIcon.setBackgroundDrawable(getContentIcon(R.drawable.ic_action_device_top));
mainView.findViewById(R.id.top_bar_row).setOnClickListener(showDirectionOnClickListener);
mainView.findViewById(R.id.widget_row).setOnClickListener(showDirectionOnClickListener);
@@ -157,6 +191,19 @@ public class ShowDirectionBottomSheetDialogFragment extends BottomSheetDialogFra
}
}
+ @Override
+ protected Drawable getContentIcon(@DrawableRes int id) {
+ return getIcon(id, night ? R.color.ctx_menu_info_text_dark : R.color.on_map_icon_color);
+ }
+
+ private MapActivity getMapActivity() {
+ Activity activity = getActivity();
+ if (activity != null) {
+ return (MapActivity) activity;
+ }
+ return null;
+ }
+
private void highlightSelectedItem(OsmandSettings.MapMarkersMode mode, boolean check) {
int iconBgColor = check ? R.color.dashboard_blue : R.color.on_map_icon_color;
int iconColor = check ? R.color.color_dialog_buttons_dark : R.color.dashboard_blue;
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerHeaderViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerHeaderViewHolder.java
index 8f6f7ddcc4..d8748a8786 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerHeaderViewHolder.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerHeaderViewHolder.java
@@ -1,20 +1,26 @@
package net.osmand.plus.mapmarkers.adapters;
import android.support.v7.widget.RecyclerView;
+import android.support.v7.widget.SwitchCompat;
import android.view.View;
import android.widget.ImageButton;
+import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.plus.R;
public class MapMarkerHeaderViewHolder extends RecyclerView.ViewHolder {
- final TextView date;
- final ImageButton optionsBtn;
+ final ImageView icon;
+ final View iconSpace;
+ final TextView title;
+ final SwitchCompat disableGroupSwitch;
public MapMarkerHeaderViewHolder(View itemView) {
super(itemView);
- date = itemView.findViewById(R.id.date_title);
- optionsBtn = itemView.findViewById(R.id.date_options_button);
+ icon = (ImageView) itemView.findViewById(R.id.icon);
+ iconSpace = itemView.findViewById(R.id.icon_space);
+ title = (TextView) itemView.findViewById(R.id.title);
+ disableGroupSwitch = (SwitchCompat) itemView.findViewById(R.id.disable_group_switch);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java
index d531c4d1f7..de5e198d43 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java
@@ -96,7 +96,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter items = new ArrayList<>();
- private boolean night;
- private int screenOrientation;
- private LatLon location;
- private Float heading;
- private boolean useCenter;
+ private List