butterfly
butterfly copied to clipboard
Folding Feature & state is null always
I am using a CompositionLocalProvider like
CompositionLocalProvider(
LocalWindowDpSize provides rememberWindowDpSize(),
LocalWindowLayoutInfo provides windowLayoutInfoState.value,
LocalPosture provides postureState.value
)
and in my composable
LocalWindowLayoutInfo.current.isSeparating is always false
and
val foldingFeature = LocalWindowLayoutInfo.current.findFoldingFeature()
if (foldingFeature?.state != FoldingFeature.State.HALF_OPENED) {
Text(
stringResource(screen.resourceId),
maxLines = 1,
style = SlackCloneTypography.overline,
)
}
foldingFeature?.state is always null.
Hi @Anmol92verma! Could you share your mobile device information? I just checked Microsoft's Surface Duo 2 works well for me.
@skydoves I have tried both, Surface duo 2 and 7.6 fold in display. I ran the butterfly demo sample also, it does not work the same way.
Here's the link to where It's implemented Link to My Implementation
I am using 1.0.1 version
Moreover LocalWindowLayoutInfo.current.displayFeatures is empty on a foldable device.
I guess there's something issue with the WindowManager API.
The isSeparating is just an extension function, which delegates the original WindowManager API.
I'll look into it more and share solutions with you if I find anything.
Cool, thanks @skydoves for confirming on the reproducibility at your end. thanks!
Hey @Anmol92verma, I found the ticket on issuetracker, it seems still fixing on. I'll trace upcoming versions and let you know if there's any update!