use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class VoiceAnnouncesFragment method setupArrivalAnnouncementPref.
private void setupArrivalAnnouncementPref() {
Float[] arrivalValues = new Float[] { 1.5f, 1f, 0.5f, 0.25f };
String[] arrivalNames = new String[] { getString(R.string.arrival_distance_factor_early), getString(R.string.arrival_distance_factor_normally), getString(R.string.arrival_distance_factor_late), getString(R.string.arrival_distance_factor_at_last) };
ListPreferenceEx arrivalDistanceFactor = findPreference(settings.ARRIVAL_DISTANCE_FACTOR.getId());
arrivalDistanceFactor.setEntries(arrivalNames);
arrivalDistanceFactor.setEntryValues(arrivalValues);
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class VoiceAnnouncesFragment method setupSpeedLimitExceedPref.
private void setupSpeedLimitExceedPref() {
// array size must be equal!
Float[] valuesKmh = new Float[] { -10f, -7f, -5f, 0f, 5f, 7f, 10f, 15f, 20f };
Float[] valuesMph = new Float[] { -7f, -5f, -3f, 0f, 3f, 5f, 7f, 10f, 15f };
String[] names;
if (settings.METRIC_SYSTEM.getModeValue(getSelectedAppMode()) == MetricsConstants.KILOMETERS_AND_METERS) {
names = new String[valuesKmh.length];
for (int i = 0; i < names.length; i++) {
names[i] = valuesKmh[i].intValue() + " " + getString(R.string.km_h);
}
} else {
names = new String[valuesMph.length];
for (int i = 0; i < names.length; i++) {
names[i] = valuesMph[i].intValue() + " " + getString(R.string.mile_per_hour);
}
}
ListPreferenceEx voiceProvider = findPreference(settings.SPEED_LIMIT_EXCEED_KMH.getId());
voiceProvider.setEntries(names);
voiceProvider.setEntryValues(valuesKmh);
voiceProvider.setEnabled(settings.SPEAK_SPEED_LIMIT.getModeValue(getSelectedAppMode()));
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class GeneralProfileSettingsFragment method setupSpeedSystemPref.
private void setupSpeedSystemPref() {
SpeedConstants[] speedConstants = SpeedConstants.values();
String[] entries = new String[speedConstants.length];
Integer[] entryValues = new Integer[speedConstants.length];
for (int i = 0; i < entries.length; i++) {
entries[i] = speedConstants[i].toHumanString(app);
entryValues[i] = speedConstants[i].ordinal();
}
ListPreferenceEx speedSystem = (ListPreferenceEx) findPreference(settings.SPEED_SYSTEM.getId());
speedSystem.setEntries(entries);
speedSystem.setEntryValues(entryValues);
speedSystem.setDescription(R.string.default_speed_system_descr);
speedSystem.setIcon(getActiveIcon(R.drawable.ic_action_speed));
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class GeneralProfileSettingsFragment method setupExternalInputDevicePref.
private void setupExternalInputDevicePref() {
ListPreferenceEx externalInputDevice = (ListPreferenceEx) findPreference(settings.EXTERNAL_INPUT_DEVICE.getId());
externalInputDevice.setSummary(R.string.sett_no_ext_input);
externalInputDevice.setEntries(new String[] { getString(R.string.sett_generic_ext_input), getString(R.string.sett_wunderlinq_ext_input), getString(R.string.sett_parrot_ext_input) });
externalInputDevice.setEntryValues(new Integer[] { OsmandSettings.GENERIC_EXTERNAL_DEVICE, OsmandSettings.WUNDERLINQ_EXTERNAL_DEVICE, OsmandSettings.PARROT_EXTERNAL_DEVICE });
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class GeneralProfileSettingsFragment method setupMapScreenOrientationPref.
private void setupMapScreenOrientationPref() {
final ListPreferenceEx mapScreenOrientation = (ListPreferenceEx) findPreference(settings.MAP_SCREEN_ORIENTATION.getId());
mapScreenOrientation.setEntries(new String[] { getString(R.string.map_orientation_portrait), getString(R.string.map_orientation_landscape), getString(R.string.map_orientation_default) });
mapScreenOrientation.setEntryValues(new Integer[] { ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED });
mapScreenOrientation.setIcon(getMapScreenOrientationIcon());
}
Aggregations