use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class MapDuringNavigationFragment method setupSnapToRoadPref.
private void setupSnapToRoadPref() {
SwitchPreferenceEx snapToRoad = (SwitchPreferenceEx) findPreference(settings.SNAP_TO_ROAD.getId());
snapToRoad.setTitle(getString(R.string.snap_to_road));
snapToRoad.setDescription(getString(R.string.snap_to_road_descr));
}
use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class RouteParametersFragment method updateRouteRecalcDistancePref.
private void updateRouteRecalcDistancePref() {
SwitchPreferenceEx switchPref = (SwitchPreferenceEx) findPreference(ROUTING_RECALC_DISTANCE);
if (switchPref == null) {
return;
}
ApplicationMode appMode = getSelectedAppMode();
float allowedValue = settings.ROUTE_RECALCULATION_DISTANCE.getModeValue(appMode);
boolean enabled = allowedValue != DISABLE_MODE;
if (allowedValue <= 0) {
allowedValue = RoutingHelper.getDefaultAllowedDeviation(settings, appMode);
}
String summary = String.format(getString(R.string.ltr_or_rtl_combine_via_bold_point), enabled ? getString(R.string.shared_string_enabled) : getString(R.string.shared_string_disabled), OsmAndFormatter.getFormattedDistance(allowedValue, app, false));
switchPref.setSummary(summary);
switchPref.setChecked(enabled);
}
use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class RouteParametersFragment method setupDisableComplexRoutingPref.
private void setupDisableComplexRoutingPref() {
SwitchPreferenceEx disableComplexRouting = createSwitchPreferenceEx(settings.DISABLE_COMPLEX_ROUTING.getId(), R.string.use_two_phase_routing, R.layout.preference_with_descr_dialog_and_switch);
disableComplexRouting.setDescription(getString(R.string.complex_routing_descr));
disableComplexRouting.setSummaryOn(R.string.shared_string_enabled);
disableComplexRouting.setSummaryOff(R.string.shared_string_disabled);
disableComplexRouting.setIconSpaceReserved(true);
getPreferenceScreen().addPreference(disableComplexRouting);
}
use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class RouteParametersFragment method setupReverseDirectionRecalculation.
private void setupReverseDirectionRecalculation(PreferenceScreen screen) {
OsmandPreference<Boolean> preference = settings.DISABLE_WRONG_DIRECTION_RECALC;
SwitchPreferenceEx switchPreference = createSwitchPreferenceEx(preference.getId(), R.string.in_case_of_reverse_direction, R.layout.preference_with_descr_dialog_and_switch);
switchPreference.setIcon(getRoutingPrefIcon(preference.getId()));
switchPreference.setSummaryOn(R.string.shared_string_enabled);
switchPreference.setSummaryOff(R.string.shared_string_disabled);
screen.addPreference(switchPreference);
}
use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class RouteParametersFragment method setupOsmLiveForPublicTransportPref.
private void setupOsmLiveForPublicTransportPref() {
SwitchPreferenceEx useOsmLiveForPublicTransport = createSwitchPreferenceEx(settings.USE_OSM_LIVE_FOR_PUBLIC_TRANSPORT.getId(), R.string.use_live_public_transport, R.layout.preference_with_descr_dialog_and_switch);
useOsmLiveForPublicTransport.setDescription(getString(R.string.use_osm_live_public_transport_description));
useOsmLiveForPublicTransport.setSummaryOn(R.string.shared_string_enabled);
useOsmLiveForPublicTransport.setSummaryOff(R.string.shared_string_disabled);
useOsmLiveForPublicTransport.setIcon(getPersistentPrefIcon(R.drawable.ic_action_osm_live));
useOsmLiveForPublicTransport.setIconSpaceReserved(true);
getPreferenceScreen().addPreference(useOsmLiveForPublicTransport);
}
Aggregations