Status Update
Comments
ra...@google.com <ra...@google.com> #2
Also see issue in delay()
in refresh()
)
da...@gmail.com <da...@gmail.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
da...@gmail.com <da...@gmail.com> #4
Louis, could you take a look at this? :) I had a quick look around but didn't find the cause.
ra...@google.com <ra...@google.com> #5
da...@gmail.com <da...@gmail.com> #6
I got the functionality working in my project but am left with the indicator visible on the screen. I thought perhaps there was some interaction with other things in my project, but I was able to reproduce it in a sample project. I used the Android Studio (macOS, see version at the bottom) new project wizard to create an empty compose activity project and then just added the code from the above PullRefreshSamples.kt. At first I thought I was not able to reproduce it but setting my background to be not white then showed me that it is reproducible. See the attached sample project.
I tried poking around to see if there was something obvious for why this is happening but didn't have any luck. For now, I'm going to revert to using the Accompanist implementation as a workaround. I hope this sample is helpful in figuring this out.
Android Studio Dolphin | 2021.3.1 Patch 1
Build #AI-213.7172.25.2113.9123335, built on September 29, 2022
Runtime version: 11.0.13+0-b1751.21-8125866 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.0
da...@gmail.com <da...@gmail.com> #7
PullRefresh
does not clip, so the indicator is drawn outside the bounds. You can change this in your project by doing:
Box(Modifier.clipToBounds().pullRefresh(state)) {
But maybe we should investigate better documentation for this / considering default behaviour
ra...@google.com <ra...@google.com> #8
Branch: androidx-main
commit b60f5bbe2a643390b95e1130e6a55048e22364cd
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Thu Nov 17 18:07:08 2022
Adds clipping to Modifier.pullRefreshIndicatorTransform
This ensures that when the indicator is offset outside of its bounds (i.e it has not been dragged down yet / is not refreshing), it is not visible. This fixes cases where there is no app bar to draw over the offset indicator / the indicator background color is different from the background it is drawn over.
Bug:
Test: PullRefreshIndicatorTransformTest
Change-Id: Ic15dd35a5b3fd851bae3bc8cc6eda826e2005394
A compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/pullrefresh/PullRefreshIndicatorTransformTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/pullrefresh/PullRefreshIndicatorTransform.kt
su...@google.com <su...@google.com>
da...@gmail.com <da...@gmail.com> #9
Branch: androidx-main
commit 4e301885e5b470a41320fd3900764a2ba5738d53
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Nov 21 19:03:53 2022
Fixes PullRefreshState not resetting indicator position back to 0
If onRefresh never ended up changing refreshing, or refreshing changed to true and false within the same frame so the state write was batched, the indicator would get stuck at its last position as we never animated it back to zero. Instead we now always animate the position back to zero, and any future change to setRefreshing will interrupt this animation and set it to the new correct position.
Fixes:
Test: PullRefreshStateTest
Relnote: "Fixed an issue where PullRefreshIndicator could get stuck after onRefresh is called, if the refreshing state was not changed to true."
Change-Id: Ie24160bf51bd010d165d75675cfb2c51f28dde04
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/pullrefresh/PullRefreshStateTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/pullrefresh/PullRefreshState.kt
su...@google.com <su...@google.com> #10
Hi, in what version can I see this fix ?
sa...@gmail.com <sa...@gmail.com> #11
It hasn't released yet, but it should be in 1.4.0-alpha03 when it released
ra...@google.com <ra...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.4.0-alpha03
Description
My log contains the following statements at the time when the jobs (there are 4) were supposed to execute:
2018-07-15 13:52:15.456 12947-12947/com.dvtonder.chronus D/SystemJobService: Override deadline expired for id 5caee77a-e9c5-4a99-bc7b-651ad21eb94b. Retry requested
2018-07-15 13:52:15.460 12947-12947/com.dvtonder.chronus D/SystemJobService: Override deadline expired for id e3641a8b-1df8-49b9-8c90-1c893c3afc0f. Retry requested
2018-07-15 13:52:15.464 12947-12947/com.dvtonder.chronus D/SystemJobService: Override deadline expired for id db7c03a2-0fe6-42c4-baf8-0ef6e8220e9b. Retry requested
2018-07-15 13:52:15.465 12947-12947/com.dvtonder.chronus D/SystemJobService: Override deadline expired for id d3efce3a-6aa7-4e10-84af-759f1124ccf5. Retry requested
As you can see from the log entries below, things were running just fine up to that point:
2018-07-15 11:30:02.168 12947-12947/com.dvtonder.chronus D/SystemJobService: 5caee77a-e9c5-4a99-bc7b-651ad21eb94b executed on JobScheduler
2018-07-15 11:30:02.396 12947-12947/com.dvtonder.chronus D/SystemJobService: d3efce3a-6aa7-4e10-84af-759f1124ccf5 executed on JobScheduler
2018-07-15 11:30:03.291 12947-12947/com.dvtonder.chronus D/SystemJobService: e3641a8b-1df8-49b9-8c90-1c893c3afc0f executed on JobScheduler
2018-07-15 11:30:03.292 12947-12947/com.dvtonder.chronus D/SystemJobService: db7c03a2-0fe6-42c4-baf8-0ef6e8220e9b executed on JobScheduler
2018-07-15 11:54:09.377 12947-12947/com.dvtonder.chronus D/SystemJobService: onStartJob for b4303ff7-dd6c-4288-8be2-e859c56cddc5
2018-07-15 11:54:09.383 12947-12947/com.dvtonder.chronus D/SystemJobService: onStartJob for 27c2a27b-4da0-4512-ac60-924fb134addd
2018-07-15 11:54:09.478 12947-12947/com.dvtonder.chronus D/SystemJobService: 27c2a27b-4da0-4512-ac60-924fb134addd executed on JobScheduler
2018-07-15 11:54:10.026 12947-12947/com.dvtonder.chronus D/SystemJobService: b4303ff7-dd6c-4288-8be2-e859c56cddc5 executed on JobScheduler
2018-07-15 12:49:00.838 12947-12947/com.dvtonder.chronus D/SystemJobService: onStartJob for e3641a8b-1df8-49b9-8c90-1c893c3afc0f
2018-07-15 12:49:00.865 12947-12947/com.dvtonder.chronus D/SystemJobService: onStartJob for 5caee77a-e9c5-4a99-bc7b-651ad21eb94b
2018-07-15 12:49:01.136 12947-12947/com.dvtonder.chronus D/SystemJobService: onStartJob for db7c03a2-0fe6-42c4-baf8-0ef6e8220e9b
2018-07-15 12:49:01.548 12947-12947/com.dvtonder.chronus D/SystemJobService: onStartJob for d3efce3a-6aa7-4e10-84af-759f1124ccf5
2018-07-15 12:49:09.589 12947-12947/com.dvtonder.chronus D/SystemJobService: db7c03a2-0fe6-42c4-baf8-0ef6e8220e9b executed on JobScheduler
2018-07-15 12:49:17.334 12947-12947/com.dvtonder.chronus D/SystemJobService: d3efce3a-6aa7-4e10-84af-759f1124ccf5 executed on JobScheduler
2018-07-15 12:49:25.292 12947-12947/com.dvtonder.chronus D/SystemJobService: e3641a8b-1df8-49b9-8c90-1c893c3afc0f executed on JobScheduler
2018-07-15 12:49:42.364 12947-12947/com.dvtonder.chronus D/SystemJobService: 5caee77a-e9c5-4a99-bc7b-651ad21eb94b executed on JobScheduler
2018-07-15 12:50:03.938 12947-12947/com.dvtonder.chronus D/SystemJobService: onStartJob for 7fa7b9d0-4e00-466f-a29d-fcc89d4c5b5d
2018-07-15 12:50:04.015 12947-12947/com.dvtonder.chronus D/SystemJobService: 7fa7b9d0-4e00-466f-a29d-fcc89d4c5b5d executed on JobScheduler
2018-07-15 12:50:32.909 12947-12947/com.dvtonder.chronus D/SystemJobService: onStartJob for 204b2e5e-5e24-466e-bdd7-814ef9a4582b
2018-07-15 12:50:33.329 12947-12947/com.dvtonder.chronus D/SystemJobService: 204b2e5e-5e24-466e-bdd7-814ef9a4582b executed on JobScheduler
2018-07-15 13:52:15.456 12947-12947/com.dvtonder.chronus D/SystemJobService: Override deadline expired for id 5caee77a-e9c5-4a99-bc7b-651ad21eb94b. Retry requested
2018-07-15 13:52:15.460 12947-12947/com.dvtonder.chronus D/SystemJobService: Override deadline expired for id e3641a8b-1df8-49b9-8c90-1c893c3afc0f. Retry requested
2018-07-15 13:52:15.464 12947-12947/com.dvtonder.chronus D/SystemJobService: Override deadline expired for id db7c03a2-0fe6-42c4-baf8-0ef6e8220e9b. Retry requested
2018-07-15 13:52:15.465 12947-12947/com.dvtonder.chronus D/SystemJobService: Override deadline expired for id d3efce3a-6aa7-4e10-84af-759f1124ccf5. Retry requested