feat: Playback speed controls for music (#376)

Enable playback speed controls for music

Button is moved to the top left, next to bit rate, because it would
overlap with the "shuffle" button.
The speed rotation logic was cleaned up to 0.25x increments without all
the hard-coded constants and code duplication.

Co-authored-by: eddyizm <eddyizm@gmail.com>
This commit is contained in:
Pascal Grittmann 2026-01-24 17:39:57 +01:00 committed by GitHub
parent 07b507691c
commit d16a9c234f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 53 deletions

View file

@ -16,6 +16,23 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/player_playback_speed_button"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="80dp"
android:layout_height="48dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:insetLeft="0dp"
android:insetTop="0dp"
android:insetRight="0dp"
android:insetBottom="0dp"
app:cornerRadius="30dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:tint="?attr/colorOnPrimaryContainer" />
<com.google.android.material.chip.Chip
android:id="@+id/player_media_extension"
style="@style/Widget.Material3.Chip.Suggestion"
@ -253,23 +270,6 @@
app:layout_constraintStart_toEndOf="@+id/placeholder_view_middle_right"
app:layout_constraintTop_toTopOf="@+id/placeholder_view_middle_right" />
<Button
android:id="@+id/player_playback_speed_button"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginStart="24dp"
android:insetLeft="0dp"
android:insetTop="0dp"
android:insetRight="0dp"
android:insetBottom="0dp"
app:cornerRadius="30dp"
app:layout_constraintBottom_toBottomOf="@+id/placeholder_view_middle_left"
app:layout_constraintEnd_toStartOf="@+id/placeholder_view_middle_left"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/placeholder_view_middle_left"
app:tint="?attr/colorOnPrimaryContainer" />
<ImageButton
android:id="@+id/exo_shuffle"
android:layout_width="32dp"