Landscape orientation.

pull/1/head
Matthew Chen 6 years ago
parent feac8d2644
commit 460f160cbb

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

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "DomainFrontingCountryViewController.h"
@ -41,7 +41,8 @@ NS_ASSUME_NONNULL_BEGIN
{
_tableViewController = [OWSTableViewController new];
[self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
[_tableViewController.view autoPinToTopLayoutGuideOfViewController:self withInset:0];
[_tableViewController.view autoPinToBottomLayoutGuideOfViewController:self withInset:0];

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
import Foundation
@ -32,6 +32,7 @@ public class ConversationHeaderView: UIStackView {
}
set {
self.subtitleLabel.attributedText = newValue
self.subtitleLabel.isHidden = newValue == nil
}
}

@ -1457,6 +1457,12 @@ typedef enum : NSUInteger {
- (void)updateNavigationBarSubtitleLabel
{
BOOL hasCompactHeader = self.traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact;
if (hasCompactHeader) {
self.headerView.attributedSubtitle = nil;
return;
}
NSMutableAttributedString *subtitleText = [NSMutableAttributedString new];
UIColor *subtitleColor = [Theme.navbarTitleColor colorWithAlphaComponent:(CGFloat)0.9];
@ -4747,6 +4753,31 @@ typedef enum : NSUInteger {
[self scrollToBottomAnimated:NO];
}
#pragma mark - Orientation
- (void)viewWillTransitionToSize:(CGSize)size
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
self.conversationStyle.viewWidth = size.width;
for (id<ConversationViewItem> viewItem in self.viewItems) {
[viewItem clearCachedLayoutState];
}
[self resetContentAndLayout];
// TODO: Ensure scroll state continuity?
}
- (void)traitCollectionDidChange:(nullable UITraitCollection *)previousTraitCollection
{
[super traitCollectionDidChange:previousTraitCollection];
[self updateNavigationBarSubtitleLabel];
}
@end
NS_ASSUME_NONNULL_END

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "HomeViewController.h"
@ -427,7 +427,9 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
self.searchResultsController = searchResultsController;
[self addChildViewController:searchResultsController];
[self.view addSubview:searchResultsController.view];
[searchResultsController.view autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsZero excludingEdge:ALEdgeTop];
[searchResultsController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom];
[searchResultsController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[searchResultsController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
if (@available(iOS 11, *)) {
[searchResultsController.view autoPinTopToSuperviewMarginWithInset:56];
} else {

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "NewContactThreadViewController.h"
@ -112,7 +112,8 @@ NS_ASSUME_NONNULL_BEGIN
[self addChildViewController:self.tableViewController];
[self.view insertSubview:self.tableViewController.view atIndex:0];
[_tableViewController.view autoPinWidthToSuperview];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
[_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeTop];
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "NewGroupViewController.h"
@ -126,7 +126,8 @@ NS_ASSUME_NONNULL_BEGIN
_tableViewController = [OWSTableViewController new];
_tableViewController.delegate = self;
[self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view avoidNotch:NO];
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "OWS2FARegistrationViewController.h"
@ -149,6 +149,13 @@ NS_ASSUME_NONNULL_BEGIN
[RegistrationController verificationWasCompletedFromView:self];
}
#pragma mark - Orientation
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
@end
NS_ASSUME_NONNULL_END

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "OWS2FASettingsViewController.h"
@ -148,9 +148,11 @@ NS_ASSUME_NONNULL_BEGIN
[self createTableView];
[instructionsLabel autoPinToTopLayoutGuideOfViewController:self withInset:kVSpacing];
[instructionsLabel autoPinWidthToSuperviewWithMargin:self.hMargin];
[instructionsLabel autoPinEdgeToSuperviewSafeArea:ALEdgeLeading withInset:self.hMargin];
[instructionsLabel autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing withInset:self.hMargin];
[self.tableViewController.view autoPinWidthToSuperview];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
[self.tableViewController.view autoPinEdge:ALEdgeTop
toEdge:ALEdgeBottom
ofView:instructionsLabel
@ -187,16 +189,19 @@ NS_ASSUME_NONNULL_BEGIN
[self createPinTextfield];
[instructionsLabel autoPinTopToSuperviewMarginWithInset:kVSpacing];
[instructionsLabel autoPinWidthToSuperviewWithMargin:self.hMargin];
[instructionsLabel autoPinEdgeToSuperviewSafeArea:ALEdgeLeading withInset:self.hMargin];
[instructionsLabel autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing withInset:self.hMargin];
[self.pinTextfield autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:instructionsLabel withOffset:kVSpacing];
[self.pinTextfield autoPinWidthToSuperviewWithMargin:self.hMargin];
[self.pinTextfield autoPinEdgeToSuperviewSafeArea:ALEdgeLeading withInset:self.hMargin];
[self.pinTextfield autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing withInset:self.hMargin];
UIView *underscoreView = [UIView new];
underscoreView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:1.f];
[self.view addSubview:underscoreView];
[underscoreView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.pinTextfield withOffset:3];
[underscoreView autoPinWidthToSuperviewWithMargin:self.hMargin];
[underscoreView autoPinEdgeToSuperviewSafeArea:ALEdgeLeading withInset:self.hMargin];
[underscoreView autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing withInset:self.hMargin];
[underscoreView autoSetDimension:ALDimensionHeight toSize:1.f];
[self updateNavigationItems];

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "ProfileViewController.h"
@ -619,6 +619,14 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
return result;
}
#pragma mark - Orientation
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return (self.profileViewMode == ProfileViewMode_Registration ? UIInterfaceOrientationMaskPortrait
: UIInterfaceOrientationMaskAllButUpsideDown);
}
@end
NS_ASSUME_NONNULL_END

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
import UIKit
@ -166,4 +166,10 @@ public class BackupRestoreViewController: OWSTableViewController {
updateTableContents()
}
}
// MARK: Orientation
public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .allButUpsideDown
}
}

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "CodeVerificationViewController.h"
@ -497,6 +497,13 @@ NS_ASSUME_NONNULL_BEGIN
return UIStatusBarStyleLightContent;
}
#pragma mark - Orientation
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
@end
NS_ASSUME_NONNULL_END

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "RegistrationViewController.h"
@ -502,6 +502,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
{
CountryCodeViewController *countryCodeController = [CountryCodeViewController new];
countryCodeController.countryCodeDelegate = self;
countryCodeController.interfaceOrientationMask = UIInterfaceOrientationMaskPortrait;
OWSNavigationController *navigationController =
[[OWSNavigationController alloc] initWithRootViewController:countryCodeController];
[self presentViewController:navigationController animated:YES completion:nil];
@ -629,6 +630,13 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
return UIStatusBarStyleLightContent;
}
#pragma mark - Orientation
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
@end
NS_ASSUME_NONNULL_END

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "UpdateGroupViewController.h"
@ -119,7 +119,8 @@ NS_ASSUME_NONNULL_BEGIN
_tableViewController = [OWSTableViewController new];
_tableViewController.delegate = self;
[self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view avoidNotch:NO];
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "OWSTableViewController.h"
@ -23,4 +23,6 @@
@property (nonatomic) BOOL isPresentedInNavigationController;
@property (nonatomic) UIInterfaceOrientationMask interfaceOrientationMask;
@end

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "CountryCodeViewController.h"
@ -28,6 +28,7 @@
[super loadView];
self.shouldUseTheme = NO;
self.interfaceOrientationMask = UIInterfaceOrientationMaskAllButUpsideDown;
self.view.backgroundColor = [UIColor whiteColor];
self.title = NSLocalizedString(@"COUNTRYCODE_SELECT_TITLE", @"");
@ -161,4 +162,11 @@
[self.searchBar resignFirstResponder];
}
#pragma mark - Orientation
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return self.interfaceOrientationMask;
}
@end

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "OWSNavigationController.h"
@ -199,7 +199,11 @@ NS_ASSUME_NONNULL_BEGIN
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
if (self.topViewController) {
return self.topViewController.supportedInterfaceOrientations;
} else {
return UIInterfaceOrientationMaskPortrait;
}
}
@end

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "OWSTableViewController.h"
@ -492,7 +492,8 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
// won't adjust our content insets.
[self.tableView autoPinToTopLayoutGuideOfViewController:self withInset:0];
[self.tableView autoPinToBottomLayoutGuideOfViewController:self withInset:0];
[self.tableView autoPinWidthToSuperview];
[self.tableView autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[self.tableView autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
// We don't need a top or bottom insets, since we pin to the top and bottom layout guides.
self.automaticallyAdjustsScrollViewInsets = NO;

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
@ -181,7 +181,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
return UIInterfaceOrientationMaskAllButUpsideDown;
}
@end

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "SelectRecipientViewController.h"
@ -90,7 +90,8 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
_tableViewController = [OWSTableViewController new];
_tableViewController.delegate = self;
[self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
[_tableViewController.view autoPinToTopLayoutGuideOfViewController:self withInset:0];
[_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom];
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "SelectThreadViewController.h"
@ -107,7 +107,8 @@ NS_ASSUME_NONNULL_BEGIN
_tableViewController = [OWSTableViewController new];
_tableViewController.delegate = self;
[self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading];
[self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:header];
[_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom];
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;

Loading…
Cancel
Save