Do not show disabled markers on map
This commit is contained in:
parent
c3931c7145
commit
325c7a387f
3 changed files with 6 additions and 4 deletions
|
@ -646,6 +646,7 @@ public class MapMarkersHelper {
|
|||
if (id != null) {
|
||||
markersDbHelper.updateSyncGroupDisabled(id, disabled);
|
||||
}
|
||||
loadMarkers();
|
||||
}
|
||||
|
||||
public void removeActiveMarkersFromSyncGroup(String syncGroupId) {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -313,6 +313,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
headerViewHolder.iconSpace.setVisibility(View.GONE);
|
||||
headerViewHolder.icon.setImageDrawable(iconsCache.getIcon(groupHeader.getIconRes(), R.color.divider_color));
|
||||
boolean groupIsDisabled = groupHeader.getGroup().isDisabled();
|
||||
headerViewHolder.disableGroupSwitch.setVisibility(View.VISIBLE);
|
||||
headerViewHolder.disableGroupSwitch.setChecked(!groupIsDisabled);
|
||||
headerViewHolder.disableGroupSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue