Fixed
Status Update
Comments
py...@gmail.com <py...@gmail.com> #2
Also see issue in delay()
in refresh()
)
ch...@google.com <ch...@google.com> #3
I suspect issue is somehow related to fact that without that delay()
we're not recomposing with refreshing
set to true
....and end up showing CircularArrowIndicator
in PullRefreshIndicator
when we recompose with it set to false
ap...@google.com <ap...@google.com> #4
Louis, could you take a look at this? :) I had a quick look around but didn't find the cause.
Description
androidx.metrics
module used: metrics-performanceandroidx.metrics
version used: 1.0.0-alpha01I was reading the sources for
androidx.metrics.performance.DelegatingOnPreDrawListener#onPreDraw
and noticed what seems like a potential bug pre API 24 (or at list a limitation):androidx.metrics.performance.DelegatingOnPreDrawListener#onPreDraw
posts an async message (great) but not at the front.Pre API 24, the “end” time of a frame is approximated by posting an async message from onPreDraw.
This means there can be messages that were already posted and will execute before it runs. MessageQueue only looks for async messages when there’s a sync barrier, otherwise, they keep their posted order. So if there’s no sync barrier then any already enqueued message will execute right after the frame but before the message posted from onPreDraw runs, which means the frame end time will be off. If there is a sync barrier, this still applies if there are other async messages already posted.