use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class MainSettingsFragment method setupAppProfiles.
private void setupAppProfiles(PreferenceCategory preferenceCategory) {
OsmandApplication app = getMyApplication();
if (app == null) {
return;
}
for (ApplicationMode applicationMode : allAppModes) {
boolean isAppProfileEnabled = availableAppModes.contains(applicationMode);
SwitchPreferenceEx pref = new SwitchPreferenceEx(app);
pref.setPersistent(false);
pref.setKey(applicationMode.getStringKey());
preferenceCategory.addPreference(pref);
pref.setIcon(getAppProfilesIcon(applicationMode, isAppProfileEnabled));
pref.setTitle(applicationMode.toHumanString());
pref.setSummary(ProfileDataUtils.getAppModeDescription(getContext(), applicationMode));
pref.setChecked(isAppProfileEnabled);
pref.setLayoutResource(R.layout.preference_with_descr_dialog_and_switch);
pref.setFragment(ConfigureProfileFragment.class.getName());
}
}
use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class GeneralProfileSettingsFragment method setupVolumeButtonsAsZoom.
private void setupVolumeButtonsAsZoom() {
SwitchPreferenceEx volumeButtonsPref = (SwitchPreferenceEx) findPreference(settings.USE_VOLUME_BUTTONS_AS_ZOOM.getId());
volumeButtonsPref.setTitle(getString(R.string.use_volume_buttons_as_zoom));
volumeButtonsPref.setDescription(getString(R.string.use_volume_buttons_as_zoom_descr));
Drawable icon = getPersistentPrefIcon(R.drawable.ic_action_zoom_volume_buttons);
volumeButtonsPref.setIcon(icon);
}
use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class GeneralProfileSettingsFragment method setupKalmanFilterPref.
private void setupKalmanFilterPref() {
SwitchPreferenceEx kalmanFilterPref = (SwitchPreferenceEx) findPreference(settings.USE_KALMAN_FILTER_FOR_COMPASS.getId());
kalmanFilterPref.setTitle(getString(R.string.use_kalman_filter_compass));
kalmanFilterPref.setDescription(getString(R.string.use_kalman_filter_compass_descr));
}
use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class MultimediaNotesFragment method setupExternalPhotoCamPref.
private void setupExternalPhotoCamPref(Camera cam, AudioVideoNotesPlugin plugin) {
SwitchPreferenceEx externalPhotoCam = (SwitchPreferenceEx) findPreference(plugin.AV_EXTERNAL_PHOTO_CAM.getId());
externalPhotoCam.setDescription(getString(R.string.av_use_external_camera_descr));
externalPhotoCam.setIcon(getPersistentPrefIcon(R.drawable.ic_action_photo_dark));
externalPhotoCam.setEnabled(cam != null);
}
use of net.osmand.plus.settings.preferences.SwitchPreferenceEx in project Osmand by osmandapp.
the class MultimediaNotesFragment method setupPhotoPlaySoundPref.
private void setupPhotoPlaySoundPref(Camera cam, AudioVideoNotesPlugin plugin) {
Drawable disabled = getContentIcon(R.drawable.ic_action_music_off);
Drawable enabled = getActiveIcon(R.drawable.ic_type_audio);
Drawable icon = getPersistentPrefIcon(enabled, disabled);
SwitchPreferenceEx photoPlaySound = (SwitchPreferenceEx) findPreference(plugin.AV_PHOTO_PLAY_SOUND.getId());
photoPlaySound.setDescription(getString(R.string.av_photo_play_sound_descr));
photoPlaySound.setIcon(icon);
photoPlaySound.setEnabled(cam != null);
}
Aggregations