Add option to rewind before skipping back

Add an option to rewind before skipping to prevous song, depending on the user-defined threshhold.
This commit is contained in:
OxygenCobalt
2020-12-12 15:45:51 -07:00
parent aaa1ad1a3d
commit 6882722201
7 changed files with 75 additions and 14 deletions
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="rewind_threshold_min">1</integer>
<integer name="rewind_threshold_max">30</integer>
<integer name="rewind_threshold_default">5</integer>
</resources>
+5
View File
@@ -71,6 +71,11 @@
<string name="setting_behavior">Behavior</string>
<string name="setting_behavior_song_play">When a song is selected</string>
<string name="setting_behavior_rewind_prev">Rewind before skipping back</string>
<string name="setting_behavior_rewind_prev_desc">Rewind before skipping to the previous song</string>
<string name="setting_behavior_rewind_threshold">Rewind threshold</string>
<string name="setting_behavior_rewind_threshold_desc">Progress at which a rewind should occur (seconds)</string>
<!-- Debug Namespace | Debug labels -->
<string name="debug_state_saved">State saved</string>
+18
View File
@@ -93,5 +93,23 @@
app:iconSpaceReserved="false"
app:useSimpleSummaryProvider="true" />
<SwitchPreference
app:key="KEY_PREV_REWIND"
android:title="@string/setting_behavior_rewind_prev"
app:summary="@string/setting_behavior_rewind_prev_desc"
app:iconSpaceReserved="false"
app:defaultValue="true" />
<SeekBarPreference
app:key="KEY_REWIND_THRESHOLD"
android:title="@string/setting_behavior_rewind_threshold"
android:defaultValue="@integer/rewind_threshold_default"
android:max="@integer/rewind_threshold_max"
app:min="@integer/rewind_threshold_min"
app:summary="@string/setting_behavior_rewind_threshold_desc"
app:showSeekBarValue="true"
app:iconSpaceReserved="false"
app:dependency="KEY_PREV_REWIND" />
</PreferenceCategory>
</PreferenceScreen>
+18
View File
@@ -84,5 +84,23 @@
app:iconSpaceReserved="false"
app:useSimpleSummaryProvider="true" />
<SwitchPreference
app:key="KEY_PREV_REWIND"
android:title="@string/setting_behavior_rewind_prev"
app:summary="@string/setting_behavior_rewind_prev_desc"
app:iconSpaceReserved="false"
app:defaultValue="true" />
<SeekBarPreference
app:key="KEY_REWIND_THRESHOLD"
android:title="@string/setting_behavior_rewind_threshold"
android:defaultValue="@integer/rewind_threshold_default"
app:summary="@string/setting_behavior_rewind_threshold_desc"
app:showSeekBarValue="true"
android:max="@integer/rewind_threshold_max"
app:min="@integer/rewind_threshold_min"
app:iconSpaceReserved="false"
app:dependency="KEY_PREV_REWIND" />
</PreferenceCategory>
</PreferenceScreen>