use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MonitoringSettingsFragment method setupTrackStorageDirectoryPref.
private void setupTrackStorageDirectoryPref() {
Integer[] entryValues = new Integer[] { REC_DIRECTORY, MONTHLY_DIRECTORY };
String[] entries = new String[entryValues.length];
entries[0] = getString(R.string.store_tracks_in_rec_directory);
entries[1] = getString(R.string.store_tracks_in_monthly_directories);
// entries[2] = getString(R.string.store_tracks_in_daily_directories);
ListPreferenceEx trackStorageDirectory = (ListPreferenceEx) findPreference(settings.TRACK_STORAGE_DIRECTORY.getId());
trackStorageDirectory.setEntries(entries);
trackStorageDirectory.setEntryValues(entryValues);
trackStorageDirectory.setDescription(R.string.track_storage_directory_descrp);
trackStorageDirectory.setIcon(getActiveIcon(R.drawable.ic_action_folder));
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MonitoringSettingsFragment method setupSaveGlobalTrackIntervalPref.
private void setupSaveGlobalTrackIntervalPref() {
HashMap<Object, String> entry = getTimeValues();
ListPreferenceEx saveTrackInterval = (ListPreferenceEx) findPreference(settings.SAVE_GLOBAL_TRACK_INTERVAL.getId());
saveTrackInterval.setEntries(entry.values().toArray(new String[0]));
saveTrackInterval.setEntryValues(entry.keySet().toArray());
ApplicationMode selectedAppMode = getSelectedAppMode();
saveTrackInterval.setValue(settings.SAVE_GLOBAL_TRACK_INTERVAL.getModeValue(selectedAppMode));
saveTrackInterval.setIcon(getActiveIcon(R.drawable.ic_action_time_span));
saveTrackInterval.setDescription(R.string.save_global_track_interval_descr);
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MonitoringSettingsFragment method setupSaveTrackIntervalPref.
private void setupSaveTrackIntervalPref() {
HashMap<Object, String> entry = getTimeValues();
ListPreferenceEx saveTrackInterval = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_INTERVAL.getId());
saveTrackInterval.setEntries(entry.values().toArray(new String[0]));
saveTrackInterval.setEntryValues(entry.keySet().toArray());
saveTrackInterval.setIcon(getActiveIcon(R.drawable.ic_action_time_span));
saveTrackInterval.setDescription(R.string.save_track_interval_descr);
saveTrackInterval.setVisible(settings.SAVE_TRACK_TO_GPX.getModeValue(getSelectedAppMode()));
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MonitoringSettingsFragment method setupSaveTrackMinDistancePref.
private void setupSaveTrackMinDistancePref() {
Float[] entryValues = new Float[] { 0.f, 2.0f, 5.0f, 10.0f, 20.0f, 30.0f, 50.0f };
String[] entries = new String[entryValues.length];
entries[0] = getString(R.string.shared_string_not_selected);
for (int i = 1; i < entryValues.length; i++) {
entries[i] = entryValues[i].intValue() + " " + getString(R.string.m);
}
ListPreferenceEx saveTrackMinDistance = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_DISTANCE.getId());
saveTrackMinDistance.setEntries(entries);
saveTrackMinDistance.setEntryValues(entryValues);
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(getString(R.string.monitoring_min_distance_descr));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_distance_descr_side_effect));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_distance_descr_recommendation));
saveTrackMinDistance.setDescription(stringBuilder.toString());
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MonitoringSettingsFragment method setupSaveTrackMinSpeedPref.
private void setupSaveTrackMinSpeedPref() {
Float[] entryValues = new Float[] { 0.f, 0.000001f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f };
String[] entries = new String[entryValues.length];
entries[0] = getString(R.string.shared_string_not_selected);
// This option for the GPS chipset motion detection
entries[1] = "> 0";
for (int i = 2; i < entryValues.length; i++) {
entries[i] = entryValues[i].intValue() + " " + getString(R.string.km_h);
entryValues[i] = entryValues[i] / 3.6f;
}
ListPreferenceEx saveTrackMinSpeed = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_SPEED.getId());
saveTrackMinSpeed.setEntries(entries);
saveTrackMinSpeed.setEntryValues(entryValues);
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(getString(R.string.monitoring_min_speed_descr));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_speed_descr_side_effect));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_speed_descr_recommendation));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_speed_descr_remark));
saveTrackMinSpeed.setDescription(stringBuilder.toString());
}
Aggregations