playback: use height for playback layouts

Leverage min heights for the playback layouts instead of the land
modifier.

This prevents an issue where some split-screen displays won't use the
correct "compact" layout.
This commit is contained in:
OxygenCobalt 2022-08-04 10:16:26 -06:00
parent a9515e19c0
commit 85eb4cad6c
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
7 changed files with 61 additions and 58 deletions

View file

@ -14,6 +14,7 @@ at the cost of longer loading times
- Playing song is now shown in queue [#92] - Playing song is now shown in queue [#92]
- Added ability to play songs from queue [#92] - Added ability to play songs from queue [#92]
- Added ability to see previous songs in queue - Added ability to see previous songs in queue
- Added dual-pane view of queue and playback on landscape and tablets
- Added Last Added sorting - Added Last Added sorting
- Search now takes sort tags and file names in account [#184] - Search now takes sort tags and file names in account [#184]
- Added option to clear playback state in settings - Added option to clear playback state in settings

View file

@ -44,8 +44,6 @@ import org.oxycblt.auxio.util.systemBarInsetsCompat
* *
* TODO: Add multi-select * TODO: Add multi-select
* *
* TODO: Separate playback views by height
*
* TODO: Find better way to handler recycler divider visibility * TODO: Find better way to handler recycler divider visibility
* *
* @author OxygenCobalt * @author OxygenCobalt

View file

@ -86,7 +86,7 @@ class MainFragment :
} }
} else { } else {
// Dual-pane mode, color/pad the queue sheet manually. Note that we do not round // Dual-pane mode, color/pad the queue sheet manually. Note that we do not round
// corners, as the queue sheet cannot be dragged. // corners, as the queue sheet cannot be dragged in dual-pane mode.
binding.queueSheet.apply { binding.queueSheet.apply {
background = background =
MaterialShapeDrawable.createWithElevationOverlay(context).apply { MaterialShapeDrawable.createWithElevationOverlay(context).apply {

View file

@ -84,17 +84,21 @@ private val Any.autoTag: String
* *
* JUNE 1989 TIANAMEN SQUARE PROTESTS AND MASSACRE 六四事件 * JUNE 1989 TIANAMEN SQUARE PROTESTS AND MASSACRE 六四事件
* *
* UYGHUR GENOCIDE 新疆种族灭绝指控
*
* XINJIANG INTERMENT CAMPS 新疆再教育營
*
* KASHMIR INDEPENDENCE MOVEMENT * KASHMIR INDEPENDENCE MOVEMENT
* *
* WOMEN'S RIGHTS IN THE ISLAMIC REPUBLIC OF IRAN حقوق زنان در ایران * WOMEN'S RIGHTS IN THE ISLAMIC REPUBLIC OF IRAN حقوق زنان در ایران
* *
* FREE TIBET 西藏自由
*
* 1971 BANGLADESHI GENOCIDE BY PAKISTAN
*
* 2022 RUSSIAN INVASION OF UKRAINE Вторжение России на Украину * 2022 RUSSIAN INVASION OF UKRAINE Вторжение России на Украину
* *
* UYGHUR GENOCIDE/XINJIANG INTERNMENT CAMPS 新疆种族灭绝指控/新疆再教育營
*
* KURDISTAN WORKERS PARTY KÜRDISTAN İŞÇI PARTISI (PKK) * KURDISTAN WORKERS PARTY KÜRDISTAN İŞÇI PARTISI (PKK)
*
* TORTURE AND ASSASSINATION OF JAMAL KHASHOGGI مقتل جمال خاشقجي
*/ */
private fun basedCopyleftNotice() { private fun basedCopyleftNotice() {
if (BuildConfig.APPLICATION_ID != "org.oxycblt.auxio" && if (BuildConfig.APPLICATION_ID != "org.oxycblt.auxio" &&

View file

@ -19,64 +19,48 @@
<org.oxycblt.auxio.image.StyledImageView <org.oxycblt.auxio.image.StyledImageView
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full" style="@style/Widget.Auxio.Image.Full"
android:layout_marginStart="@dimen/spacing_medium" android:layout_margin="@dimen/spacing_medium"
android:layout_marginTop="@dimen/spacing_medium" app:layout_constraintBottom_toTopOf="@+id/playback_song"
app:layout_constraintBottom_toTopOf="@+id/playback_seek_bar" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar" app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
app:layout_constraintVertical_chainStyle="packed"
tools:staticIcon="@drawable/ic_song_48" /> tools:staticIcon="@drawable/ic_song_48" />
<!-- TextView is wrapped in a container so that marquee doesn't break --> <TextView
android:id="@+id/playback_song"
<FrameLayout style="@style/Widget.Auxio.TextView.Primary"
android:id="@+id/playback_song_container" android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium" android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
app:layout_constraintBottom_toTopOf="@+id/playback_artist" app:layout_constraintBottom_toTopOf="@+id/playback_artist"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@+id/playback_cover" app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintTop_toTopOf="@+id/playback_cover" tools:text="Song Name" />
app:layout_constraintVertical_chainStyle="packed">
<TextView
android:id="@+id/playback_song"
style="@style/Widget.Auxio.TextView.Primary"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:text="Song Name" />
</FrameLayout>
<TextView <TextView
android:id="@+id/playback_artist" android:id="@+id/playback_artist"
style="@style/Widget.Auxio.TextView.Secondary" style="@style/Widget.Auxio.TextView.Secondary"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium" android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
app:layout_constraintBottom_toTopOf="@+id/playback_album" app:layout_constraintBottom_toTopOf="@+id/playback_album"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintTop_toBottomOf="@+id/playback_song_container"
tools:text="Artist Name" /> tools:text="Artist Name" />
<TextView <TextView
android:id="@+id/playback_album" android:id="@+id/playback_album"
style="@style/Widget.Auxio.TextView.Secondary" style="@style/Widget.Auxio.TextView.Secondary"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium" android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
app:layout_constraintBottom_toBottomOf="@+id/playback_cover" app:layout_constraintBottom_toTopOf="@+id/playback_seek_bar"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintTop_toBottomOf="@+id/playback_artist"
tools:text="Album Name" /> tools:text="Album Name" />
<org.oxycblt.auxio.playback.StyledSeekBar <org.oxycblt.auxio.playback.StyledSeekBar
@ -84,7 +68,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/playback_controls_container" app:layout_constraintBottom_toTopOf="@+id/playback_controls_container"
app:layout_constraintEnd_toEndOf="@+id/playback_song_container" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
@ -96,7 +80,6 @@
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
android:layout_marginBottom="@dimen/spacing_medium" android:layout_marginBottom="@dimen/spacing_medium"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"> app:layout_constraintStart_toStartOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
@ -169,5 +152,4 @@
</org.oxycblt.auxio.playback.ForcedLTRFrameLayout> </org.oxycblt.auxio.playback.ForcedLTRFrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
@ -25,6 +24,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar" app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
app:layout_constraintVertical_bias="0.565"
tools:staticIcon="@drawable/ic_song_48" /> tools:staticIcon="@drawable/ic_song_48" />
<TextView <TextView

View file

@ -19,48 +19,64 @@
<org.oxycblt.auxio.image.StyledImageView <org.oxycblt.auxio.image.StyledImageView
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full" style="@style/Widget.Auxio.Image.Full"
android:layout_margin="@dimen/spacing_medium" android:layout_marginStart="@dimen/spacing_medium"
app:layout_constraintBottom_toTopOf="@+id/playback_song" android:layout_marginTop="@dimen/spacing_medium"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toTopOf="@+id/playback_seek_bar"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_toolbar" app:layout_constraintTop_toBottomOf="@+id/playback_toolbar"
app:layout_constraintVertical_chainStyle="packed"
tools:staticIcon="@drawable/ic_song_48" /> tools:staticIcon="@drawable/ic_song_48" />
<TextView <!-- TextView is wrapped in a container so that marquee doesn't break -->
android:id="@+id/playback_song"
style="@style/Widget.Auxio.TextView.Primary" <FrameLayout
android:layout_width="match_parent" android:id="@+id/playback_song_container"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium" android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
app:layout_constraintBottom_toTopOf="@+id/playback_artist" app:layout_constraintBottom_toTopOf="@+id/playback_artist"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintVertical_chainStyle="packed" app:layout_constraintStart_toEndOf="@+id/playback_cover"
tools:text="Song Name" /> app:layout_constraintTop_toTopOf="@+id/playback_cover"
app:layout_constraintVertical_chainStyle="packed">
<TextView
android:id="@+id/playback_song"
style="@style/Widget.Auxio.TextView.Primary"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:text="Song Name" />
</FrameLayout>
<TextView <TextView
android:id="@+id/playback_artist" android:id="@+id/playback_artist"
style="@style/Widget.Auxio.TextView.Secondary" style="@style/Widget.Auxio.TextView.Secondary"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium" android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
app:layout_constraintBottom_toTopOf="@+id/playback_album" app:layout_constraintBottom_toTopOf="@+id/playback_album"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintTop_toBottomOf="@+id/playback_song_container"
tools:text="Artist Name" /> tools:text="Artist Name" />
<TextView <TextView
android:id="@+id/playback_album" android:id="@+id/playback_album"
style="@style/Widget.Auxio.TextView.Secondary" style="@style/Widget.Auxio.TextView.Secondary"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium" android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
app:layout_constraintBottom_toTopOf="@+id/playback_seek_bar" app:layout_constraintBottom_toBottomOf="@+id/playback_cover"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintTop_toBottomOf="@+id/playback_artist"
tools:text="Album Name" /> tools:text="Album Name" />
<org.oxycblt.auxio.playback.StyledSeekBar <org.oxycblt.auxio.playback.StyledSeekBar
@ -68,7 +84,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/playback_controls_container" app:layout_constraintBottom_toTopOf="@+id/playback_controls_container"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="@+id/playback_song_container"
app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
@ -80,6 +96,7 @@
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
android:layout_marginBottom="@dimen/spacing_medium" android:layout_marginBottom="@dimen/spacing_medium"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"> app:layout_constraintStart_toStartOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
@ -152,4 +169,5 @@
</org.oxycblt.auxio.playback.ForcedLTRFrameLayout> </org.oxycblt.auxio.playback.ForcedLTRFrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>