playback: introduce swipe to next

This commit is contained in:
Alexander Capehart
2026-05-17 19:51:53 -06:00
parent bf4c0b84c6
commit 3a1a7ae1c8
17 changed files with 492 additions and 811 deletions
@@ -20,14 +20,15 @@
app:title="@string/lbl_playback"
tools:subtitle="@string/lbl_all_songs" />
<org.oxycblt.auxio.playback.ui.ControlledCoverView
android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full"
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/playback_pager"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginTop="@dimen/spacing_medium"
app:enablePlaybackIndicator="false"
app:enableSelectionBadge="false"
android:clickable="true"
android:focusable="true"
app:layout_constraintDimensionRatio="1"
app:layout_constraintBottom_toTopOf="@+id/playback_seek_bar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
@@ -41,11 +42,11 @@
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_mid_medium"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/playback_cover"
app:layout_constraintBottom_toBottomOf="@+id/playback_pager"
app:layout_constraintEnd_toStartOf="@+id/playback_more"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintTop_toTopOf="@+id/playback_cover"
app:layout_constraintStart_toEndOf="@+id/playback_pager"
app:layout_constraintTop_toTopOf="@+id/playback_pager"
app:layout_constraintVertical_chainStyle="packed">
<TextView
@@ -20,24 +20,14 @@
app:titleTextAppearance="?attr/textAppearanceLabelLargeEmphasized"
tools:subtitle="@string/lbl_all_songs" />
<org.oxycblt.auxio.playback.ui.ControlledCoverView
android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full"
android:layout_margin="@dimen/spacing_medium"
app:enablePlaybackIndicator="false"
app:enableSelectionBadge="false"
app:layout_constraintBottom_toTopOf="@+id/playback_info_container"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
app:layout_constraintVertical_chainStyle="packed" />
<org.oxycblt.auxio.playback.ui.stepper.PlayerFastSeekOverlay
android:id="@+id/playback_fast_seek_overlay"
style="@style/Widget.Auxio.Image.Full"
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/playback_pager"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="@dimen/spacing_medium"
android:clickable="true"
android:focusable="true"
app:layout_constraintDimensionRatio="1"
app:layout_constraintBottom_toTopOf="@+id/playback_info_container"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -21,8 +21,8 @@
tools:subtitle="@string/lbl_all_songs" />
<org.oxycblt.auxio.playback.ui.ControlledCoverView
android:id="@+id/playback_cover"
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/playback_pager"
style="@style/Widget.Auxio.Image.Full"
android:layout_marginVertical="@dimen/spacing_small"
app:enablePlaybackIndicator="false"
@@ -43,8 +43,8 @@
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/playback_controls_wrapper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintTop_toTopOf="@+id/playback_cover"
app:layout_constraintStart_toEndOf="@+id/playback_pager"
app:layout_constraintTop_toTopOf="@+id/playback_pager"
app:layout_constraintVertical_chainStyle="packed">
<TextView
@@ -70,10 +70,10 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_mid_medium"
android:layout_marginEnd="@dimen/spacing_mid_medium"
app:layout_constraintBottom_toBottomOf="@+id/playback_cover"
app:layout_constraintBottom_toBottomOf="@+id/playback_pager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintStart_toEndOf="@+id/playback_pager"
app:layout_constraintTop_toBottomOf="@+id/playback_info_container">
<com.google.android.material.button.MaterialButtonGroup
+37
View File
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<org.oxycblt.auxio.ui.SquareMaskableFrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:shapeAppearance="@style/ShapeAppearance.Material3.Corner.ExtraLarge">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<org.oxycblt.auxio.image.CoverView
android:id="@+id/cover"
style="@style/Widget.Auxio.Image.Full"
android:layout_width="0dp"
android:layout_height="0dp"
app:enablePlaybackIndicator="false"
app:enableSelectionBadge="false"
app:layout_constraintDimensionRatio="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<org.oxycblt.auxio.playback.ui.stepper.PlayerFastSeekOverlay
android:id="@+id/cover_fast_seek_overlay"
style="@style/Widget.Auxio.Image.Full"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</org.oxycblt.auxio.ui.SquareMaskableFrameLayout>
@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2025 Auxio Project
~ player_swipe_indicator_overlay.xml is part of Auxio.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root_constraint_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Left indicator (for previous) with background -->
<org.oxycblt.auxio.playback.ui.swipe.SwipeClipView
android:id="@+id/left_swipe_clip_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="false" />
<org.oxycblt.auxio.playback.ui.swipe.SwipeIndicatorView
android:id="@+id/left_swipe_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium"
android:clickable="false"
android:focusable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- Right indicator (for next) with background -->
<org.oxycblt.auxio.playback.ui.swipe.SwipeClipView
android:id="@+id/right_swipe_clip_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="false" />
<org.oxycblt.auxio.playback.ui.swipe.SwipeIndicatorView
android:id="@+id/right_swipe_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_medium"
android:clickable="false"
android:focusable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2025 Auxio Project
~ player_swipe_indicator_view.xml is part of Auxio.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="ContentDescription"
tools:layout_height="wrap_content"
tools:layout_width="match_parent"
tools:orientation="horizontal"
tools:parentTag="android.widget.LinearLayout">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/swipe_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
tools:src="@drawable/ic_skip_next_24" />
<TextView
android:id="@+id/swipe_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="4dp"
android:textColor="@android:color/white"
android:textSize="14sp"
tools:text="Next" />
</merge>