Merge branch 'charlesmchen/landscapeOrientation4'

pull/1/head
Matthew Chen 6 years ago
commit fe00781ce4

@ -957,6 +957,15 @@ static NSTimeInterval launchStartedAt;
return UIInterfaceOrientationMaskAllButUpsideDown; return UIInterfaceOrientationMaskAllButUpsideDown;
} }
if (![self.windowManager isAppWindow:window]) {
// iOS uses various windows for animations, transitions, etc.
// e.g. _UIInteractiveHighlightEffectWindow,
// UITextEffectsWindow.
//
// We should be permissive with these windows.
return UIInterfaceOrientationMaskAllButUpsideDown;
}
if (window == self.windowManager.menuActionsWindow) { if (window == self.windowManager.menuActionsWindow) {
return UIInterfaceOrientationMaskAllButUpsideDown; return UIInterfaceOrientationMaskAllButUpsideDown;
} }

@ -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
@ -814,4 +814,10 @@ public class ExperienceUpgradesPageViewController: OWSViewController, UIPageView
Logger.debug("") Logger.debug("")
self.dismiss(animated: true) self.dismiss(animated: true)
} }
// MARK: Orientation
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .portrait
}
} }

@ -1,5 +1,5 @@
// //
// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // Copyright (c) 2019 Open Whisper Systems. All rights reserved.
// //
#import <SignalMessaging/OWSViewController.h> #import <SignalMessaging/OWSViewController.h>
@ -39,8 +39,6 @@ typedef NS_OPTIONS(NSInteger, MediaGalleryOption) {
viewItem:(nullable id<ConversationViewItem>)viewItem; viewItem:(nullable id<ConversationViewItem>)viewItem;
#pragma mark - Actions #pragma mark - Actions
- (void)didPressShare:(id)sender;
- (void)didPressDelete:(id)sender;
- (void)didPressPlayBarButton:(id)sender; - (void)didPressPlayBarButton:(id)sender;
- (void)didPressPauseBarButton:(id)sender; - (void)didPressPauseBarButton:(id)sender;
- (void)playVideo; - (void)playVideo;

@ -115,35 +115,39 @@ NS_ASSUME_NONNULL_BEGIN
- (void)keyboardWillShow:(NSNotification *)notification - (void)keyboardWillShow:(NSNotification *)notification
{ {
[self handleKeyboardNotification:notification]; [self handleKeyboardNotificationBase:notification];
} }
- (void)keyboardDidShow:(NSNotification *)notification - (void)keyboardDidShow:(NSNotification *)notification
{ {
[self handleKeyboardNotification:notification]; [self handleKeyboardNotificationBase:notification];
} }
- (void)keyboardWillHide:(NSNotification *)notification - (void)keyboardWillHide:(NSNotification *)notification
{ {
[self handleKeyboardNotification:notification]; [self handleKeyboardNotificationBase:notification];
} }
- (void)keyboardDidHide:(NSNotification *)notification - (void)keyboardDidHide:(NSNotification *)notification
{ {
[self handleKeyboardNotification:notification]; [self handleKeyboardNotificationBase:notification];
} }
- (void)keyboardWillChangeFrame:(NSNotification *)notification - (void)keyboardWillChangeFrame:(NSNotification *)notification
{ {
[self handleKeyboardNotification:notification]; [self handleKeyboardNotificationBase:notification];
} }
- (void)keyboardDidChangeFrame:(NSNotification *)notification - (void)keyboardDidChangeFrame:(NSNotification *)notification
{ {
[self handleKeyboardNotification:notification]; [self handleKeyboardNotificationBase:notification];
} }
- (void)handleKeyboardNotification:(NSNotification *)notification // We use the name `handleKeyboardNotificationBase` instead of
// `handleKeyboardNotification` to avoid accidentally
// calling similarly methods with that name in subclasses,
// e.g. ConversationViewController.
- (void)handleKeyboardNotificationBase:(NSNotification *)notification
{ {
OWSAssertIsOnMainThread(); OWSAssertIsOnMainThread();

@ -31,6 +31,8 @@ extern const UIWindowLevel UIWindowLevel_Background;
- (void)setIsScreenBlockActive:(BOOL)isScreenBlockActive; - (void)setIsScreenBlockActive:(BOOL)isScreenBlockActive;
- (BOOL)isAppWindow:(UIWindow *)window;
#pragma mark - Message Actions #pragma mark - Message Actions
@property (nonatomic, readonly) BOOL isPresentingMenuActions; @property (nonatomic, readonly) BOOL isPresentingMenuActions;

@ -310,6 +310,14 @@ const UIWindowLevel UIWindowLevel_MessageActions(void)
[self ensureWindowState]; [self ensureWindowState];
} }
- (BOOL)isAppWindow:(UIWindow *)window
{
OWSAssertDebug(window);
return (window == self.rootWindow || window == self.returnToCallWindow || window == self.callViewWindow
|| window == self.menuActionsWindow || window == self.screenBlockingWindow);
}
#pragma mark - Message Actions #pragma mark - Message Actions
- (BOOL)isPresentingMenuActions - (BOOL)isPresentingMenuActions

Loading…
Cancel
Save