mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 05:23:41 +00:00
fix double rotation
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
parent
2185718d50
commit
4e4add3c42
@ -568,7 +568,7 @@ final class PlayerModel: ObservableObject {
|
|||||||
if lockPortraitWhenBrowsing {
|
if lockPortraitWhenBrowsing {
|
||||||
Orientation.lockOrientation(.portrait, andRotateTo: .portrait)
|
Orientation.lockOrientation(.portrait, andRotateTo: .portrait)
|
||||||
} else {
|
} else {
|
||||||
Orientation.lockOrientation(.allButUpsideDown)
|
Orientation.lockOrientation(.all)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -822,7 +822,7 @@ final class PlayerModel: ObservableObject {
|
|||||||
} else {
|
} else {
|
||||||
isOrientationLocked = false
|
isOrientationLocked = false
|
||||||
lockedOrientation = nil
|
lockedOrientation = nil
|
||||||
Orientation.lockOrientation(.allButUpsideDown)
|
Orientation.lockOrientation(.all)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1167,7 +1167,7 @@ final class PlayerModel: ObservableObject {
|
|||||||
Orientation.lockOrientation(
|
Orientation.lockOrientation(
|
||||||
isOrientationLocked
|
isOrientationLocked
|
||||||
? (lockOrientation == .landscapeRight ? .landscapeRight : .landscapeLeft)
|
? (lockOrientation == .landscapeRight ? .landscapeRight : .landscapeLeft)
|
||||||
: .landscape,
|
: .all,
|
||||||
andRotateTo: orientation
|
andRotateTo: orientation
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -1181,7 +1181,7 @@ final class PlayerModel: ObservableObject {
|
|||||||
lockedOrientation = UIInterfaceOrientationMask.portrait
|
lockedOrientation = UIInterfaceOrientationMask.portrait
|
||||||
}
|
}
|
||||||
let rotationOrientation = lockPortraitWhenBrowsing ? UIInterfaceOrientation.portrait : nil
|
let rotationOrientation = lockPortraitWhenBrowsing ? UIInterfaceOrientation.portrait : nil
|
||||||
Orientation.lockOrientation(lockPortraitWhenBrowsing ? .portrait : .allButUpsideDown, andRotateTo: rotationOrientation)
|
Orientation.lockOrientation(lockPortraitWhenBrowsing ? .portrait : .all, andRotateTo: rotationOrientation)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,8 @@ import SwiftUI
|
|||||||
// not sure why but first rotation call is ignore so doing rotate to same orientation first
|
// not sure why but first rotation call is ignore so doing rotate to same orientation first
|
||||||
Delay.by(delay) {
|
Delay.by(delay) {
|
||||||
let orientation = OrientationTracker.shared.currentDeviceOrientation.isLandscape ? OrientationTracker.shared.currentInterfaceOrientation : self.rotateToLandscapeOnEnterFullScreen.interfaceOrientation
|
let orientation = OrientationTracker.shared.currentDeviceOrientation.isLandscape ? OrientationTracker.shared.currentInterfaceOrientation : self.rotateToLandscapeOnEnterFullScreen.interfaceOrientation
|
||||||
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: OrientationTracker.shared.currentInterfaceOrientation)
|
Orientation.lockOrientation(.all, andRotateTo: OrientationTracker.shared.currentInterfaceOrientation)
|
||||||
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: orientation)
|
Orientation.lockOrientation(.all, andRotateTo: orientation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ import SwiftUI
|
|||||||
if !context.isCancelled {
|
if !context.isCancelled {
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
if Constants.isIPhone {
|
if Constants.isIPhone {
|
||||||
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: .portrait)
|
Orientation.lockOrientation(.all, andRotateTo: .portrait)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wasPlaying {
|
if wasPlaying {
|
||||||
|
@ -170,7 +170,7 @@ struct BrowsingSettings: View {
|
|||||||
Orientation.lockOrientation(.portrait, andRotateTo: .portrait)
|
Orientation.lockOrientation(.portrait, andRotateTo: .portrait)
|
||||||
} else {
|
} else {
|
||||||
enterFullscreenInLandscape = false
|
enterFullscreenInLandscape = false
|
||||||
Orientation.lockOrientation(.allButUpsideDown)
|
Orientation.lockOrientation(.all)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ struct YatteeApp: App {
|
|||||||
let rotationOrientation =
|
let rotationOrientation =
|
||||||
OrientationTracker.shared.currentDeviceOrientation.rawValue == 4 ? UIInterfaceOrientation.landscapeRight :
|
OrientationTracker.shared.currentDeviceOrientation.rawValue == 4 ? UIInterfaceOrientation.landscapeRight :
|
||||||
(OrientationTracker.shared.currentDeviceOrientation.rawValue == 3 ? UIInterfaceOrientation.landscapeLeft : UIInterfaceOrientation.portrait)
|
(OrientationTracker.shared.currentDeviceOrientation.rawValue == 3 ? UIInterfaceOrientation.landscapeLeft : UIInterfaceOrientation.portrait)
|
||||||
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: rotationOrientation)
|
Orientation.lockOrientation(.all, andRotateTo: rotationOrientation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -4367,8 +4367,7 @@
|
|||||||
INFOPLIST_KEY_UIRequiresFullScreen = YES;
|
INFOPLIST_KEY_UIRequiresFullScreen = YES;
|
||||||
INFOPLIST_KEY_UIStatusBarHidden = NO;
|
INFOPLIST_KEY_UIStatusBarHidden = NO;
|
||||||
INFOPLIST_KEY_UIStatusBarStyle = "";
|
INFOPLIST_KEY_UIStatusBarStyle = "";
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@ -4418,8 +4417,7 @@
|
|||||||
INFOPLIST_KEY_UIRequiresFullScreen = YES;
|
INFOPLIST_KEY_UIRequiresFullScreen = YES;
|
||||||
INFOPLIST_KEY_UIStatusBarHidden = NO;
|
INFOPLIST_KEY_UIStatusBarHidden = NO;
|
||||||
INFOPLIST_KEY_UIStatusBarStyle = "";
|
INFOPLIST_KEY_UIStatusBarStyle = "";
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
|
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
@ -5,7 +5,7 @@ import Logging
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
final class AppDelegate: UIResponder, UIApplicationDelegate {
|
final class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
var orientationLock = UIInterfaceOrientationMask.allButUpsideDown
|
var orientationLock = UIInterfaceOrientationMask.all
|
||||||
|
|
||||||
private var logger = Logger(label: "stream.yattee.app.delegate")
|
private var logger = Logger(label: "stream.yattee.app.delegate")
|
||||||
private(set) static var instance: AppDelegate!
|
private(set) static var instance: AppDelegate!
|
||||||
|
@ -34,7 +34,7 @@ enum Orientation {
|
|||||||
let rotateOrientationMask = rotateOrientation == .portrait ? UIInterfaceOrientationMask.portrait :
|
let rotateOrientationMask = rotateOrientation == .portrait ? UIInterfaceOrientationMask.portrait :
|
||||||
rotateOrientation == .landscapeLeft ? .landscapeLeft :
|
rotateOrientation == .landscapeLeft ? .landscapeLeft :
|
||||||
rotateOrientation == .landscapeRight ? .landscapeRight :
|
rotateOrientation == .landscapeRight ? .landscapeRight :
|
||||||
.allButUpsideDown
|
.all
|
||||||
|
|
||||||
windowScene.requestGeometryUpdate(.iOS(interfaceOrientations: rotateOrientationMask)) { error in
|
windowScene.requestGeometryUpdate(.iOS(interfaceOrientations: rotateOrientationMask)) { error in
|
||||||
print("denied rotation \(error)")
|
print("denied rotation \(error)")
|
||||||
|
Loading…
Reference in New Issue
Block a user