mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
gate the library on playback restore so the bottom bar lands in place
The tab bar was laid out before playback was known, so the restored mini player arrived later and re-laid the whole bottom area: a couple of frames of bump, and the mini player "loading in" after the library. SubtracksRoot now waits for PlaybackController to finish connecting and restoring (a `ready` flag, set after restore or on disconnect) before it composes the library, so the first library frame already includes the mini player and nothing moves. With playback resolved up front, the `restored` flag and its special enter/inset specs are pointless, so they are reverted; playback the user starts animates as before.
This commit is contained in:
@@ -28,6 +28,7 @@ import okhttp3.OkHttpClient
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
@@ -161,17 +162,16 @@ class PlaybackControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun restoringMarksTheStateUntilPlaybackStarts() {
|
||||
fun theReadyStateResolvesWithTheRestoredItemAlreadyInPlace() {
|
||||
seedAlbum(5, sourceId = 1)
|
||||
runBlocking { queues.replace(listOf(queues.albumEntry(1, "al1"))) }
|
||||
|
||||
assertFalse(controller.ready.value)
|
||||
|
||||
controller.connect()
|
||||
await { handle.items.isNotEmpty() }
|
||||
await { controller.ready.value }
|
||||
|
||||
assertTrue(controller.state.value.restored)
|
||||
|
||||
controller.playAlbum(1, "al1", 0)
|
||||
await { !controller.state.value.restored }
|
||||
assertNotNull("the mini player must be drawable once ready", controller.state.value.item)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user