Search in sources :

Example 16 with ListPreferenceEx

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);
}
Also used : ListPreferenceEx(net.osmand.plus.settings.preferences.ListPreferenceEx) SpannableString(android.text.SpannableString)

Example 17 with ListPreferenceEx

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);
}
Also used : ListPreferenceEx(net.osmand.plus.settings.preferences.ListPreferenceEx) SpannableString(android.text.SpannableString)

Example 18 with ListPreferenceEx

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));
}
Also used : ListPreferenceEx(net.osmand.plus.settings.preferences.ListPreferenceEx) ArrayList(java.util.ArrayList) SpannableString(android.text.SpannableString)

Example 19 with ListPreferenceEx

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);
}
Also used : ListPreferenceEx(net.osmand.plus.settings.preferences.ListPreferenceEx)

Example 20 with ListPreferenceEx

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);
}
Also used : ListPreferenceEx(net.osmand.plus.settings.preferences.ListPreferenceEx)

Aggregations

ListPreferenceEx (net.osmand.plus.settings.preferences.ListPreferenceEx)41 SpannableString (android.text.SpannableString)13 ArrayList (java.util.ArrayList)5 ApplicationMode (net.osmand.plus.settings.backend.ApplicationMode)4 SpannableStringBuilder (android.text.SpannableStringBuilder)3 Camera (android.hardware.Camera)2 MultiSelectBooleanPreference (net.osmand.plus.settings.preferences.MultiSelectBooleanPreference)2 SwitchPreferenceEx (net.osmand.plus.settings.preferences.SwitchPreferenceEx)2 RoutingParameter (net.osmand.router.GeneralRouter.RoutingParameter)2 Context (android.content.Context)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 FragmentManager (androidx.fragment.app.FragmentManager)1 EditTextPreference (androidx.preference.EditTextPreference)1 Preference (androidx.preference.Preference)1 PreferenceScreen (androidx.preference.PreferenceScreen)1 Map (java.util.Map)1 OsmandApplication (net.osmand.plus.OsmandApplication)1 BooleanPreference (net.osmand.plus.settings.backend.preferences.BooleanPreference)1 CommonPreference (net.osmand.plus.settings.backend.preferences.CommonPreference)1