Add feature flag for landscape orientation.

This commit is contained in:
Matthew Chen 2019-01-16 16:42:11 -05:00
parent cef28eb103
commit eab3599ce9
8 changed files with 20 additions and 9 deletions

View File

@ -148,8 +148,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>

View File

@ -93,7 +93,7 @@ class MenuActionsViewController: UIViewController, MenuActionSheetDelegate {
// MARK: Orientation
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
return DefaultUIInterfaceOrientationMask()
}
// MARK: Present / Dismiss animations

View File

@ -9,6 +9,6 @@ import Foundation
// MARK: Orientation
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
return DefaultUIInterfaceOrientationMask()
}
}

View File

@ -624,7 +624,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return (self.profileViewMode == ProfileViewMode_Registration ? UIInterfaceOrientationMaskPortrait
: UIInterfaceOrientationMaskAllButUpsideDown);
: DefaultUIInterfaceOrientationMask());
}
@end

View File

@ -170,6 +170,6 @@ public class BackupRestoreViewController: OWSTableViewController {
// MARK: Orientation
public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
return DefaultUIInterfaceOrientationMask()
}
}

View File

@ -28,7 +28,7 @@
[super loadView];
self.shouldUseTheme = NO;
self.interfaceOrientationMask = UIInterfaceOrientationMaskAllButUpsideDown;
self.interfaceOrientationMask = DefaultUIInterfaceOrientationMask();
self.view.backgroundColor = [UIColor whiteColor];
self.title = NSLocalizedString(@"COUNTRYCODE_SELECT_TITLE", @"");

View File

@ -1,11 +1,15 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
#define LANDSCAPE_ORIENTATION_ENABLED
UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void);
@interface OWSViewController : UIViewController
@property (nonatomic) BOOL shouldIgnoreKeyboardChanges;

View File

@ -8,6 +8,15 @@
NS_ASSUME_NONNULL_BEGIN
UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void)
{
#ifdef LANDSCAPE_ORIENTATION_ENABLED
return UIInterfaceOrientationMaskAllButUpsideDown;
#else
return UIInterfaceOrientationMaskPortrait;
#endif
}
@interface OWSViewController ()
@property (nonatomic, weak) UIView *bottomLayoutView;
@ -185,7 +194,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAllButUpsideDown;
return DefaultUIInterfaceOrientationMask();
}
@end