Update settings preferences

This commit is contained in:
vshcherb 2014-02-09 20:14:28 +01:00
parent bda64ba14a
commit bd819555dd
3 changed files with 27 additions and 18 deletions

View file

@ -9,6 +9,8 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="guidance_preferences_descr">Navigation preferences</string>
<string name="routing_preferences_descr">Routing preferences</string>
<string name="speech_rate_descr">Specify speech rate for TTS</string>
<string name="speech_rate">Speech Rate</string>
<string name="tip_recent_changes_1_7_t">Changes in 1.7:

View file

@ -1,18 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<ListPreference android:title="@string/router_service" android:key="router_service" android:summary="@string/router_service_descr"></ListPreference>
<CheckBoxPreference android:summary="@string/fast_route_mode_descr" android:title="@string/fast_route_mode"
<PreferenceCategory android:key="routing_preferences" android:title="@string/routing_preferences_descr">
<CheckBoxPreference android:summary="@string/fast_route_mode_descr" android:title="@string/fast_route_mode"
android:key="fast_route_mode"></CheckBoxPreference>
<ListPreference android:title="@string/voice_provider" android:key="voice_provider" android:summary="@string/voice_provider_descr"></ListPreference>
<ListPreference android:key="auto_follow_route" android:title="@string/choose_auto_follow_route"
android:summary="@string/choose_auto_follow_route_descr"></ListPreference>
<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>
<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"/>
<Preference android:title="@string/avoid_in_routing_title" android:summary="@string/avoid_in_routing_descr" android:key="avoid_in_routing"/>
<Preference android:title="@string/prefer_in_routing_title" android:summary="@string/prefer_in_routing_descr" android:key="prefer_in_routing"/>
<CheckBoxPreference android:summary="@string/use_compass_navigation_descr" android:title="@string/use_compass_navigation"
android:key="use_compass_navigation"></CheckBoxPreference>
<Preference android:title="@string/avoid_in_routing_title" android:summary="@string/avoid_in_routing_descr" android:key="avoid_in_routing"/>
<Preference android:title="@string/prefer_in_routing_title" android:summary="@string/prefer_in_routing_descr" android:key="prefer_in_routing"/>
</PreferenceCategory>
<PreferenceCategory android:key="guidance_preferences" android:title="@string/guidance_preferences_descr">
<ListPreference android:title="@string/voice_provider" android:key="voice_provider" android:summary="@string/voice_provider_descr"></ListPreference>
<ListPreference android:key="auto_follow_route" android:title="@string/choose_auto_follow_route"
android:summary="@string/choose_auto_follow_route_descr"></ListPreference>
<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>
<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"
android:key="use_compass_navigation"></CheckBoxPreference>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -19,6 +19,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
public class SettingsNavigationActivity extends SettingsBaseActivity {
@ -64,6 +65,13 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
settings = getMyApplication().getSettings();
registerBooleanPreference(settings.FAST_ROUTE_MODE, screen);
PreferenceCategory cat = (PreferenceCategory) screen.findPreference("routing_preferences");
avoidRouting = (Preference) screen.findPreference("avoid_in_routing");
avoidRouting.setOnPreferenceClickListener(this);
// routing_preferences
preferRouting = (Preference) screen.findPreference("prefer_in_routing");
preferRouting.setOnPreferenceClickListener(this);
registerBooleanPreference(settings.SNAP_TO_ROAD, screen);
registerBooleanPreference(settings.USE_COMPASS_IN_NAVIGATION, screen);
@ -94,11 +102,6 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
autoZoomMapPreference.setOnPreferenceChangeListener(this);
avoidRouting = (Preference) screen.findPreference("avoid_in_routing");
avoidRouting.setOnPreferenceClickListener(this);
preferRouting = (Preference) screen.findPreference("prefer_in_routing");
preferRouting.setOnPreferenceClickListener(this);
showAlarms = (Preference) screen.findPreference("show_routing_alarms");
showAlarms.setOnPreferenceClickListener(this);