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.

Lay the bottom tabs out with LiquidBottomTab

Lelonio6858a545cfa1
diff --git a/.claude/settings.local.json b/.claude/settings.local.json
index 1d6d30c..882b0b2 100644
--- a/.claude/settings.local.json
+++ b/.claude/settings.local.json
@@ -56,7 +56,8 @@
"Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Frost the player glass, fix the white playing row *)",
"Bash(sed -n '/^fun LiquidBottomTabs\\(/,/^\\) {/p' app/src/main/java/dev/emanuele/spot/ui/glass/LiquidBottomTabs.kt)",
"Bash(sed -n '/^fun.*LiquidBottomTab\\\\b/,/^\\) {/p' app/src/main/java/dev/emanuele/spot/ui/glass/LiquidBottomTab.kt)",
- "Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Restore the bottom bar'\\\\''s colours after the file rebuild *)"
+ "Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Restore the bottom bar'\\\\''s colours after the file rebuild *)",
+ "Bash(git -c user.name=Emanuele -c [email protected] commit -qm 'Lay the bottom tabs out with LiquidBottomTab *)"
]
}
}
diff --git a/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin b/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin
index 386e7fd..dcf7aa1 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/SpotApp.kt b/app/src/main/java/dev/emanuele/spot/ui/SpotApp.kt
index 8c4ef46..16f990c 100644
--- a/app/src/main/java/dev/emanuele/spot/ui/SpotApp.kt
+++ b/app/src/main/java/dev/emanuele/spot/ui/SpotApp.kt
@@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
@@ -69,6 +70,7 @@ import dev.emanuele.spot.data.CatalogPlaylist
import dev.emanuele.spot.data.CatalogTrack
import dev.emanuele.spot.data.Lyrics
import dev.emanuele.spot.playback.AudioEffects
+import dev.emanuele.spot.ui.glass.LiquidBottomTab
import dev.emanuele.spot.ui.glass.LiquidBottomTabs
import dev.emanuele.spot.ui.glass.LiquidButton
import dev.emanuele.spot.ui.home.HomeScreen
@@ -526,7 +528,7 @@ private fun BottomBar(
* separate the two tints.
*/
@Composable
-private fun BottomItem(
+private fun RowScope.BottomItem(
label: String,
filled: ImageVector,
outlined: ImageVector,
@@ -538,13 +540,12 @@ private fun BottomItem(
// readable, and some of those colours have almost no contrast against the
// glass.
val tint = if (selected) Ink else Ink.copy(alpha = 0.62f)
- Column(
- Modifier
- .clip(RoundedCornerShape(14.dp))
- .clickable(onClick = onClick)
- .padding(horizontal = 22.dp, vertical = 4.dp),
- horizontalAlignment = Alignment.CenterHorizontally,
- ) {
+ // `LiquidBottomTab` rather than a Column of our own, and this is not
+ // cosmetic: it takes an equal share of the row, and the sliding indicator is
+ // positioned as `index * (barWidth / tabsCount)`. A tab sized by its own
+ // padding leaves the two disagreeing — labels packed to the left with the
+ // indicator sitting under empty space.
+ LiquidBottomTab(onClick = onClick) {
Icon(
imageVector = if (selected) filled else outlined,
contentDescription = label,