From 325c7a387fcfab6bc32c6203dd4e30cbf0122a7e Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 22 Sep 2017 18:41:45 +0300 Subject: [PATCH] Do not show disabled markers on map --- OsmAnd/src/net/osmand/plus/MapMarkersHelper.java | 1 + .../net/osmand/plus/mapmarkers/MapMarkersDbHelper.java | 8 ++++---- .../plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index 4a58feecb8..3d5d717eef 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -646,6 +646,7 @@ public class MapMarkersHelper { if (id != null) { markersDbHelper.updateSyncGroupDisabled(id, disabled); } + loadMarkers(); } public void removeActiveMarkersFromSyncGroup(String syncGroupId) { diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java index deda71e17e..48868dd5b2 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java @@ -361,8 +361,8 @@ public class MapMarkersDbHelper { SQLiteConnection db = openConnection(true); if (db != null) { try { - SQLiteCursor query = db.rawQuery(MARKERS_TABLE_SELECT + " WHERE " + MARKERS_COL_ACTIVE + " = ?", - new String[]{String.valueOf(1)}); + SQLiteCursor query = db.rawQuery(MARKERS_TABLE_SELECT + " WHERE " + MARKERS_COL_ACTIVE + " = ? " + "AND " + MARKERS_COL_DISABLED + " = ?", + new String[]{String.valueOf(1), String.valueOf(0)}); if (query.moveToFirst()) { do { MapMarker marker = readItem(query); @@ -502,8 +502,8 @@ public class MapMarkersDbHelper { SQLiteConnection db = openConnection(true); if (db != null) { try { - SQLiteCursor query = db.rawQuery(MARKERS_TABLE_SELECT + " WHERE " + MARKERS_COL_ACTIVE + " = ?", - new String[]{String.valueOf(0)}); + SQLiteCursor query = db.rawQuery(MARKERS_TABLE_SELECT + " WHERE " + MARKERS_COL_ACTIVE + " = ? " + "AND " + MARKERS_COL_DISABLED + " = ?", + new String[]{String.valueOf(0), String.valueOf(0)}); if (query.moveToFirst()) { do { markers.add(readItem(query)); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java index 7ea1c49cf2..c7a58476c9 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java @@ -313,6 +313,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter