use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MultimediaNotesFragment method setupAudioFormatPref.
private void setupAudioFormatPref(AudioVideoNotesPlugin plugin) {
Integer[] entryValues = new Integer[] { MediaRecorder.AudioEncoder.DEFAULT, MediaRecorder.AudioEncoder.AAC };
String[] entries = new String[] { getString(R.string.shared_string_default), "AAC" };
ListPreferenceEx audioFormat = (ListPreferenceEx) findPreference(plugin.AV_AUDIO_FORMAT.getId());
audioFormat.setEntries(entries);
audioFormat.setEntryValues(entryValues);
audioFormat.setDescription(R.string.av_audio_format_descr);
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MultimediaNotesFragment method setupClipLengthPref.
private void setupClipLengthPref(AudioVideoNotesPlugin plugin) {
Integer[] entryValues = new Integer[] { 1, 2, 3, 4, 5, 7, 10, 15, 20, 25, 30 };
String[] entries = new String[entryValues.length];
int i = 0;
String minStr = getString(R.string.int_min);
for (int v : entryValues) {
entries[i++] = v + " " + minStr;
}
ListPreferenceEx clipLength = (ListPreferenceEx) findPreference(plugin.AV_RS_CLIP_LENGTH.getId());
clipLength.setEntries(entries);
clipLength.setEntryValues(entryValues);
clipLength.setDescription(R.string.rec_split_clip_length_desc);
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class MultimediaNotesFragment method setupVideoQualityPref.
private void setupVideoQualityPref(AudioVideoNotesPlugin plugin) {
List<String> qNames = new ArrayList<>();
List<Integer> qValues = new ArrayList<>();
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_LOW)) {
qNames.add(getString(R.string.av_video_quality_low));
qValues.add(CamcorderProfile.QUALITY_LOW);
}
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_480P)) {
qNames.add("720 x 480 (480p)");
qValues.add(CamcorderProfile.QUALITY_480P);
}
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P)) {
qNames.add("1280 x 720 (720p)");
qValues.add(CamcorderProfile.QUALITY_720P);
}
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_1080P)) {
qNames.add("1920 x 1080 (1080p)");
qValues.add(CamcorderProfile.QUALITY_1080P);
}
if (Build.VERSION.SDK_INT >= 21 && CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_2160P)) {
qNames.add("3840x2160 (2160p)");
qValues.add(CamcorderProfile.QUALITY_2160P);
}
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_HIGH)) {
qNames.add(getString(R.string.av_video_quality_high));
qValues.add(CamcorderProfile.QUALITY_HIGH);
}
String[] entries = qNames.toArray(new String[0]);
Integer[] entryValues = qValues.toArray(new Integer[0]);
ListPreferenceEx videoQuality = (ListPreferenceEx) findPreference(plugin.AV_VIDEO_QUALITY.getId());
videoQuality.setEntries(entries);
videoQuality.setEntryValues(entryValues);
videoQuality.setDescription(R.string.av_video_quality_descr);
videoQuality.setIcon(getActiveIcon(R.drawable.ic_action_picture_size));
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class AccessibilitySettingsFragment method setupAutoAnnouncePeriodPref.
private void setupAutoAnnouncePeriodPref() {
int[] seconds = new int[] { 5, 10, 15, 20, 30, 45, 60, 90 };
int[] minutes = new int[] { 2, 3, 5 };
Integer[] entryValues = new Integer[seconds.length + minutes.length];
String[] entries = new String[entryValues.length];
int k = 0;
for (int second : seconds) {
entryValues[k] = second * 1000;
entries[k] = second + " " + getString(R.string.int_seconds);
k++;
}
for (int minute : minutes) {
entryValues[k] = (minute * 60) * 1000;
entries[k] = minute + " " + getString(R.string.int_min);
k++;
}
ListPreferenceEx autoAnnouncePeriod = (ListPreferenceEx) findPreference(settings.ACCESSIBILITY_AUTOANNOUNCE_PERIOD.getId());
autoAnnouncePeriod.setEntries(entries);
autoAnnouncePeriod.setEntryValues(entryValues);
autoAnnouncePeriod.setDescription(R.string.access_autoannounce_period_descr);
}
use of net.osmand.plus.settings.preferences.ListPreferenceEx in project Osmand by osmandapp.
the class AccessibilitySettingsFragment method setupDirectionStylePref.
private void setupDirectionStylePref() {
RelativeDirectionStyle[] relativeDirectionStyles = RelativeDirectionStyle.values();
String[] entries = new String[relativeDirectionStyles.length];
Integer[] entryValues = new Integer[relativeDirectionStyles.length];
for (int i = 0; i < entries.length; i++) {
entries[i] = relativeDirectionStyles[i].toHumanString(app);
entryValues[i] = relativeDirectionStyles[i].ordinal();
}
ListPreferenceEx directionStyle = (ListPreferenceEx) findPreference(settings.DIRECTION_STYLE.getId());
directionStyle.setEntries(entries);
directionStyle.setEntryValues(entryValues);
directionStyle.setDescription(R.string.settings_direction_style_descr);
}
Aggregations