From d37699988e3df1e5a9e4c2efba26a466ac09646d Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 29 Mar 2020 15:15:56 +0200 Subject: [PATCH] Facilitate range 0-3000ms --- .../osmand/plus/development/TestVoiceActivity.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java b/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java index f6bce308a0..8864807e9b 100644 --- a/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java @@ -284,16 +284,11 @@ public class TestVoiceActivity extends OsmandActionBarActivity { } if (description.startsWith("\u25BA (11.2)")) { int ams = ((OsmandApplication) getApplication()).getSettings().AUDIO_MANAGER_STREAM.get(); - if (((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].get() == 1000) { - ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].set(1500); - } else if (((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].get() == 1500) { - ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].set(2000); - } else if (((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].get() == 2000) { - ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].set(2500); - } else if (((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].get() == 2500) { - ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].set(3000); + if (((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].get() >= 3000) { + ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].set(0); } else { - ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].set(1000); + ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].set + (((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].get() + 500); } infoButton.setText("\u25BA (11.1) (Tap to refresh)\n" + getVoiceSystemInfo()); Toast.makeText(TestVoiceActivity.this, "Voice prompt delay changed to " + ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[ams].get() + "\u00A0ms.", Toast.LENGTH_LONG).show();