Fix issue with select all

This commit is contained in:
Victor Shcherb 2015-07-02 20:01:22 +02:00
parent 3aa35b1381
commit 004a44b073
4 changed files with 6 additions and 6 deletions

View file

@ -197,7 +197,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
helper.editPoiFilter(filter); helper.editPoiFilter(filter);
ListView lv = this.getListView(); ListView lv = this.getListView();
AmenityAdapter la = this.getListAdapter(); AmenityAdapter la = this.getListAdapter();
la.notifyDataSetInvalidated(); la.notifyDataSetChanged();
return lv; return lv;
} }
@ -207,6 +207,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
selectAllFromCategory(adapter.getItem(i)); selectAllFromCategory(adapter.getItem(i));
} }
adapter.notifyDataSetChanged();
} }
private void deselectAll(){ private void deselectAll(){

View file

@ -345,7 +345,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
PoiUIFilter custom = getMyApplication().getPoiFilters().getCustomPOIFilter(); PoiUIFilter custom = getMyApplication().getPoiFilters().getCustomPOIFilter();
custom.updateTypesToAccept(f); custom.replaceWithPoiFilter(f);
showEditActivity(custom); showEditActivity(custom);
return true; return true;
} }
@ -410,7 +410,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
this.filter.setFilterByName(null); this.filter.setFilterByName(null);
} }
} else { } else {
this.filter.updateTypesToAccept(custom); this.filter.replaceWithPoiFilter(custom);
} }
filter.clearPreviousZoom(); filter.clearPreviousZoom();
// run query again // run query again

View file

@ -194,6 +194,7 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
} else { } else {
custom.setFilterByName(null); custom.setFilterByName(null);
} }
custom.clearFilter();
custom.updateTypesToAccept(((AbstractPoiType) item)); custom.updateTypesToAccept(((AbstractPoiType) item));
showFilterActivity(custom.getFilterId()); showFilterActivity(custom.getFilterId());
} }

View file

@ -449,9 +449,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter {
public void updateTypesToAccept(AbstractPoiType pt) { public void updateTypesToAccept(AbstractPoiType pt) {
acceptedTypes.clear();
pt.putTypes(acceptedTypes); pt.putTypes(acceptedTypes);
poiAdditionals.clear();
if (pt instanceof PoiType && ((PoiType) pt).isAdditional() && ((PoiType) pt).getParentType() != null) { if (pt instanceof PoiType && ((PoiType) pt).isAdditional() && ((PoiType) pt).getParentType() != null) {
fillPoiAdditionals(((PoiType) pt).getParentType()); fillPoiAdditionals(((PoiType) pt).getParentType());
} else { } else {
@ -488,7 +486,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter {
} }
} }
public void updateTypesToAccept(PoiUIFilter f) { public void replaceWithPoiFilter(PoiUIFilter f) {
acceptedTypes.clear(); acceptedTypes.clear();
acceptedTypes.putAll(f.acceptedTypes); acceptedTypes.putAll(f.acceptedTypes);
poiAdditionals.clear(); poiAdditionals.clear();