Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folding Feature & state is null always #5

Open
oianmol opened this issue Jan 31, 2022 · 6 comments
Open

Folding Feature & state is null always #5

oianmol opened this issue Jan 31, 2022 · 6 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@oianmol
Copy link

oianmol commented Jan 31, 2022

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.

@skydoves
Copy link
Member

Hi @Anmol92verma!
Could you share your mobile device information?
I just checked Microsoft's Surface Duo 2 works well for me.

@oianmol
Copy link
Author

oianmol commented Jan 31, 2022

@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.

@oianmol
Copy link
Author

oianmol commented Jan 31, 2022

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.

@skydoves
Copy link
Member

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.

@oianmol
Copy link
Author

oianmol commented Jan 31, 2022

Cool, thanks @skydoves for confirming on the reproducibility at your end. thanks!

@skydoves skydoves self-assigned this Jan 31, 2022
@skydoves skydoves added the good first issue Good for newcomers label Jan 31, 2022
@skydoves
Copy link
Member

skydoves commented Feb 3, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants