fullscreen player tablet layout

This commit is contained in:
Boof2015
2026-08-01 01:52:29 -04:00
parent a5e23ce49a
commit 9764e828bd
10 changed files with 537 additions and 107 deletions
@@ -126,6 +126,9 @@ class AstraQueueModule : Module() {
Prop("palette") { view, values: Map<String, Any?>? ->
view.palette = QueuePalette.from(values)
}
Prop("paneMode") { view, paneMode: Boolean? ->
view.paneMode = paneMode == true
}
OnViewDidUpdateProps { view ->
view.setPlaybackRequestListener { entryId, revision ->
emitPlaybackRequest(entryId, revision)
@@ -22,6 +22,12 @@ class AstraQueueView(
content.palette = value
}
var paneMode: Boolean = false
set(value) {
field = value
content.paneMode = value
}
init {
addView(
content,
@@ -3,6 +3,7 @@ package expo.modules.astralibraryscanner.queue
import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
import android.graphics.Typeface
@@ -106,6 +107,21 @@ class QueueContentView(
applyPalette()
}
/**
* Embedded as the now-playing companion pane. The pane is opened from a
* button that already names it, so the title and count are a second copy of
* something the screen says elsewhere. Edit is a function rather than a
* label, so it stays and simply right-aligns in the row the labels leave.
*/
var paneMode: Boolean = false
set(value) {
field = value
val labelVisibility = if (value) GONE else VISIBLE
titleView.visibility = labelVisibility
countView.visibility = labelVisibility
applyPalette()
}
var active: Boolean = true
set(value) {
field = value
@@ -559,10 +575,14 @@ class QueueContentView(
}
private fun applyPalette() {
background = if (sheetMode) {
topRounded(palette.background, 16f)
} else {
ColorDrawable(palette.background)
background = when {
sheetMode -> topRounded(palette.background, 16f)
// The companion pane is a region of the player's own surface, not a panel
// on top of it. Painting `background` here drew a second slab inside the
// column — a bordered card floating in the middle of the screen, while
// the lyrics companion beside it had none.
paneMode -> null
else -> ColorDrawable(palette.background)
}
sheetHandle.background = rounded(palette.divider, 999f)
titleView.setTextColor(palette.text)
@@ -930,7 +950,14 @@ class QueueContentView(
row.artwork.visibility = if (editing) GONE else VISIBLE
row.handle.visibility = if (editing) GONE else VISIBLE
row.setSurfaceColor(
if (item.entryId in selected) palette.selectedSurface else palette.surface,
when {
item.entryId in selected -> palette.selectedSurface
// Rows paint their own surface so a sheet reads as a stack of
// cards. In the pane that surface is a second slab per row on top
// of the player's background — the pane is the player's surface.
this@QueueContentView.paneMode -> Color.TRANSPARENT
else -> palette.surface
},
)
loadArtwork(row.artwork, item.artworkThumbPath)
row.setOnClickListener { onRowClick?.invoke(item) }