Make interrupt music global

This commit is contained in:
vshcherb 2014-04-28 00:12:15 +02:00
parent 59f5e1c0a7
commit d60df78076
4 changed files with 3 additions and 7 deletions

View file

@ -14,7 +14,6 @@
<ListPreference android:key="auto_zoom_map_new" android:title="@string/auto_zoom_map"
android:summary="@string/auto_zoom_map_descr"></ListPreference>
<CheckBoxPreference android:title="@string/snap_to_road" android:summary="@string/snap_to_road_descr" android:key="snap_to_road"></CheckBoxPreference>
<CheckBoxPreference android:title="@string/interrupt_music" android:summary="@string/interrupt_music_descr" android:key="interrupt_music"></CheckBoxPreference>
<Preference android:title="@string/show_warnings_title" android:summary="@string/show_warnings_descr" android:key="show_routing_alarms"/>
<Preference android:title="@string/speak_title" android:summary="@string/speak_descr" android:key="speak_routing_alarms"/>
<CheckBoxPreference android:summary="@string/use_compass_navigation_descr" android:title="@string/use_compass_navigation"

View file

@ -753,11 +753,7 @@ public class OsmandSettings {
SNAP_TO_ROAD.setModeDefaultValue(ApplicationMode.BICYCLE, true);
}
public final CommonPreference<Boolean> INTERRUPT_MUSIC = new BooleanPreference("interrupt_music", false).makeProfile().cache();
{
INTERRUPT_MUSIC.setModeDefaultValue(ApplicationMode.CAR, true);
INTERRUPT_MUSIC.setModeDefaultValue(ApplicationMode.PEDESTRIAN, true);
}
public final CommonPreference<Boolean> INTERRUPT_MUSIC = new BooleanPreference("interrupt_music", true).makeGlobal();
// this value string is synchronized with settings_pref.xml preference name

View file

@ -247,6 +247,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
}
});
cat.addPreference(lp);
cat.addPreference(createCheckBoxPreference(settings.INTERRUPT_MUSIC, R.string.interrupt_music,
R.string.interrupt_music_descr));
}
applicationModePreference = (ListPreference) screen.findPreference(settings.APPLICATION_MODE.getId());

View file

@ -85,7 +85,6 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
registerBooleanPreference(settings.SNAP_TO_ROAD, screen);
registerBooleanPreference(settings.INTERRUPT_MUSIC, screen);
registerBooleanPreference(settings.USE_COMPASS_IN_NAVIGATION, screen);
Integer[] intValues = new Integer[] { 0, 5, 10, 15, 20, 25, 30, 45, 60, 90};