fix double rotation

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
Toni Förster
2024-09-06 16:47:03 +02:00
parent 2185718d50
commit 4e4add3c42
7 changed files with 13 additions and 15 deletions

View File

@@ -22,8 +22,8 @@ import SwiftUI
// not sure why but first rotation call is ignore so doing rotate to same orientation first
Delay.by(delay) {
let orientation = OrientationTracker.shared.currentDeviceOrientation.isLandscape ? OrientationTracker.shared.currentInterfaceOrientation : self.rotateToLandscapeOnEnterFullScreen.interfaceOrientation
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: OrientationTracker.shared.currentInterfaceOrientation)
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: orientation)
Orientation.lockOrientation(.all, andRotateTo: OrientationTracker.shared.currentInterfaceOrientation)
Orientation.lockOrientation(.all, andRotateTo: orientation)
}
}
}
@@ -37,7 +37,7 @@ import SwiftUI
if !context.isCancelled {
#if os(iOS)
if Constants.isIPhone {
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: .portrait)
Orientation.lockOrientation(.all, andRotateTo: .portrait)
}
if wasPlaying {

View File

@@ -170,7 +170,7 @@ struct BrowsingSettings: View {
Orientation.lockOrientation(.portrait, andRotateTo: .portrait)
} else {
enterFullscreenInLandscape = false
Orientation.lockOrientation(.allButUpsideDown)
Orientation.lockOrientation(.all)
}
}
}

View File

@@ -211,7 +211,7 @@ struct YatteeApp: App {
let rotationOrientation =
OrientationTracker.shared.currentDeviceOrientation.rawValue == 4 ? UIInterfaceOrientation.landscapeRight :
(OrientationTracker.shared.currentDeviceOrientation.rawValue == 3 ? UIInterfaceOrientation.landscapeLeft : UIInterfaceOrientation.portrait)
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: rotationOrientation)
Orientation.lockOrientation(.all, andRotateTo: rotationOrientation)
}
}
#endif