Search in sources :

Example 26 with SwitchPreferenceEx

use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.

the class RouteParametersFragment method setupNativePublicTransport.

private void setupNativePublicTransport() {
    SwitchPreferenceEx setupNativePublicTransport = createSwitchPreferenceEx(settings.PT_SAFE_MODE.getId(), R.string.use_native_pt, R.layout.preference_with_descr_dialog_and_switch);
    setupNativePublicTransport.setDescription(getString(R.string.use_native_pt_desc));
    setupNativePublicTransport.setSummaryOn(R.string.shared_string_enabled);
    setupNativePublicTransport.setSummaryOff(R.string.shared_string_disabled);
    setupNativePublicTransport.setIconSpaceReserved(true);
    getPreferenceScreen().addPreference(setupNativePublicTransport);
}
Also used : SwitchPreferenceEx(net.osmand.plus.settings.preferences.SwitchPreferenceEx)

Example 27 with SwitchPreferenceEx

use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.

the class RouteParametersFragment method setupSelectRouteRecalcDistance.

private void setupSelectRouteRecalcDistance(PreferenceScreen screen) {
    final SwitchPreferenceEx switchPref = createSwitchPreferenceEx(ROUTING_RECALC_DISTANCE, R.string.route_recalculation_dist_title, R.layout.preference_with_descr_dialog_and_switch);
    switchPref.setIcon(getRoutingPrefIcon(ROUTING_RECALC_DISTANCE));
    screen.addPreference(switchPref);
    updateRouteRecalcDistancePref();
}
Also used : SwitchPreferenceEx(net.osmand.plus.settings.preferences.SwitchPreferenceEx)

Example 28 with SwitchPreferenceEx

use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.

the class RouteParametersFragment method setupTimeConditionalRoutingPref.

private void setupTimeConditionalRoutingPref() {
    SwitchPreferenceEx timeConditionalRouting = createSwitchPreferenceEx(settings.ENABLE_TIME_CONDITIONAL_ROUTING.getId(), R.string.temporary_conditional_routing, R.layout.preference_with_descr_dialog_and_switch);
    timeConditionalRouting.setIcon(getRoutingPrefIcon(settings.ENABLE_TIME_CONDITIONAL_ROUTING.getId()));
    timeConditionalRouting.setSummaryOn(R.string.shared_string_on);
    timeConditionalRouting.setSummaryOff(R.string.shared_string_off);
    timeConditionalRouting.setDescription(R.string.temporary_conditional_routing_descr);
    getPreferenceScreen().addPreference(timeConditionalRouting);
}
Also used : SwitchPreferenceEx(net.osmand.plus.settings.preferences.SwitchPreferenceEx)

Example 29 with SwitchPreferenceEx

use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.

the class TurnScreenOnFragment method setupTurnScreenOnSensorPref.

private void setupTurnScreenOnSensorPref() {
    SwitchPreferenceEx turnScreenOnSensor = (SwitchPreferenceEx) findPreference(settings.TURN_SCREEN_ON_SENSOR.getId());
    turnScreenOnSensor.setIcon(getPersistentPrefIcon(R.drawable.ic_action_sensor_interaction));
    turnScreenOnSensor.setDescription(R.string.turn_screen_on_sensor_descr);
}
Also used : SwitchPreferenceEx(net.osmand.plus.settings.preferences.SwitchPreferenceEx)

Example 30 with SwitchPreferenceEx

use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.

the class OsmEditingFragment method setupOfflineEditingPref.

private void setupOfflineEditingPref() {
    Drawable disabled = getContentIcon(R.drawable.ic_action_offline);
    Drawable enabled = getActiveIcon(R.drawable.ic_world_globe_dark);
    Drawable icon = getPersistentPrefIcon(enabled, disabled);
    SwitchPreferenceEx offlineEditingPref = findPreference(plugin.OFFLINE_EDITION.getId());
    offlineEditingPref.setDescription(getString(R.string.offline_edition_descr));
    offlineEditingPref.setIcon(icon);
}
Also used : Drawable(android.graphics.drawable.Drawable) SwitchPreferenceEx(net.osmand.plus.settings.preferences.SwitchPreferenceEx)

Aggregations

SwitchPreferenceEx (net.osmand.plus.settings.preferences.SwitchPreferenceEx)49 Drawable (android.graphics.drawable.Drawable)5 ApplicationMode (net.osmand.plus.settings.backend.ApplicationMode)5 OsmandApplication (net.osmand.plus.OsmandApplication)3 Context (android.content.Context)2 View (android.view.View)2 Fragment (androidx.fragment.app.Fragment)2 Preference (androidx.preference.Preference)2 BaseBottomSheetItem (net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem)2 BottomSheetItemWithCompoundButton (net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton)2 TitleItem (net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem)2 BooleanPreference (net.osmand.plus.settings.backend.preferences.BooleanPreference)2 OsmandPreference (net.osmand.plus.settings.backend.preferences.OsmandPreference)2 OnConfirmPreferenceChange (net.osmand.plus.settings.fragments.OnConfirmPreferenceChange)2 ListPreferenceEx (net.osmand.plus.settings.preferences.ListPreferenceEx)2 MultiSelectBooleanPreference (net.osmand.plus.settings.preferences.MultiSelectBooleanPreference)2 TextView (android.widget.TextView)1 FragmentManager (androidx.fragment.app.FragmentManager)1 EditTextPreference (androidx.preference.EditTextPreference)1 PreferenceScreen (androidx.preference.PreferenceScreen)1