From 7d3b21582cc94b3954d88d57ec3c186712396a78 Mon Sep 17 00:00:00 2001 From: Xiang Rong Lin <41164160+XiangRongLin@users.noreply.github.com> Date: Mon, 2 Mar 2020 19:54:08 +0100 Subject: [PATCH] Use DateUtils constant for 1000 --- .../newpipe/settings/VideoAudioSettingsFragment.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 05c9ca9fc..134285a41 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/VideoAudioSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/VideoAudioSettingsFragment.java @@ -6,6 +6,7 @@ import android.os.Build; import android.os.Bundle; import android.provider.Settings; +import android.text.format.DateUtils; import androidx.annotation.Nullable; import androidx.preference.ListPreference; @@ -65,7 +66,8 @@ public class VideoAudioSettingsFragment extends BasePreferenceFragment { .getBoolean(res.getString(R.string.use_inexact_seek_key), false); for (String durationsValue : durationsValues) { - currentDurationValue = Integer.parseInt(durationsValue) / 1000; + currentDurationValue = + Integer.parseInt(durationsValue) / (int) DateUtils.SECOND_IN_MILLIS; if (inexactSeek && currentDurationValue % 10 == 5) { continue; } @@ -83,8 +85,9 @@ public class VideoAudioSettingsFragment extends BasePreferenceFragment { durations.setEntryValues(displayedDurationValues.toArray(new CharSequence[0])); durations.setEntries(displayedDescriptionValues.toArray(new CharSequence[0])); final int selectedDuration = Integer.parseInt(durations.getValue()); - if (selectedDuration / 1000 % 10 == 5) { - durations.setValue(Integer.toString(selectedDuration + 5 * 1000)); + if (selectedDuration / (int) DateUtils.SECOND_IN_MILLIS % 10 == 5) { + durations.setValue( + Integer.toString(selectedDuration + 5 * (int) DateUtils.SECOND_IN_MILLIS)); } }