simplify initVoiceCommandPlayer calling
This commit is contained in:
parent
82e382d7c6
commit
a3877d3fde
5 changed files with 5 additions and 13 deletions
|
@ -362,14 +362,6 @@ public class OsmandApplication extends MultiDexApplication {
|
|||
return player;
|
||||
}
|
||||
|
||||
public void initVoiceCommandPlayer(final Activity uiContext) {
|
||||
initVoiceCommandPlayer(uiContext, true, null, false, false);
|
||||
}
|
||||
|
||||
public void initVoiceCommandPlayer(final Activity uiContext, boolean warningNoneProvider) {
|
||||
initVoiceCommandPlayer(uiContext, warningNoneProvider, null, true, false);
|
||||
}
|
||||
|
||||
public void initVoiceCommandPlayer(final Activity uiContext, boolean warningNoneProvider, Runnable run, boolean showDialog, boolean force) {
|
||||
String voiceProvider = osmandSettings.VOICE_PROVIDER.get();
|
||||
if (voiceProvider == null || OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(voiceProvider)) {
|
||||
|
|
|
@ -418,7 +418,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
ApplicationMode mode = getRouteMode(from);
|
||||
//app.getSettings().APPLICATION_MODE.set(mode);
|
||||
app.getRoutingHelper().setAppMode(mode);
|
||||
app.initVoiceCommandPlayer(mapActivity);
|
||||
app.initVoiceCommandPlayer(mapActivity, true, null, false, false);
|
||||
// save application mode controls
|
||||
settings.FOLLOW_THE_ROUTE.set(false);
|
||||
app.getRoutingHelper().setFollowingMode(false);
|
||||
|
@ -448,7 +448,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
ApplicationMode mode = getRouteMode(null);
|
||||
//app.getSettings().APPLICATION_MODE.set(mode);
|
||||
app.getRoutingHelper().setAppMode(mode);
|
||||
app.initVoiceCommandPlayer(mapActivity);
|
||||
app.initVoiceCommandPlayer(mapActivity, true, null, false, false);
|
||||
// save application mode controls
|
||||
settings.FOLLOW_THE_ROUTE.set(false);
|
||||
app.getRoutingHelper().setFollowingMode(false);
|
||||
|
|
|
@ -456,7 +456,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
|
|||
startActivity(intent);
|
||||
} else {
|
||||
super.onPreferenceChange(preference, newValue);
|
||||
getMyApplication().initVoiceCommandPlayer(this, false);
|
||||
getMyApplication().initVoiceCommandPlayer(this, false, null, true, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ public class FailSafeFuntions {
|
|||
app.getSettings().FOLLOW_THE_ROUTE.set(true);
|
||||
routingHelper.setFollowingMode(true);
|
||||
app.getTargetPointsHelper().updateRouteAndRefresh(true);
|
||||
app.initVoiceCommandPlayer(ma);
|
||||
app.initVoiceCommandPlayer(ma, true, null, false, false);
|
||||
if(ma.getDashboard().isVisible()) {
|
||||
ma.getDashboard().hideDashboard();
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ public class RoutePreferencesMenu {
|
|||
|
||||
public static void applyVoiceProvider(MapActivity mapActivity, String provider) {
|
||||
mapActivity.getMyApplication().getSettings().VOICE_PROVIDER.set(provider);
|
||||
mapActivity.getMyApplication().initVoiceCommandPlayer(mapActivity, false);
|
||||
mapActivity.getMyApplication().initVoiceCommandPlayer(mapActivity, false, null, true, false);
|
||||
}
|
||||
|
||||
private static Set<String> getVoiceFiles(MapActivity mapActivity) {
|
||||
|
|
Loading…
Reference in a new issue