Add a statusbar padding to the refreshingOffset & refreshTreshold (see code below)
See that the statusbar offsets are not handled.
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.
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.