use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MonitoringSettingsFragment method setupSaveTrackPrecisionPref.
private void setupSaveTrackPrecisionPref() {
Float[] entryValues = new Float[] { 0.f, 1.0f, 2.0f, 5.0f, 10.0f, 15.0f, 20.0f, 50.0f, 100.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) + " (" + Math.round(entryValues[i] / 0.3048f) + " " + getString(R.string.foot) + ")";
}
ListPreferenceEx saveTrackPrecision = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_PRECISION.getId());
saveTrackPrecision.setEntries(entries);
saveTrackPrecision.setEntryValues(entryValues);
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(getString(R.string.monitoring_min_accuracy_descr));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_accuracy_descr_side_effect));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_accuracy_descr_recommendation));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_accuracy_descr_remark));
saveTrackPrecision.setDescription(stringBuilder.toString());
}
Aggregations