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!
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!