Dev 35: Duo orientation lock, folded portrait only, unfolded landscape only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-11-19 15:41:59 -08:00
1 parent 406895a3f0
commit 9f68aa588b
3 files changed
+17 -6

No files matched your search

+13 -2
View File
@@ -131,13 +131,24 @@ final class Ui {
duo = true
UserDefaults.standard.set(true, forKey: "duoSeen")
}
Orientation.lock(folded)
lockOrientation()
}
/// Split (unfolded) goes landscape at once. Portrait waits a moment and checks again, so a
/// frame without a hinge reading mid-rotation can't throw an unfolded phone back upright.
private func lockOrientation() {
if split { Orientation.lock(.landscape); return }
guard folded else { Orientation.lock(.allButUpsideDown); return }
Task { @MainActor in
try? await Task.sleep(for: .milliseconds(400))
if self.folded { Orientation.lock(.portrait) }
}
}
func setSplit(_ on: Bool) {
guard on != split else { return }
split = on
Orientation.lock(folded)
lockOrientation()
if on {
nowPlayingOpen = false
}