hide speed cameras poiTypes

This commit is contained in:
veliymolfar 2020-06-10 18:25:34 +03:00
parent f2b1836e53
commit 6cb52d9130
3 changed files with 17 additions and 0 deletions

View file

@ -945,4 +945,17 @@ public class MapPoiTypes {
return pat.isText();
}
}
public void excludeSpeedCameraPoiType() {
Iterator<PoiCategory> categoryIter = categories.iterator();
while (categoryIter.hasNext()) {
Iterator<PoiType> poiIter = categoryIter.next().getPoiTypes().iterator();
while (poiIter.hasNext()) {
PoiType poiType = poiIter.next();
if ("speed_camera".equals(poiType.getKeyName())) {
poiIter.remove();
}
}
}
}
}

View file

@ -389,6 +389,9 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
lockHelper.setLockUIAdapter(this);
mIsDestroyed = false;
if (settings.SPEED_CAMERAS_UNINSTALLED.get()) {
app.getPoiTypes().excludeSpeedCameraPoiType();
}
}
public void exitFromFullScreen(View view) {

View file

@ -63,6 +63,7 @@ public class SpeedCamerasBottomSheet extends MenuBottomSheetDialogFragment {
app.getSettings().SPEED_CAMERAS_UNINSTALLED.set(true);
app.getSettings().SPEAK_SPEED_CAMERA.set(false);
app.getSettings().SHOW_CAMERAS.set(false);
app.getPoiTypes().excludeSpeedCameraPoiType();
SearchResultMatcher.setSpeedCamerasUninstalled(true);
Fragment targetFragment = getTargetFragment();
if (targetFragment instanceof OnSpeedCamerasUninstallListener) {