Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
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

@DYJParker

Description

@DYJParker

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions