quick action show/hide poi

This commit is contained in:
Rosty 2016-12-30 12:33:37 +02:00
parent 8e3035c5d7
commit efb24f7c03
3 changed files with 19 additions and 9 deletions

View file

@ -308,6 +308,10 @@ public class PoiFiltersHelper {
saveSelectedPoiFilters();
}
public void hidePoiFilters() {
selectedPoiFilters.clear();
}
public String getFiltersName(Set<PoiUIFilter> filters) {
if (filters.isEmpty()) {
return application.getResources().getString(R.string.shared_string_none);

View file

@ -22,6 +22,7 @@ import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.editors.EditCategoryDialogFragment;
import net.osmand.plus.mapcontextmenu.editors.SelectCategoryDialogFragment;
import net.osmand.plus.poi.PoiFiltersHelper;
import net.osmand.plus.widgets.AutoCompleteTextViewEx;
import java.lang.reflect.Type;
@ -423,8 +424,13 @@ public class QuickActionFactory {
@Override
public void execute(MapActivity activity) {
activity.getMyApplication().getSettings().SHOW_NEARBY_POI.set(
!activity.getMyApplication().getSettings().SHOW_NEARBY_POI.get());
PoiFiltersHelper pf = activity.getMyApplication().getPoiFilters();
if (pf.getSelectedPoiFilters().isEmpty()){
pf.loadSelectedPoiFilters();
} else pf.hidePoiFilters();
}
@Override