Fixed
Status Update
Comments
lp...@google.com <lp...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit dc1936400b74416c99c96a5b76ca36f785eef36b
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Dec 21 15:53:47 2022
Updates refreshThreshold and refreshingOffset if they change after initial composition
For cases when these values depend on something else that may not be fully available at first composition, such as status bar offsets, we should update these values over time.
Fixes: b/263159832
Test: PullRefreshStateTest
Relnote: "Fixes an issue where rememberPullRefreshState was not updating refreshThreshold and refreshingOffset over time."
Change-Id: Ifed10d3305317f3a46e7e700ce7759746e1cea0e
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/pullrefresh/PullRefreshStateTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/pullrefresh/PullRefresh.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/pullrefresh/PullRefreshState.kt
https://android-review.googlesource.com/2366209
Branch: androidx-main
commit dc1936400b74416c99c96a5b76ca36f785eef36b
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Dec 21 15:53:47 2022
Updates refreshThreshold and refreshingOffset if they change after initial composition
For cases when these values depend on something else that may not be fully available at first composition, such as status bar offsets, we should update these values over time.
Fixes:
Test: PullRefreshStateTest
Relnote: "Fixes an issue where rememberPullRefreshState was not updating refreshThreshold and refreshingOffset over time."
Change-Id: Ifed10d3305317f3a46e7e700ce7759746e1cea0e
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/pullrefresh/PullRefreshStateTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/pullrefresh/PullRefresh.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/pullrefresh/PullRefreshState.kt
na...@google.com <na...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.4.0-alpha04
Description
Jetpack Compose version: 1.3.1 Jetpack Compose component used: androidx.compose.material:material
Android Studio Build: Build #AI-222.4345.14.2221.9321504, built on November 22, 2022
Kotlin version: 1.7.20
Steps to Reproduce or Code Sample to Reproduce:
It seems that insets are first laid out without any insets, the next composition gets the real insets. However as the pull to refresh state is being remembered the offset can never be updated. This causes the pull to refresh indicator to be below the statusbar in our case.
A workaround for now is getting the insets from the activity window insets, however this should not be the proper workaround.
Example code for adding statusbar padding:
It seems to me that the pull to refresh state also needs to recompose on new offsets.