Skip to content

Unofficial YouTube Music / Spotify Premium client for Android, built in Liquid Glass. Audio effects, Spotify Connect, listening history, 8 languages. Rust core on librespot.

Panels share the lyrics' space; slimmer switch

Lelonio15e1145abd67
diff --git a/.claude/settings.local.json b/.claude/settings.local.json
index ff71af1..4439382 100644
--- a/.claude/settings.local.json
+++ b/.claude/settings.local.json
@@ -94,7 +94,8 @@
"Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Contract the player as it collapses *)",
"Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Make closing the player the opening reversed *)",
"Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Player controls: one queue button, a working heart, icon tabs *)",
- "Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Switch the player'\\\\''s views with the segmented control *)"
+ "Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Switch the player'\\\\''s views with the segmented control *)",
+ "Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Panels share the lyrics'\\\\'' space; slimmer switch *)"
]
}
}
diff --git a/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin b/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin
index 40dd0ba..54dfd8b 100644
--- a/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin
+++ b/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin
@@ -2,27 +2,27 @@ C/C++ Structured Logl
j
h/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/additional_project_files.txtC
A
-?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  �����3  ����3i
+?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  �����3  ����3i
g
-e/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/android_gradle_build.json  �����3� ����3n
+e/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/android_gradle_build.json  �����3� ����3n
l
-j/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/android_gradle_build_mini.json  �����3� �����3[
+j/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/android_gradle_build_mini.json  �����3� �����3[
Y
-W/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build.ninja  �����3�� ����3_
+W/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build.ninja  �����3�� ����3_
]
-[/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build.ninja.txt  �����3d
+[/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build.ninja.txt  �����3d
b
-`/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build_file_index.txt  �����3 @ ����3e
+`/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build_file_index.txt  �����3 @ ����3e
c
-a/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/compile_commands.json  �����3�� ����3i
+a/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/compile_commands.json  �����3�� ����3i
g
-e/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/compile_commands.json.bin  �����3 �" ����3o
+e/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/compile_commands.json.bin  �����3 �" ����3o
m
-k/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/metadata_generation_command.txt  �����3
+k/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/metadata_generation_command.txt  �����3
� ����3b
`
-^/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/prefab_config.json  �����3  ( ����3g
+^/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/prefab_config.json  �����3  ( ����3g
e
-c/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/symbol_folder_index.txt  �����3  b ����3D
+c/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/symbol_folder_index.txt  �����3  b ����3D
B
-@/Users/emanuele/Progetto Spotify/app/src/main/cpp/CMakeLists.txt  �����3 � �Ȅ��3
\ No newline at end of file
+@/Users/emanuele/Progetto Spotify/app/src/main/cpp/CMakeLists.txt  �����3 � �Ȅ��3
\ No newline at end of file
diff --git a/app/src/main/java/dev/emanuele/spot/ui/glass/LiquidBottomTabs.kt b/app/src/main/java/dev/emanuele/spot/ui/glass/LiquidBottomTabs.kt
index f43a5ae..c8bbd6d 100644
--- a/app/src/main/java/dev/emanuele/spot/ui/glass/LiquidBottomTabs.kt
+++ b/app/src/main/java/dev/emanuele/spot/ui/glass/LiquidBottomTabs.kt
@@ -42,6 +42,7 @@ import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastCoerceIn
import androidx.compose.ui.util.fastRoundToInt
@@ -78,6 +79,10 @@ fun LiquidBottomTabs(
// everything else. Upstream values kept as the defaults.
accentColor: Color = Color(0xFF0091FF),
containerColor: Color = Color(0xFF121212).copy(0.4f),
+ // LOCAL CHANGE: upstream pins the bar at 64dp. The player wants a slimmer
+ // version of the same control, and copying the file to change one number
+ // would leave two of them to keep in step.
+ height: Dp = 64f.dp,
content: @Composable RowScope.() -> Unit
) {
val isLightTheme = !isSystemInDarkTheme()
@@ -189,7 +194,7 @@ fun LiquidBottomTabs(
onDrawSurface = { drawRect(containerColor) }
)
.then(interactiveHighlight.modifier)
- .height(64f.dp)
+ .height(height)
.fillMaxWidth()
.padding(4f.dp),
verticalAlignment = Alignment.CenterVertically,
@@ -228,7 +233,7 @@ fun LiquidBottomTabs(
onDrawSurface = { drawRect(containerColor) }
)
.then(interactiveHighlight.modifier)
- .height(56f.dp)
+ .height(height - 8f.dp)
.fillMaxWidth()
.padding(horizontal = 4f.dp)
.graphicsLayer(colorFilter = ColorFilter.tint(accentColor)),
@@ -290,7 +295,7 @@ fun LiquidBottomTabs(
drawRect(Color.Black.copy(alpha = 0.03f * progress))
}
)
- .height(56f.dp)
+ .height(height - 8f.dp)
.fillMaxWidth(1f / tabsCount)
)
}
diff --git a/app/src/main/java/dev/emanuele/spot/ui/player/PlayerPanel.kt b/app/src/main/java/dev/emanuele/spot/ui/player/PlayerPanel.kt
index 23035f7..2b13695 100644
--- a/app/src/main/java/dev/emanuele/spot/ui/player/PlayerPanel.kt
+++ b/app/src/main/java/dev/emanuele/spot/ui/player/PlayerPanel.kt
@@ -78,7 +78,10 @@ fun PlayerPanelSection(
/** The layer the panel refracts; see the liquid-glass note in PlayerScreen. */
backdrop: com.kyant.backdrop.Backdrop,
) {
- Column(Modifier.fillMaxWidth()) {
+ Column(
+ Modifier.fillMaxWidth(),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ ) {
// The same segmented control the tab bar uses, because this is the same
// kind of choice: three views of one screen, exactly one of them
// showing. Three separate toggles said "three independent switches",
@@ -101,9 +104,13 @@ fun PlayerPanelSection(
tabsCount = views.size,
accentColor = GlassInk,
containerColor = GlassFilm,
+ // Slimmer than the tab bar, and icon-only. This one sits under the
+ // transport rather than at the edge of the window, so it has to
+ // read as a smaller thing than the app's own navigation.
+ height = 42.dp,
modifier = Modifier
- .fillMaxWidth()
- .padding(top = 16.dp),
+ .fillMaxWidth(0.72f)
+ .padding(top = 14.dp),
) {
PanelTab(Icons.Filled.Album, "Copertina", selected == 0) { onSelect(PlayerPanel.NONE) }
PanelTab(Icons.Filled.Lyrics, "Testo", selected == 1) {
@@ -114,53 +121,9 @@ fun PlayerPanelSection(
}
}
- // Lyrics are not in here any more: they are drawn in the middle of the
- // player, over the blurred Canvas. The tab stays because it is still
- // what turns them on — it just no longer opens a sheet.
- AnimatedVisibility(
- visible = panel != PlayerPanel.NONE && panel != PlayerPanel.LYRICS,
- ) {
- GlassSurface(
- backdrop = backdrop,
- shape = RoundedCornerShape(26.dp),
- modifier = Modifier
- .fillMaxWidth()
- .padding(top = 12.dp)
- .heightIn(max = 260.dp),
- ) {
- when (panel) {
- PlayerPanel.QUEUE -> QueueList(queue, onPlayQueueItem)
- // Drawn in the middle of the player instead; see
- // LyricsStage in PlayerScreen.
- PlayerPanel.LYRICS -> Unit
- PlayerPanel.EFFECTS -> EffectsPanel(
- speed = speed,
- pitch = pitch,
- reverb = reverb,
- onSpeed = onSpeed,
- onPitch = onPitch,
- onReverb = onReverb,
- presets = presets,
- onApplyPreset = onApplyPreset,
- onSavePreset = onSavePreset,
- onDeletePreset = onDeletePreset,
- backdrop = backdrop,
- )
-
- PlayerPanel.NONE -> Unit
- }
- }
- }
}
}
-/**
- * Icons rather than the words they replaced.
- *
- * Everything else on this screen is a glyph, and three words set in caps read as
- * a different control from the ones around them. The label survives as the
- * content description, which is what a screen reader wants anyway.
- */
@Composable
private fun RowScope.PanelTab(
icon: androidx.compose.ui.graphics.vector.ImageVector,
@@ -173,12 +136,7 @@ private fun RowScope.PanelTab(
imageVector = icon,
contentDescription = label,
tint = if (selected) GlassInk else GlassInkDim,
- modifier = Modifier.size(21.dp),
- )
- Text(
- label,
- style = MaterialTheme.typography.bodySmall,
- color = if (selected) GlassInk else GlassInkDim,
+ modifier = Modifier.size(19.dp),
)
}
}
@@ -187,7 +145,7 @@ private fun RowScope.PanelTab(
data class QueueEntry(val index: Int, val title: String, val artist: String, val isCurrent: Boolean)
@Composable
-private fun QueueList(queue: List<QueueEntry>, onPlay: (Int) -> Unit) {
+internal fun QueueList(queue: List<QueueEntry>, onPlay: (Int) -> Unit) {
if (queue.isEmpty()) {
EmptyPanel("La coda è vuota")
return
@@ -232,7 +190,7 @@ private fun QueueList(queue: List<QueueEntry>, onPlay: (Int) -> Unit) {
* stretcher does the work — see [dev.emanuele.spot.playback.AudioOutput].
*/
@Composable
-private fun EffectsPanel(
+internal fun EffectsPanel(
speed: Float,
pitch: Float,
reverb: Float,
@@ -478,7 +436,7 @@ private fun formatSemitones(pitch: Float): String {
}
@Composable
-private fun EmptyPanel(message: String) {
+internal fun EmptyPanel(message: String) {
Box(
Modifier
.fillMaxWidth()
diff --git a/app/src/main/java/dev/emanuele/spot/ui/player/PlayerScreen.kt b/app/src/main/java/dev/emanuele/spot/ui/player/PlayerScreen.kt
index 8cdd896..8797f1b 100644
--- a/app/src/main/java/dev/emanuele/spot/ui/player/PlayerScreen.kt
+++ b/app/src/main/java/dev/emanuele/spot/ui/player/PlayerScreen.kt
@@ -93,7 +93,7 @@ import dev.emanuele.spot.ui.theme.softShadow
* back here as a full-bleed backdrop.
*/
/** What occupies the middle of the player. */
-private enum class Stage { COVER, LYRICS, CANVAS }
+private enum class Stage { COVER, LYRICS, EFFECTS, QUEUE, CANVAS }
@UnstableApi
@Composable
@@ -154,9 +154,12 @@ fun PlayerScreen(
// the bottom, and the Canvas goes out of focus behind them: a clip is
// motion, and reading over motion is the one thing that does not work. Blur
// keeps it present as light and colour without competing for attention.
- val lyricsOpen = panel == PlayerPanel.LYRICS
+ // Any panel, not just the lyrics: they all sit in the middle of the screen
+ // now, and reading a slider over a moving clip is no easier than reading a
+ // lyric over one.
+ val panelOpen = panel != PlayerPanel.NONE
val canvasBlur by animateDpAsState(
- targetValue = if (lyricsOpen) 26.dp else 0.dp,
+ targetValue = if (panelOpen) 26.dp else 0.dp,
animationSpec = tween(320),
label = "canvasBlur",
)
@@ -262,10 +265,12 @@ fun PlayerScreen(
// sheet should look like, and holding the slot open
// keeps everything below it still.
Crossfade(
- targetState = when {
- lyricsOpen -> Stage.LYRICS
- canvas == null -> Stage.COVER
- else -> Stage.CANVAS
+ targetState = when (panel) {
+ PlayerPanel.LYRICS -> Stage.LYRICS
+ PlayerPanel.EFFECTS -> Stage.EFFECTS
+ PlayerPanel.QUEUE -> Stage.QUEUE
+ PlayerPanel.NONE ->
+ if (canvas == null) Stage.COVER else Stage.CANVAS
},
animationSpec = tween(320),
label = "stage",
@@ -294,6 +299,34 @@ fun PlayerScreen(
onSeek = onSeek,
)
+ // Effects and the queue share the lyrics' space
+ // rather than opening a sheet under the
+ // controls. A panel that pushed the transport
+ // around every time it opened was the reason
+ // this screen never sat still.
+ Stage.EFFECTS -> Box(
+ Modifier.fillMaxSize(),
+ contentAlignment = Alignment.Center,
+ ) {
+ EffectsPanel(
+ speed = state.speed,
+ pitch = state.pitch,
+ reverb = reverb,
+ onSpeed = onSpeed,
+ onPitch = onPitch,
+ onReverb = onReverb,
+ presets = presets,
+ onApplyPreset = onApplyPreset,
+ onSavePreset = onSavePreset,
+ onDeletePreset = onDeletePreset,
+ backdrop = glassBackdrop,
+ )
+ }
+
+ Stage.QUEUE -> Box(Modifier.fillMaxSize()) {
+ QueueList(queue, onPlayQueueItem)
+ }
+
// The clip is the picture, and it is drawn
// behind everything: this slot only has to keep
// the space.