mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Landscape orientation.
This commit is contained in:
parent
aefe0eabed
commit
5adcbac5ef
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
|
@ -946,6 +946,16 @@ static NSTimeInterval launchStartedAt;
|
||||||
- (UIInterfaceOrientationMask)application:(UIApplication *)application
|
- (UIInterfaceOrientationMask)application:(UIApplication *)application
|
||||||
supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window
|
supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window
|
||||||
{
|
{
|
||||||
|
if (!window) {
|
||||||
|
// If `window` is nil, be permissive. Otherwise orientation
|
||||||
|
// gets messed up during presentation of windows.
|
||||||
|
return UIInterfaceOrientationMaskAllButUpsideDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window == self.windowManager.menuActionsWindow) {
|
||||||
|
return UIInterfaceOrientationMaskAllButUpsideDown;
|
||||||
|
}
|
||||||
|
|
||||||
if (self.windowManager.rootWindow != window) {
|
if (self.windowManager.rootWindow != window) {
|
||||||
return UIInterfaceOrientationMaskPortrait;
|
return UIInterfaceOrientationMaskPortrait;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
@ -92,8 +92,8 @@ class MenuActionsViewController: UIViewController, MenuActionSheetDelegate {
|
||||||
|
|
||||||
// MARK: Orientation
|
// MARK: Orientation
|
||||||
|
|
||||||
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||||
return .portrait
|
return .allButUpsideDown
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Present / Dismiss animations
|
// MARK: Present / Dismiss animations
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
@ -27,6 +27,7 @@ extern const UIWindowLevel UIWindowLevel_Background;
|
||||||
- (void)setupWithRootWindow:(UIWindow *)rootWindow screenBlockingWindow:(UIWindow *)screenBlockingWindow;
|
- (void)setupWithRootWindow:(UIWindow *)rootWindow screenBlockingWindow:(UIWindow *)screenBlockingWindow;
|
||||||
|
|
||||||
@property (nonatomic, readonly) UIWindow *rootWindow;
|
@property (nonatomic, readonly) UIWindow *rootWindow;
|
||||||
|
@property (nonatomic, readonly) UIWindow *menuActionsWindow;
|
||||||
|
|
||||||
- (void)setIsScreenBlockActive:(BOOL)isScreenBlockActive;
|
- (void)setIsScreenBlockActive:(BOOL)isScreenBlockActive;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "OWSWindowManager.h"
|
#import "OWSWindowManager.h"
|
||||||
|
@ -65,11 +65,14 @@ const UIWindowLevel UIWindowLevel_MessageActions(void)
|
||||||
return CGFLOAT_MAX - 100;
|
return CGFLOAT_MAX - 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
@interface MessageActionsWindow : UIWindow
|
@interface MessageActionsWindow : UIWindow
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
@implementation MessageActionsWindow
|
@implementation MessageActionsWindow
|
||||||
|
|
||||||
- (UIWindowLevel)windowLevel
|
- (UIWindowLevel)windowLevel
|
||||||
|
@ -83,6 +86,8 @@ const UIWindowLevel UIWindowLevel_MessageActions(void)
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
@implementation OWSWindowRootViewController
|
@implementation OWSWindowRootViewController
|
||||||
|
|
||||||
- (BOOL)canBecomeFirstResponder
|
- (BOOL)canBecomeFirstResponder
|
||||||
|
@ -99,10 +104,14 @@ const UIWindowLevel UIWindowLevel_MessageActions(void)
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
@interface OWSWindowRootNavigationViewController : UINavigationController
|
@interface OWSWindowRootNavigationViewController : UINavigationController
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
@implementation OWSWindowRootNavigationViewController : UINavigationController
|
@implementation OWSWindowRootNavigationViewController : UINavigationController
|
||||||
|
|
||||||
#pragma mark - Orientation
|
#pragma mark - Orientation
|
||||||
|
|
Loading…
Reference in a new issue