Fixed
Status Update
Comments
ma...@google.com <ma...@google.com> #2
Can you provide a full working sample in a github project? I'm missing some of the context
ma...@google.com <ma...@google.com> #3
My guess is that you might need to hoist the PullToRefreshState to a level where it's not affected by the navigation. You could have a field in your ViewModel for it
hm...@gmail.com <hm...@gmail.com> #5
Sorry, it's company project. I put all nessasary in one gist file. If you have time, please help me find if anything wrong. Thanks.
Here's the gist link:https://gist.github.com/hmy65/c87c68e4b6c4540f607bb0e5a65fe23c
Here's the gist link:
co...@google.com <co...@google.com>
ma...@google.com <ma...@google.com> #6
@hm...@gmail.com
oh I was asking if you could make a small sample that repros this issue, not your entire project Regardless you can try with the snapshot once my change lands.
hm...@gmail.com <hm...@gmail.com> #7
I recorded an video repros this issue, please ignore all characters are in chinese :)
Here's youtube link:https://youtube.com/shorts/KbMW64LnKGM
Here's youtube link:
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit d14335543592e75fc9dcfd258048ac29de24ab8e
Author: Mariano Martin <marianomartin@google.com>
Date: Fri May 31 11:50:13 2024
[PullToRefresh] Correctly update position when isRefreshing is true
Test: PullToRefreshBoxTest
Bug: 343505109
Change-Id: I2cde0aabbc15ea077a9acf177f5ea0d79375f753
A compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/pulltorefresh/PullToRefreshBoxTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/pulltorefresh/PullToRefresh.kt
https://android-review.googlesource.com/3109738
Branch: androidx-main
commit d14335543592e75fc9dcfd258048ac29de24ab8e
Author: Mariano Martin <marianomartin@google.com>
Date: Fri May 31 11:50:13 2024
[PullToRefresh] Correctly update position when isRefreshing is true
Test: PullToRefreshBoxTest
Bug: 343505109
Change-Id: I2cde0aabbc15ea077a9acf177f5ea0d79375f753
A compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/pulltorefresh/PullToRefreshBoxTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/pulltorefresh/PullToRefresh.kt
ma...@google.com <ma...@google.com> #9
@hm...@gmail.com could you test on the snapshot for this change?
ma...@google.com <ma...@google.com>
hm...@gmail.com <hm...@gmail.com> #10
@ma...@google.com
Tested on snapshot-11950690, fixed.
Thanks.
Tested on snapshot-11950690, fixed.
Thanks.
ma...@google.com <ma...@google.com> #11
Thanks so much for verifying!!
pr...@google.com <pr...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.3.0-beta03
androidx.compose.material3:material3-android:1.3.0-beta03
androidx.compose.material3:material3-desktop:1.3.0-beta03
Description
androidxComposeMaterial3 = "1.3.0-beta02"
In screen 1, when I try pull refresh, if I navigate to screen2 before pull refresh animation finished, then I call popbackstack to screen1, the pull refresh indicator is stucked(static on screen).
Even I try to set state.isRefreshing to false when onresume called, still stucked.
Full code here,
fun refreshPlanList(scrollToTop: Boolean) {
async {
update { copy(isRefreshing = true) }
delay(333L)
update { copy(isRefreshing = false) }
}
updatePlanList { if (scrollToTop) scrollToTop() }
}
PullToRefreshBox(
modifier = Modifier.fillMaxSize(),
isRefreshing = state.isRefreshing,
onRefresh = { viewModel.refreshPlanList(scrollToTop = true) }
) {
LazyColumn(
modifier = Modifier.fillMaxSize(),
state = listState,
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
items(
items = state.filteredPlanList,
key = { plan -> plan.serialNum }) { plan ->
...
}
}}