Modern Apps git

← Modern-Apps.git

music: pop the shuffle FAB when the library fills

Commit
49f9701177568a7d642e8a1ad4e0073d657393a4
Author
Vayun Mathur <[email protected]>
When
2026-12-05 16:25 UTC (17 hours ago)
Parents
5089e3e
The shuffle-everything FAB appeared in a cut once the library
was non-empty. PopVisibility now grows it out of its own spot
and scales it away when the library empties.

Wrap abrupt conditional content in the shared library.ui motion
helpers so it expands/fades/pops in instead of popping in cut, and
closes up cleanly when it goes away. No raw androidx.compose.
animation is used at the call site, per the fatal DirectCompose
Animation lint; durations and easing come from the helpers'
MaterialTheme motion-scheme defaults.

Verified in this worktree with lint, lintVitalRelease and
testDevUnitTest for the module (details in the session report;
any pre-existing failure was reproduced on the pristine base).

Diff

music/src/main/java/com/vayunmathur/music/ui/components/ShufflePlayFab.kt
diff --git a/music/src/main/java/com/vayunmathur/music/ui/components/ShufflePlayFab.kt b/music/src/main/java/com/vayunmathur/music/ui/components/ShufflePlayFab.ktindex a7371a8a04..e94fa3cd5f 100644--- a/music/src/main/java/com/vayunmathur/music/ui/components/ShufflePlayFab.kt+++ b/music/src/main/java/com/vayunmathur/music/ui/components/ShufflePlayFab.kt@@ -4,6 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import com.vayunmathur.library.ui.FloatingActionButton+import com.vayunmathur.library.ui.PopVisibility import com.vayunmathur.library.ui.IconShuffle import com.vayunmathur.music.data.Music import com.vayunmathur.music.ui.SOURCE_ALL_SONGS@@ -22,7 +23,7 @@ fun ShufflePlayFab(musicViewModel: MusicViewModel) { /** Shuffle-everything FAB. Hidden while the library is still empty. */ @Composable fun ShufflePlayFab(songs: List<Music>, onShuffle: () -> Unit) {-    if (songs.isNotEmpty()) {+    PopVisibility(visible = songs.isNotEmpty()) {         FloatingActionButton(onShuffle) {             IconShuffle()         }