This repository was archived by the owner on Oct 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 968
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
View.draws() never emits in API 25, does in API 28 #506
Copy link
Copy link
Open
Description
Current testbed app works fine on Pixel 3 and emulator both running API 28, but I had a critical bug appear when I tried it on a hardware tablet. Tablet was running API 25, so I spun up an equivalent emulator, and tracked the bug down to the fact that my UI changes go through a delaySubscription operator keyed to the .draws() of my custom view.
Between inserting doOnNext with logger methods into the stream going into the delaySubscription and adding similar doOnSubscribes to the state-stream coming in from the back end, it's clear that the `.draws() stream is simply never emitting on API 25.
Everything in the following executes on API 28, but on API 25 only the "setup in" and "Meta subscribed" logging extension functions are executed.
private fun setupInStreams() {
logger("setup in")
val delayStream =
qenPage.draws()
.doOnNext { iLogger("drawn", qenPage) }
.delay(5, TimeUnit.MILLISECONDS)
.doOnNext { iLogger("delayed", qenPage) }
cd.addAll(
vm.getTouchesOut()
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
qenPage.drawSegment(it)
},
vm.getMetaOut()
.doOnSubscribe { logger("Meta pre-subscribed") }
.observeOn(AndroidSchedulers.mainThread())
.delaySubscription(delayStream)
.doOnSubscribe { logger("Meta subscribed") }
.subscribe {
iLogger("Main activity received", it)
when (it) {
is MetaState.ClearCurrentPage -> qenPage.clearPage()
is MetaState.SelectedPage -> qenPage.drawPage(it.content)
}.exhaustive
}
)
}
Metadata
Metadata
Assignees
Labels
No labels