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

View file

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

View file

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

View file

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