Add navigation type preference to Navigation setting

This commit is contained in:
Dima-1 2019-12-06 09:32:49 +02:00
parent d25c32404a
commit 7340ccabce
2 changed files with 15 additions and 5 deletions

View file

@ -5,12 +5,20 @@
android:title="@string/routing_settings_2"> android:title="@string/routing_settings_2">
<Preference <Preference
android:key="route_parameters" android:key="navigation_type"
android:layout="@layout/preference_with_descr" android:layout="@layout/preference_with_descr"
android:summary="@string/route_parameters_descr" android:summary="@string/rendering_value_car_name"
android:title="@string/route_parameters" android:title="@string/nav_type_hint"
app:fragment="net.osmand.plus.settings.RouteParametersFragment" app:fragment="net.osmand.plus.settings.SelectProfileBottomSheetDialogFragment"
tools:icon="@drawable/ic_action_route_distance" /> tools:icon="@drawable/ic_action_car_dark" />
<Preference
android:key="route_parameters"
android:layout="@layout/preference_with_descr"
android:summary="@string/route_parameters_descr"
android:title="@string/route_parameters"
app:fragment="net.osmand.plus.settings.RouteParametersFragment"
tools:icon="@drawable/ic_action_route_distance" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx <net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="show_routing_alarms" android:key="show_routing_alarms"

View file

@ -13,12 +13,14 @@ public class NavigationFragment extends BaseSettingsFragment {
@Override @Override
protected void setupPreferences() { protected void setupPreferences() {
Preference navigationType = findPreference("navigation_type");
Preference routeParameters = findPreference("route_parameters"); Preference routeParameters = findPreference("route_parameters");
SwitchPreferenceCompat showRoutingAlarms = (SwitchPreferenceCompat) findPreference(settings.SHOW_ROUTING_ALARMS.getId()); SwitchPreferenceCompat showRoutingAlarms = (SwitchPreferenceCompat) findPreference(settings.SHOW_ROUTING_ALARMS.getId());
SwitchPreferenceCompat speakRoutingAlarms = (SwitchPreferenceCompat) findPreference(settings.VOICE_MUTE.getId()); SwitchPreferenceCompat speakRoutingAlarms = (SwitchPreferenceCompat) findPreference(settings.VOICE_MUTE.getId());
SwitchPreferenceCompat turnScreenOn = (SwitchPreferenceCompat) findPreference(settings.TURN_SCREEN_ON_ENABLED.getId()); SwitchPreferenceCompat turnScreenOn = (SwitchPreferenceCompat) findPreference(settings.TURN_SCREEN_ON_ENABLED.getId());
SwitchPreferenceEx animateMyLocation = (SwitchPreferenceEx) findPreference(settings.ANIMATE_MY_LOCATION.getId()); SwitchPreferenceEx animateMyLocation = (SwitchPreferenceEx) findPreference(settings.ANIMATE_MY_LOCATION.getId());
navigationType.setIcon(getContentIcon(R.drawable.ic_action_car_dark));
routeParameters.setIcon(getContentIcon(R.drawable.ic_action_route_distance)); routeParameters.setIcon(getContentIcon(R.drawable.ic_action_route_distance));
showRoutingAlarms.setIcon(getContentIcon(R.drawable.ic_action_alert)); showRoutingAlarms.setIcon(getContentIcon(R.drawable.ic_action_alert));
speakRoutingAlarms.setIcon(getContentIcon(R.drawable.ic_action_volume_up)); speakRoutingAlarms.setIcon(getContentIcon(R.drawable.ic_action_volume_up));