From 6a42714326dbd42dabdf4b072cf25396fa4da529 Mon Sep 17 00:00:00 2001 From: Xiang Rong Lin <41164160+XiangRongLin@users.noreply.github.com> Date: Mon, 2 Mar 2020 19:52:42 +0100 Subject: [PATCH] Round seek duration up instead of setting it to 10 seconds --- .../schabi/newpipe/settings/VideoAudioSettingsFragment.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/VideoAudioSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/VideoAudioSettingsFragment.java index 20e68078a..05c9ca9fc 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/VideoAudioSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/VideoAudioSettingsFragment.java @@ -82,8 +82,9 @@ public class VideoAudioSettingsFragment extends BasePreferenceFragment { final ListPreference durations = (ListPreference) findPreference(getString(R.string.seek_duration_key)); durations.setEntryValues(displayedDurationValues.toArray(new CharSequence[0])); durations.setEntries(displayedDescriptionValues.toArray(new CharSequence[0])); - if (Integer.parseInt(durations.getValue()) / 1000 % 10 == 5) { - durations.setValueIndex(0); + final int selectedDuration = Integer.parseInt(durations.getValue()); + if (selectedDuration / 1000 % 10 == 5) { + durations.setValue(Integer.toString(selectedDuration + 5 * 1000)); } }