Skip to content

hingeStatus can lag the hinge angle #228

Description

@erkamyaman

Building capacitor-foldable I found UIKit updates UIHinge.status lazily, so it disagrees with the angle mid-fold: flat at 60 degrees, folded at 170, and stuck at closed for a moment after reopening. Simulator only so far, no hardware here. Table's in erkamyaman/capacitor-foldable#7.

Mild for the shell: a lazy status means one extra deviceLayoutChange when it corrects, and a stale hingeStatus in the payload until then. refreshHingeStatus() covers resume but not movement in between.

update.hinge?.angle is in the same handler if you want belt and braces. It's radians, and meaningless while status is .unknown. I let the angle override the status, 20 to 160 folded. I can send a PR if useful.

https://github.com/erkamyaman/capacitor-foldable

And I just want to say that I admire your work!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions