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) {
|
if (id != null) {
|
||||||
markersDbHelper.updateSyncGroupDisabled(id, disabled);
|
markersDbHelper.updateSyncGroupDisabled(id, disabled);
|
||||||
}
|
}
|
||||||
|
loadMarkers();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeActiveMarkersFromSyncGroup(String syncGroupId) {
|
public void removeActiveMarkersFromSyncGroup(String syncGroupId) {
|
||||||
|
|
|
@ -361,8 +361,8 @@ public class MapMarkersDbHelper {
|
||||||
SQLiteConnection db = openConnection(true);
|
SQLiteConnection db = openConnection(true);
|
||||||
if (db != null) {
|
if (db != null) {
|
||||||
try {
|
try {
|
||||||
SQLiteCursor query = db.rawQuery(MARKERS_TABLE_SELECT + " WHERE " + MARKERS_COL_ACTIVE + " = ?",
|
SQLiteCursor query = db.rawQuery(MARKERS_TABLE_SELECT + " WHERE " + MARKERS_COL_ACTIVE + " = ? " + "AND " + MARKERS_COL_DISABLED + " = ?",
|
||||||
new String[]{String.valueOf(1)});
|
new String[]{String.valueOf(1), String.valueOf(0)});
|
||||||
if (query.moveToFirst()) {
|
if (query.moveToFirst()) {
|
||||||
do {
|
do {
|
||||||
MapMarker marker = readItem(query);
|
MapMarker marker = readItem(query);
|
||||||
|
@ -502,8 +502,8 @@ public class MapMarkersDbHelper {
|
||||||
SQLiteConnection db = openConnection(true);
|
SQLiteConnection db = openConnection(true);
|
||||||
if (db != null) {
|
if (db != null) {
|
||||||
try {
|
try {
|
||||||
SQLiteCursor query = db.rawQuery(MARKERS_TABLE_SELECT + " WHERE " + MARKERS_COL_ACTIVE + " = ?",
|
SQLiteCursor query = db.rawQuery(MARKERS_TABLE_SELECT + " WHERE " + MARKERS_COL_ACTIVE + " = ? " + "AND " + MARKERS_COL_DISABLED + " = ?",
|
||||||
new String[]{String.valueOf(0)});
|
new String[]{String.valueOf(0), String.valueOf(0)});
|
||||||
if (query.moveToFirst()) {
|
if (query.moveToFirst()) {
|
||||||
do {
|
do {
|
||||||
markers.add(readItem(query));
|
markers.add(readItem(query));
|
||||||
|
|
|
@ -313,6 +313,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
||||||
headerViewHolder.iconSpace.setVisibility(View.GONE);
|
headerViewHolder.iconSpace.setVisibility(View.GONE);
|
||||||
headerViewHolder.icon.setImageDrawable(iconsCache.getIcon(groupHeader.getIconRes(), R.color.divider_color));
|
headerViewHolder.icon.setImageDrawable(iconsCache.getIcon(groupHeader.getIconRes(), R.color.divider_color));
|
||||||
boolean groupIsDisabled = groupHeader.getGroup().isDisabled();
|
boolean groupIsDisabled = groupHeader.getGroup().isDisabled();
|
||||||
|
headerViewHolder.disableGroupSwitch.setVisibility(View.VISIBLE);
|
||||||
headerViewHolder.disableGroupSwitch.setChecked(!groupIsDisabled);
|
headerViewHolder.disableGroupSwitch.setChecked(!groupIsDisabled);
|
||||||
headerViewHolder.disableGroupSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
headerViewHolder.disableGroupSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue