https://kotlinlang.org logo
#compose
Title
# compose
a

Artur Schwarz

08/15/2022, 11:13 AM
Hi everyone! We have the following code in one of our composables:
Copy code
val appBarContentPadding = WindowInsets
    .statusBars
    .only(WindowInsetsSides.Horizontal + <http://WindowInsetsSides.Top|WindowInsetsSides.Top>)
    .asPaddingValues()

val fullAppBarHeight = remember(appBarContentPadding) {
    appBarHeight + appBarContentPadding.calculateTopPadding()
}
At first, the statusBar Insets have proper values:
InsetsPaddingValues(insets=(statusBars(0, *99*, 0, 0) only WindowInsetsSides(Start+Left+Top+End+Right)), density=DensityImpl(density=3.0, fontScale=1.0))
After a configuration change (such as changing language on the phone and resuming the app) the values are wrong:
InsetsPaddingValues(insets=(statusBars(0, *0*, 0, 0) only WindowInsetsSides(Start+Left+Top+End+Right)), density=DensityImpl(density=3.0, fontScale=1.0))
Could this be a bug or are we doing something wrong?
@harry248 fyi
a

Alex Vanyo

08/15/2022, 6:03 PM
That sounds like a bug, could you create one and provide a sample to reproduce? There’s a similar sounding one here: https://issuetracker.google.com/issues/184380452, so there might be an issue either in androidx.core insets or in Compose’s implementation.
a

Artur Schwarz

08/16/2022, 7:46 AM
@Alex Vanyo Thank you for your reply, where could i post a sample? Here?
a

Alex Vanyo

08/16/2022, 3:47 PM
On a bug in the issue tracker would be great! The link to create a new one for Compose should be in the #compose channel description
4 Views