Merge pull request #5215 from osmandapp/hardy_testing

SPEAK_TUNNEL setting
This commit is contained in:
Hardy 2018-04-06 16:16:05 +02:00 committed by GitHub
commit f42952e74c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View file

@ -1099,6 +1099,7 @@ public class OsmandSettings {
public final OsmandPreference<Boolean> SPEAK_PEDESTRIAN = new BooleanPreference("speak_pedestrian", true).makeProfile().cache(); public final OsmandPreference<Boolean> SPEAK_PEDESTRIAN = new BooleanPreference("speak_pedestrian", true).makeProfile().cache();
public final OsmandPreference<Boolean> SPEAK_SPEED_LIMIT = new BooleanPreference("speak_speed_limit", true).makeProfile().cache(); public final OsmandPreference<Boolean> SPEAK_SPEED_LIMIT = new BooleanPreference("speak_speed_limit", true).makeProfile().cache();
public final OsmandPreference<Boolean> SPEAK_SPEED_CAMERA = new BooleanPreference("speak_cameras", false).makeProfile().cache(); public final OsmandPreference<Boolean> SPEAK_SPEED_CAMERA = new BooleanPreference("speak_cameras", false).makeProfile().cache();
public final OsmandPreference<Boolean> SPEAK_TUNNELS = new BooleanPreference("speak_tunnels", false).makeProfile().cache();
public final OsmandPreference<Boolean> ANNOUNCE_WPT = new BooleanPreference("announce_wpt", true).makeGlobal().cache(); public final OsmandPreference<Boolean> ANNOUNCE_WPT = new BooleanPreference("announce_wpt", true).makeGlobal().cache();
public final OsmandPreference<Boolean> ANNOUNCE_NEARBY_FAVORITES = new BooleanPreference("announce_nearby_favorites", false).makeProfile().cache(); public final OsmandPreference<Boolean> ANNOUNCE_NEARBY_FAVORITES = new BooleanPreference("announce_nearby_favorites", false).makeProfile().cache();
public final OsmandPreference<Boolean> ANNOUNCE_NEARBY_POI = new BooleanPreference("announce_nearby_poi", false).makeProfile().cache(); public final OsmandPreference<Boolean> ANNOUNCE_NEARBY_POI = new BooleanPreference("announce_nearby_poi", false).makeProfile().cache();

View file

@ -636,11 +636,12 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
} else if (preference == speakAlarms) { } else if (preference == speakAlarms) {
AlertDialog dlg = showBooleanSettings(new String[] { getString(R.string.speak_street_names), AlertDialog dlg = showBooleanSettings(new String[] { getString(R.string.speak_street_names),
getString(R.string.speak_traffic_warnings), getString(R.string.speak_pedestrian), getString(R.string.speak_traffic_warnings), getString(R.string.speak_pedestrian),
getString(R.string.speak_speed_limit), getString(R.string.speak_cameras), getString(R.string.speak_speed_limit), getString(R.string.speak_cameras), getString(R.string.show_tunnels),
getString(R.string.announce_gpx_waypoints), getString(R.string.speak_favorites), getString(R.string.announce_gpx_waypoints), getString(R.string.speak_favorites),
getString(R.string.speak_poi) }, new OsmandPreference[] { settings.SPEAK_STREET_NAMES, getString(R.string.speak_poi) }, new OsmandPreference[] { settings.SPEAK_STREET_NAMES,
settings.SPEAK_TRAFFIC_WARNINGS, settings.SPEAK_PEDESTRIAN, settings.SPEAK_SPEED_LIMIT, settings.SPEAK_TRAFFIC_WARNINGS, settings.SPEAK_PEDESTRIAN, settings.SPEAK_SPEED_LIMIT,
settings.SPEAK_SPEED_CAMERA, settings.ANNOUNCE_WPT, settings.ANNOUNCE_NEARBY_FAVORITES, settings.SPEAK_SPEED_CAMERA, settings.SPEAK_TUNNELS,
settings.ANNOUNCE_WPT, settings.ANNOUNCE_NEARBY_FAVORITES,
settings.ANNOUNCE_NEARBY_POI }, preference.getTitle()); settings.ANNOUNCE_NEARBY_POI }, preference.getTitle());
final boolean initialSpeedCam = settings.SPEAK_SPEED_CAMERA.get(); final boolean initialSpeedCam = settings.SPEAK_SPEED_CAMERA.get();
final boolean initialFavorites = settings.ANNOUNCE_NEARBY_FAVORITES.get(); final boolean initialFavorites = settings.ANNOUNCE_NEARBY_FAVORITES.get();

View file

@ -219,6 +219,8 @@ public class WaypointHelper {
app.getSettings().SPEAK_TRAFFIC_WARNINGS.setModeValue(appMode, enable); app.getSettings().SPEAK_TRAFFIC_WARNINGS.setModeValue(appMode, enable);
app.getSettings().SHOW_PEDESTRIAN.setModeValue(appMode, enable); app.getSettings().SHOW_PEDESTRIAN.setModeValue(appMode, enable);
app.getSettings().SPEAK_PEDESTRIAN.setModeValue(appMode, enable); app.getSettings().SPEAK_PEDESTRIAN.setModeValue(appMode, enable);
app.getSettings().SHOW_TUNNELS.setModeValue(appMode, enable);
app.getSettings().SPEAK_TUNNELS.setModeValue(appMode, enable);
//But do not implicitly change speed_cam settings here because of legal restrictions in some countries, so Nav settings must prevail //But do not implicitly change speed_cam settings here because of legal restrictions in some countries, so Nav settings must prevail
} else if (type == POI) { } else if (type == POI) {
app.getSettings().SHOW_NEARBY_POI.setModeValue(appMode, enable); app.getSettings().SHOW_NEARBY_POI.setModeValue(appMode, enable);

View file

@ -349,6 +349,14 @@ public class VoiceRouter {
p.attention(type+"").play(); p.attention(type+"").play();
} }
} }
} else if (type == AlarmInfoType.TUNNEL) {
if (router.getSettings().SPEAK_TUNNELS.get()) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p != null) {
notifyOnVoiceMessage();
p.attention(type+"").play();
}
}
} else { } else {
if (router.getSettings().SPEAK_TRAFFIC_WARNINGS.get()) { if (router.getSettings().SPEAK_TRAFFIC_WARNINGS.get()) {
CommandBuilder p = getNewCommandPlayerToPlay(); CommandBuilder p = getNewCommandPlayerToPlay();