seek increment to slider preference

This commit is contained in:
Bnyro 2022-09-29 19:39:01 +02:00
parent 2b0d29c52c
commit f3b8433f1b
5 changed files with 11 additions and 19 deletions

View File

@ -12,4 +12,11 @@ object PreferenceRanges {
0.25f,
1.0f
)
val seekIncrement = SliderRange(
5f,
60f,
5f,
10f
)
}

View File

@ -51,8 +51,8 @@ import com.github.libretube.extensions.formatShort
import com.github.libretube.extensions.hideKeyboard
import com.github.libretube.extensions.query
import com.github.libretube.extensions.toID
import com.github.libretube.models.interfaces.PlayerOptionsInterface
import com.github.libretube.models.PlayerViewModel
import com.github.libretube.models.interfaces.PlayerOptionsInterface
import com.github.libretube.services.BackgroundMode
import com.github.libretube.services.DownloadService
import com.github.libretube.ui.activities.MainActivity

View File

@ -31,6 +31,7 @@ class SliderPreference(
val range = when (key) {
PreferenceKeys.PLAYBACK_SPEED -> PreferenceRanges.playbackSpeed
PreferenceKeys.BACKGROUND_PLAYBACK_SPEED -> PreferenceRanges.playbackSpeed
PreferenceKeys.SEEK_INCREMENT -> PreferenceRanges.seekIncrement
else -> null
}

View File

@ -263,19 +263,6 @@
<item>mpeg</item>
</string-array>
<string-array name="seekIncrement">
<item>5s</item>
<item>10s</item>
<item>20s</item>
<item>30s</item>
</string-array>
<string-array name="seekIncrementValues">
<item>5</item>
<item>10</item>
<item>20</item>
<item>30</item>
</string-array>
<string-array name="fullscreenOrientation">
<item>@string/aspect_ratio</item>
<item>@string/auto_rotation</item>

View File

@ -10,14 +10,11 @@
app:key="playback_speed"
app:title="@string/playback_speed" />
<ListPreference
<com.github.libretube.ui.views.SliderPreference
android:icon="@drawable/ic_skip"
app:defaultValue="5"
app:entries="@array/seekIncrement"
app:entryValues="@array/seekIncrementValues"
app:key="seek_increment"
app:title="@string/seek_increment"
app:useSimpleSummaryProvider="true" />
app:title="@string/seek_increment" />
<ListPreference
android:icon="@drawable/ic_time"