Add feature flag for landscape orientation.

pull/1/head
Matthew Chen 6 years ago
parent cef28eb103
commit eab3599ce9

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

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

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

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

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

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

@ -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> #import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#define LANDSCAPE_ORIENTATION_ENABLED
UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void);
@interface OWSViewController : UIViewController @interface OWSViewController : UIViewController
@property (nonatomic) BOOL shouldIgnoreKeyboardChanges; @property (nonatomic) BOOL shouldIgnoreKeyboardChanges;

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

Loading…
Cancel
Save