Merge branch 'mkirk/resize-call-navbar'

pull/1/head
Matthew Chen 8 years ago
commit c9f4b34d64

@ -144,7 +144,6 @@
34612A011FD5F31400532771 /* OWS104CreateRecipientIdentities.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129F41FD5F31400532771 /* OWS104CreateRecipientIdentities.h */; };
34612A061FD7238600532771 /* OWSContactsSyncing.h in Headers */ = {isa = PBXBuildFile; fileRef = 34612A041FD7238500532771 /* OWSContactsSyncing.h */; settings = {ATTRIBUTES = (Public, ); }; };
34612A071FD7238600532771 /* OWSContactsSyncing.m in Sources */ = {isa = PBXBuildFile; fileRef = 34612A051FD7238500532771 /* OWSContactsSyncing.m */; };
34641E1220878FB000E2EDE5 /* OWSWindowManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 34641E1020878FAF00E2EDE5 /* OWSWindowManager.m */; };
34641E182088D7E900E2EDE5 /* OWSScreenLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34641E172088D7E900E2EDE5 /* OWSScreenLock.swift */; };
34641E1B2088DA4100E2EDE5 /* ScreenLockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34641E192088DA3F00E2EDE5 /* ScreenLockViewController.m */; };
34641E1C2088DA4100E2EDE5 /* ScreenLockViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 34641E1A2088DA4000E2EDE5 /* ScreenLockViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -189,7 +188,6 @@
34C3C78F2040A4F70000134C /* sonarping.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 34C3C78E2040A4F70000134C /* sonarping.mp3 */; };
34C3C7922040B0DD0000134C /* OWSAudioPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C3C7902040B0DC0000134C /* OWSAudioPlayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
34C3C7932040B0DD0000134C /* OWSAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 34C3C7912040B0DC0000134C /* OWSAudioPlayer.m */; };
34C42D5B1F45F7A80072EC04 /* OWSNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34C42D5A1F45F7A80072EC04 /* OWSNavigationController.m */; };
34C6B0A91FA0E46F00D35993 /* test-gif.gif in Resources */ = {isa = PBXBuildFile; fileRef = 34C6B0A51FA0E46F00D35993 /* test-gif.gif */; };
34C6B0AB1FA0E46F00D35993 /* test-mp3.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 34C6B0A71FA0E46F00D35993 /* test-mp3.mp3 */; };
34C6B0AC1FA0E46F00D35993 /* test-mp4.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 34C6B0A81FA0E46F00D35993 /* test-mp4.mp4 */; };
@ -249,6 +247,13 @@
450998681FD8C0FF00D89EB3 /* AttachmentSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F83A1E8DF1700035BE1A /* AttachmentSharing.m */; };
450998691FD8C10200D89EB3 /* AttachmentSharing.h in Headers */ = {isa = PBXBuildFile; fileRef = 34B3F8391E8DF1700035BE1A /* AttachmentSharing.h */; settings = {ATTRIBUTES = (Public, ); }; };
4509E79A1DD653700025A59F /* WebRTC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4509E7991DD653700025A59F /* WebRTC.framework */; };
450C800C20AD191E00F3A091 /* OWSNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34C42D5A1F45F7A80072EC04 /* OWSNavigationController.m */; };
450C800D20AD193100F3A091 /* OWSNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 34C42D591F45F7A80072EC04 /* OWSNavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; };
450C800E20AD1A6500F3A091 /* OWSNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45FDA43420A4D22700396358 /* OWSNavigationBar.swift */; };
450C800F20AD1AB900F3A091 /* OWSWindowManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 34641E1020878FAF00E2EDE5 /* OWSWindowManager.m */; };
450C801020AD1AE400F3A091 /* OWSWindowManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 34641E1120878FB000E2EDE5 /* OWSWindowManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
450C801120AD1CDB00F3A091 /* ReturnToCallViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45A60E7220AC674100FB1ABF /* ReturnToCallViewController.swift */; };
450C801220AD1D5B00F3A091 /* UIDevice+featureSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45BB93371E688E14001E3939 /* UIDevice+featureSupport.swift */; };
450D19131F85236600970622 /* RemoteVideoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 450D19121F85236600970622 /* RemoteVideoView.m */; };
450DF2051E0D74AC003D14BE /* Platform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 450DF2041E0D74AC003D14BE /* Platform.swift */; };
450DF2091E0DD2C6003D14BE /* UserNotificationsAdaptee.swift in Sources */ = {isa = PBXBuildFile; fileRef = 450DF2081E0DD2C6003D14BE /* UserNotificationsAdaptee.swift */; };
@ -381,7 +386,6 @@
45B74A892044AAB600CD42F8 /* circles-quiet.aifc in Resources */ = {isa = PBXBuildFile; fileRef = 45B74A702044AAB500CD42F8 /* circles-quiet.aifc */; };
45B74A8B2044AAB600CD42F8 /* synth.aifc in Resources */ = {isa = PBXBuildFile; fileRef = 45B74A722044AAB600CD42F8 /* synth.aifc */; };
45B74A8C2044AAB600CD42F8 /* input-quiet.aifc in Resources */ = {isa = PBXBuildFile; fileRef = 45B74A732044AAB600CD42F8 /* input-quiet.aifc */; };
45BB93381E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45BB93371E688E14001E3939 /* UIDevice+featureSupport.swift */; };
45BC829D1FD9C4B400011CF3 /* ShareViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45BC829C1FD9C4B400011CF3 /* ShareViewDelegate.swift */; };
45BD60821DE9547E00A8F436 /* Contacts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45BD60811DE9547E00A8F436 /* Contacts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
45BE4EA22012AD2000935E59 /* DisappearingTimerConfigurationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45BE4EA12012AD2000935E59 /* DisappearingTimerConfigurationView.swift */; };
@ -487,7 +491,6 @@
FC5CDF3A1A3393DD00B47253 /* warning_white@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC5CDF381A3393DD00B47253 /* warning_white@2x.png */; };
FC9120411A39EFB70074545C /* qr@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FC91203F1A39EFB70074545C /* qr@2x.png */; };
FCB11D8C1A129A76002F93FB /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCB11D8B1A129A76002F93FB /* CoreMedia.framework */; };
FCC81A981A44558300DFEC7D /* UIDevice+TSHardwareVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = FCC81A971A44558300DFEC7D /* UIDevice+TSHardwareVersion.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -997,6 +1000,7 @@
459B7759207BA3A80071D0AB /* OWSQuotedReplyModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OWSQuotedReplyModel.h; sourceTree = "<group>"; };
459B775A207BA3A80071D0AB /* OWSQuotedReplyModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OWSQuotedReplyModel.m; sourceTree = "<group>"; };
45A2F004204473A3002E978A /* NewMessage.aifc */ = {isa = PBXFileReference; lastKnownFileType = file; name = NewMessage.aifc; path = Signal/AudioFiles/NewMessage.aifc; sourceTree = SOURCE_ROOT; };
45A60E7220AC674100FB1ABF /* ReturnToCallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReturnToCallViewController.swift; sourceTree = "<group>"; };
45A663C41F92EC760027B59E /* GroupTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupTableViewCell.swift; sourceTree = "<group>"; };
45A6DAD51EBBF85500893231 /* ReminderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReminderView.swift; sourceTree = "<group>"; };
45AE48501E0732D6004D96C2 /* TurnServerInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TurnServerInfo.swift; sourceTree = "<group>"; };
@ -1060,6 +1064,7 @@
45F659811E1BE77000444429 /* NonCallKitCallUIAdaptee.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NonCallKitCallUIAdaptee.swift; sourceTree = "<group>"; };
45FBC59A1DF8575700E9B410 /* CallKitCallManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallKitCallManager.swift; sourceTree = "<group>"; };
45FBC5D01DF8592E00E9B410 /* SignalCall.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalCall.swift; sourceTree = "<group>"; };
45FDA43420A4D22700396358 /* OWSNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSNavigationBar.swift; sourceTree = "<group>"; };
69349DE607F5BA6036C9AC60 /* Pods-SignalShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalShareExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalShareExtension/Pods-SignalShareExtension.debug.xcconfig"; sourceTree = "<group>"; };
70377AAA1918450100CAF501 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
748A5CAEDD7C919FC64C6807 /* Pods_SignalTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@ -1186,8 +1191,6 @@
FC5CDF381A3393DD00B47253 /* warning_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "warning_white@2x.png"; sourceTree = "<group>"; };
FC91203F1A39EFB70074545C /* qr@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "qr@2x.png"; sourceTree = "<group>"; };
FCB11D8B1A129A76002F93FB /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
FCC81A961A44558300DFEC7D /* UIDevice+TSHardwareVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+TSHardwareVersion.h"; sourceTree = "<group>"; };
FCC81A971A44558300DFEC7D /* UIDevice+TSHardwareVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+TSHardwareVersion.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -1452,6 +1455,8 @@
34480B4F1FD0A7A300BC14EF /* OWSScrubbingLogFormatter.h */,
34480B511FD0A7A400BC14EF /* OWSScrubbingLogFormatter.m */,
346129331FD1A88700532771 /* OWSSwiftUtils.swift */,
34641E1120878FB000E2EDE5 /* OWSWindowManager.h */,
34641E1020878FAF00E2EDE5 /* OWSWindowManager.m */,
45360B8C1F9521F800FA666C /* Searcher.swift */,
347850581FD9972E007B8332 /* SwiftSingletons.swift */,
346129BD1FD2068600532771 /* ThreadUtil.h */,
@ -1467,6 +1472,7 @@
34480B5C1FD0A98800BC14EF /* categories */ = {
isa = PBXGroup;
children = (
45BB93371E688E14001E3939 /* UIDevice+featureSupport.swift */,
4551DB59205C562300C8AE75 /* Collection+OWS.swift */,
346129C51FD2072D00532771 /* NSAttributedString+OWS.h */,
346129C11FD2072D00532771 /* NSAttributedString+OWS.m */,
@ -1603,6 +1609,7 @@
451573952061B49500803601 /* GradientView.swift */,
346129CF1FD207F200532771 /* OWSAlerts.swift */,
454A965E1FD60EA2008D2A0E /* OWSFlatButton.swift */,
45FDA43420A4D22700396358 /* OWSNavigationBar.swift */,
348BB258209CF8E40047AEC2 /* TappableStackView.swift */,
348BB259209CF8E50047AEC2 /* TappableView.swift */,
3400C7971EAFB772008A8584 /* ThreadViewHelper.h */,
@ -1673,8 +1680,6 @@
45D2AC01204885170033C692 /* OWS2FAReminderViewController.swift */,
345BC30A2047030600257B7C /* OWS2FASettingsViewController.h */,
345BC30B2047030600257B7C /* OWS2FASettingsViewController.m */,
34C42D591F45F7A80072EC04 /* OWSNavigationController.h */,
34C42D5A1F45F7A80072EC04 /* OWSNavigationController.m */,
34CE88E51F2FB9A10098030F /* ProfileViewController.h */,
34CE88E61F2FB9A10098030F /* ProfileViewController.m */,
340FC875204DAC8C007AEB0F /* Registration */,
@ -1853,10 +1858,13 @@
451F8A361FD7115D005CB9DA /* ViewControllers */ = {
isa = PBXGroup;
children = (
34C42D591F45F7A80072EC04 /* OWSNavigationController.h */,
34C42D5A1F45F7A80072EC04 /* OWSNavigationController.m */,
34B3F89D1E8DF5490035BE1A /* OWSTableViewController.h */,
34B3F89E1E8DF5490035BE1A /* OWSTableViewController.m */,
34D99C8A1F27B13B00D284D6 /* OWSViewController.h */,
34D99C8B1F27B13B00D284D6 /* OWSViewController.m */,
45A60E7220AC674100FB1ABF /* ReturnToCallViewController.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
@ -2110,15 +2118,11 @@
34D2CCD120618B2F00CB1A14 /* OWSBackupLazyRestoreJob.swift */,
34D2CCD82062E7D000CB1A14 /* OWSScreenLockUI.h */,
34D2CCD92062E7D000CB1A14 /* OWSScreenLockUI.m */,
34641E1120878FB000E2EDE5 /* OWSWindowManager.h */,
34641E1020878FAF00E2EDE5 /* OWSWindowManager.m */,
4579431C1E7C8CE9008ED0C0 /* Pastelog.h */,
4579431D1E7C8CE9008ED0C0 /* Pastelog.m */,
450DF2041E0D74AC003D14BE /* Platform.swift */,
4521C3BF1F59F3BA00B4C582 /* TextFieldHelper.swift */,
FCFA64B11A24F29E0007FB87 /* UI Categories */,
FCC81A961A44558300DFEC7D /* UIDevice+TSHardwareVersion.h */,
FCC81A971A44558300DFEC7D /* UIDevice+TSHardwareVersion.m */,
);
path = util;
sourceTree = "<group>";
@ -2386,7 +2390,6 @@
children = (
45638BDE1F3DDB2200128435 /* MessageSender+Promise.swift */,
45C0DC1A1E68FE9000E04C47 /* UIApplication+OWS.swift */,
45BB93371E688E14001E3939 /* UIDevice+featureSupport.swift */,
45C0DC1D1E69011F00E04C47 /* UIStoryboard+OWS.swift */,
EF764C331DB67CC5000D9A87 /* UIViewController+Permissions.h */,
EF764C341DB67CC5000D9A87 /* UIViewController+Permissions.m */,
@ -2414,6 +2417,7 @@
34612A001FD5F31400532771 /* OWS105AttachmentFilePaths.h in Headers */,
346129F61FD5F31400532771 /* OWS103EnableVideoCalling.h in Headers */,
344F248A20069F0600CFB4F4 /* ViewControllerUtils.h in Headers */,
450C800D20AD193100F3A091 /* OWSNavigationController.h in Headers */,
346129A91FD1F0E000532771 /* OWSFormat.h in Headers */,
34480B551FD0A7A400BC14EF /* DebugLogger.h in Headers */,
344F248420069E9C00CFB4F4 /* CountryCodeViewController.h in Headers */,
@ -2438,6 +2442,7 @@
34480B611FD0A98800BC14EF /* UIColor+OWS.h in Headers */,
453518961FC63DBF00210559 /* SignalMessaging.h in Headers */,
3461295A1FD1D74C00532771 /* Environment.h in Headers */,
450C801020AD1AE400F3A091 /* OWSWindowManager.h in Headers */,
34D58730208E2C4200D2255A /* OWS109OutgoingMessageState.h in Headers */,
4598198E204E2F28009414F2 /* OWS108CallLoggingPreference.h in Headers */,
34480B631FD0A98800BC14EF /* UIView+OWS.h in Headers */,
@ -3120,6 +3125,7 @@
45194F8F1FD71FF500333B2C /* ThreadUtil.m in Sources */,
451F8A3B1FD71297005CB9DA /* UIUtil.m in Sources */,
451F8A331FD71083005CB9DA /* SelectThreadViewController.m in Sources */,
450C800F20AD1AB900F3A091 /* OWSWindowManager.m in Sources */,
454A965A1FD6017E008D2A0E /* SignalAttachment.swift in Sources */,
454A965B1FD601BF008D2A0E /* MediaMessageView.swift in Sources */,
45BC829D1FD9C4B400011CF3 /* ShareViewDelegate.swift in Sources */,
@ -3146,17 +3152,21 @@
45F59A082028E4FB00E8D2B0 /* OWSAudioSession.swift in Sources */,
34612A071FD7238600532771 /* OWSContactsSyncing.m in Sources */,
346129DF1FD5C02A00532771 /* LockInteractionController.m in Sources */,
450C801220AD1D5B00F3A091 /* UIDevice+featureSupport.swift in Sources */,
451F8A471FD715BA005CB9DA /* OWSAvatarBuilder.m in Sources */,
344D6CEB20069E070042AF96 /* SelectRecipientViewController.m in Sources */,
34480B591FD0A7A400BC14EF /* OWSScrubbingLogFormatter.m in Sources */,
451F8A441FD7156B005CB9DA /* BlockListUIUtils.m in Sources */,
34641E182088D7E900E2EDE5 /* OWSScreenLock.swift in Sources */,
451F8A381FD7117E005CB9DA /* OWSViewController.m in Sources */,
450C801120AD1CDB00F3A091 /* ReturnToCallViewController.swift in Sources */,
450C800C20AD191E00F3A091 /* OWSNavigationController.m in Sources */,
346129721FD1D74C00532771 /* SignalKeyingStorage.m in Sources */,
34480B561FD0A7A400BC14EF /* DebugLogger.m in Sources */,
459B775C207BA46C0071D0AB /* OWSQuotedReplyModel.m in Sources */,
34ABB2C42090C59700C727A6 /* OWSResaveCollectionDBMigration.m in Sources */,
4551DB5A205C562300C8AE75 /* Collection+OWS.swift in Sources */,
450C800E20AD1A6500F3A091 /* OWSNavigationBar.swift in Sources */,
3461293C1FD1D46A00532771 /* OWSMath.m in Sources */,
451F8A391FD711D6005CB9DA /* ContactsViewHelper.m in Sources */,
346129AF1FD1F5D900532771 /* SystemContactsFetcher.swift in Sources */,
@ -3275,7 +3285,6 @@
45D308AD2049A439000189E4 /* PinEntryView.m in Sources */,
340FC8B1204DAC8D007AEB0F /* BlockListViewController.m in Sources */,
45B5360E206DD8BB00D61655 /* UIResponder+OWS.swift in Sources */,
34641E1220878FB000E2EDE5 /* OWSWindowManager.m in Sources */,
45F659821E1BE77000444429 /* NonCallKitCallUIAdaptee.swift in Sources */,
45AE48511E0732D6004D96C2 /* TurnServerInfo.swift in Sources */,
34B3F8771E8DF1700035BE1A /* ContactsPicker.swift in Sources */,
@ -3298,7 +3307,6 @@
34BECE2E1F7ABCE000D7438D /* GifPickerViewController.swift in Sources */,
34D1F0C01F8EC1760066283D /* MessageRecipientStatusUtils.swift in Sources */,
45F659731E1BD99C00444429 /* CallKitCallUIAdaptee.swift in Sources */,
45BB93381E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */,
34277A5E20751BDC006049F2 /* OWSQuotedMessageView.m in Sources */,
458DE9D61DEE3FD00071BB03 /* PeerConnectionClient.swift in Sources */,
45DDA6242090CEB500DE97F8 /* ConversationHeaderView.swift in Sources */,
@ -3307,14 +3315,12 @@
457F671B20746193000EABCD /* QuotedReplyPreview.swift in Sources */,
34DBF004206BD5A500025978 /* OWSBubbleView.m in Sources */,
34E88D262098C5AE00A608F4 /* ContactViewController.swift in Sources */,
FCC81A981A44558300DFEC7D /* UIDevice+TSHardwareVersion.m in Sources */,
76EB054018170B33006006FC /* AppDelegate.m in Sources */,
34D1F0831F8678AA0066283D /* ConversationInputTextView.m in Sources */,
340FC8B6204DAC8D007AEB0F /* OWSQRCodeScanningViewController.m in Sources */,
34D1F0B11F867BFC0066283D /* OWSUnreadIndicatorCell.m in Sources */,
340FC8B5204DAC8D007AEB0F /* AboutTableViewController.m in Sources */,
34BECE2B1F74C12700D7438D /* DebugUIStress.m in Sources */,
34C42D5B1F45F7A80072EC04 /* OWSNavigationController.m in Sources */,
340FC8B9204DAC8D007AEB0F /* UpdateGroupViewController.m in Sources */,
B609597C1C2C0FC6004E8797 /* iRate.m in Sources */,
4574A5D61DD6704700C6B692 /* CallService.swift in Sources */,

@ -12,7 +12,6 @@
#import "NotificationsManager.h"
#import "OWS2FASettingsViewController.h"
#import "OWSBackup.h"
#import "OWSNavigationController.h"
#import "OWSScreenLockUI.h"
#import "Pastelog.h"
#import "PushManager.h"
@ -28,6 +27,7 @@
#import <SignalMessaging/OWSContactsManager.h>
#import <SignalMessaging/OWSContactsSyncing.h>
#import <SignalMessaging/OWSMath.h>
#import <SignalMessaging/OWSNavigationController.h>
#import <SignalMessaging/OWSPreferences.h>
#import <SignalMessaging/OWSProfileManager.h>
#import <SignalMessaging/Release.h>
@ -483,9 +483,9 @@ static NSTimeInterval launchStartedAt;
if ([url.scheme isEqualToString:kURLSchemeSGNLKey]) {
if ([url.host hasPrefix:kURLHostVerifyPrefix] && ![TSAccountManager isRegistered]) {
id signupController = SignalApp.sharedApp.signUpFlowNavigationController;
if ([signupController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navController = (UINavigationController *)signupController;
UIViewController *controller = [navController.childViewControllers lastObject];
if ([signupController isKindOfClass:[OWSNavigationController class]]) {
OWSNavigationController *navController = (OWSNavigationController *)signupController;
UIViewController *controller = [navController.childViewControllers lastObject];
if ([controller isKindOfClass:[CodeVerificationViewController class]]) {
CodeVerificationViewController *cvvc = (CodeVerificationViewController *)controller;
NSString *verificationCode = [url.path substringFromIndex:1];
@ -628,7 +628,7 @@ static NSTimeInterval launchStartedAt;
@"%@ Skipping 2FA reminder since there isn't yet an initial view controller", self.logTag);
} else {
UIViewController *rootViewController = self.window.rootViewController;
UINavigationController *reminderNavController =
OWSNavigationController *reminderNavController =
[OWS2FAReminderViewController wrappedInNavController];
[rootViewController presentViewController:reminderNavController animated:YES completion:nil];
@ -1161,4 +1161,17 @@ static NSTimeInterval launchStartedAt;
[AppUpdateNag.sharedInstance showAppUpgradeNagIfNecessary];
}
#pragma mark - status bar touches
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan:touches withEvent:event];
CGPoint location = [[[event allTouches] anyObject] locationInView:[self window]];
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
if (CGRectContainsPoint(statusBarFrame, location)) {
DDLogDebug(@"%@ touched status bar", self.logTag);
[[NSNotificationCenter defaultCenter] postNotificationName:TappedStatusBarNotification object:nil];
}
}
@end

@ -1,11 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
import Foundation
extension UIDevice {
var supportsCallKit: Bool {
return ProcessInfo().isOperatingSystemAtLeast(OperatingSystemVersion(majorVersion: 10, minorVersion: 0, patchVersion: 0))
}
}

@ -74,11 +74,19 @@ class AddContactShareToExistingContactViewController: ContactsPicker, ContactsPi
contactViewController.allowsEditing = true
contactViewController.delegate = self
guard let navigationController = self.navigationController else {
owsFail("\(logTag) in \(#function) navigationController was unexpectedly nil")
return
let modal = OWSNavigationController(rootViewController: contactViewController)
// HACK otherwise CNContactViewController Navbar is shows window background color.
// RADAR rdar://28433898 http://www.openradar.me/28433898
// CNContactViewController incompatible with opaque navigation bar
modal.navigationBar.isTranslucent = true
if #available(iOS 10, *) {
// Contact navbar is blue in iOS9, so our white text works,
// but gray on iOS10+, in which case we want the system default black text.
UIUtil.applyDefaultSystemAppearence()
}
navigationController.pushViewController(contactViewController, animated: true)
self.present(modal, animated: true)
}
func contactsPicker(_: ContactsPicker, didSelectMultipleContacts contacts: [Contact]) {
@ -126,8 +134,21 @@ class AddContactShareToExistingContactViewController: ContactsPicker, ContactsPi
return
}
// HACK otherwise CNContactViewController Navbar is shows window background color.
// RADAR rdar://28433898 http://www.openradar.me/28433898
// CNContactViewController incompatible with opaque navigation bar
navigationController.navigationBar.isTranslucent = false
if #available(iOS 10, *) {
// Contact navbar is blue in iOS9, so our white text works,
// but gray on iOS10+, in which case we want the system default black text.
UIUtil.applySignalAppearence()
}
let previousViewControllerIndex = navigationController.viewControllers.index(before: myIndex)
let previousViewController = navigationController.viewControllers[previousViewControllerIndex]
navigationController.popToViewController(previousViewController, animated: true)
self.dismiss(animated: false) {
navigationController.popToViewController(previousViewController, animated: true)
}
}
}

@ -80,7 +80,6 @@
OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]);
[self.navigationController.navigationBar setTranslucent:NO];
self.navigationItem.leftBarButtonItem =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
target:self

@ -47,12 +47,6 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
#pragma mark - Table view data source
- (void)updateTableContents

@ -31,7 +31,6 @@ NS_ASSUME_NONNULL_BEGIN
@"CENSORSHIP_CIRCUMVENTION_COUNTRY_VIEW_TITLE", @"Title for the 'censorship circumvention country' view.");
self.view.backgroundColor = [UIColor whiteColor];
[self.navigationController.navigationBar setTranslucent:NO];
[self createViews];
}

@ -43,6 +43,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
var contactAvatarContainerView: UIView!
var callStatusLabel: UILabel!
var callDurationTimer: Timer?
var leaveCallViewButton: UIButton!
// MARK: - Ongoing Call Controls
@ -226,8 +227,6 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
blurView.isUserInteractionEnabled = false
self.view.addSubview(blurView)
self.view.setHLayoutMargins(0)
// Create the video views first, as they are under the other views.
createVideoViews()
createContactViews()
@ -254,6 +253,14 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
}
func createContactViews() {
leaveCallViewButton = UIButton()
let backButtonImage = self.view.isRTL() ? #imageLiteral(resourceName: "NavBarBackRTL") : #imageLiteral(resourceName: "NavBarBack")
leaveCallViewButton.setImage(backButtonImage, for: .normal)
leaveCallViewButton.autoSetDimensions(to: CGSize(width: 40, height: 40))
leaveCallViewButton.addTarget(self, action: #selector(didTapLeaveCall(sender:)), for: .touchUpInside)
self.view.addSubview(leaveCallViewButton)
contactNameLabel = MarqueeLabel()
// marquee config
@ -267,7 +274,8 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
contactNameLabel.trailingBuffer = ScaleFromIPhone5(80.0)
// label config
contactNameLabel.font = UIFont.ows_lightFont(withSize: ScaleFromIPhone5To7Plus(32, 40))
contactNameLabel.font = UIFont.ows_dynamicTypeTitle1
contactNameLabel.textAlignment = .center
contactNameLabel.textColor = UIColor.white
contactNameLabel.layer.shadowOffset = CGSize.zero
contactNameLabel.layer.shadowOpacity = 0.35
@ -276,11 +284,13 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
self.view.addSubview(contactNameLabel)
callStatusLabel = UILabel()
callStatusLabel.font = UIFont.ows_regularFont(withSize: ScaleFromIPhone5To7Plus(19, 25))
callStatusLabel.font = UIFont.ows_dynamicTypeBody
callStatusLabel.textAlignment = .center
callStatusLabel.textColor = UIColor.white
callStatusLabel.layer.shadowOffset = CGSize.zero
callStatusLabel.layer.shadowOpacity = 0.35
callStatusLabel.layer.shadowRadius = 4
self.view.addSubview(callStatusLabel)
contactAvatarContainerView = UIView.container()
@ -349,8 +359,6 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
func createOngoingCallControls() {
// textMessageButton = createButton(imageName:"message-active-wide",
// action:#selector(didPressTextMessage))
audioSourceButton = createButton(image: #imageLiteral(resourceName: "audio-call-speaker-inactive"),
action: #selector(didPressAudioSource))
audioSourceButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_AUDIO_SOURCE_LABEL",
@ -473,8 +481,10 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
// MARK: - Layout
var localVideoViewTopConstraint: NSLayoutConstraint!
func createViewConstraints() {
let topMargin = CGFloat(40)
let contactVSpacing = CGFloat(3)
let settingsNagHMargin = CGFloat(30)
let ongoingBottomMargin = ScaleFromIPhone5To7Plus(23, 41)
@ -492,24 +502,30 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
// Dark blurred background.
blurView.autoPinEdgesToSuperviewEdges()
localVideoView.autoPinTrailingToSuperviewMargin(withInset: videoPreviewHMargin)
localVideoView.autoPinEdge(toSuperviewEdge: .top, withInset: topMargin)
let localVideoSize = ScaleFromIPhone5To7Plus(80, 100)
localVideoView.autoSetDimension(.width, toSize: localVideoSize)
localVideoView.autoSetDimension(.height, toSize: localVideoSize)
leaveCallViewButton.autoPinEdge(toSuperviewMargin: .leading)
leaveCallViewButton.autoPinEdge(toSuperviewMargin: .top)
remoteVideoView.autoPinEdgesToSuperviewEdges()
contactNameLabel.autoPinEdge(toSuperviewEdge: .top, withInset: topMargin)
contactNameLabel.autoPinLeadingToSuperviewMargin()
// MJK TODO height of contact name label should be ~same as back button
contactNameLabel.autoPinEdge(toSuperviewMargin: .top)
contactNameLabel.autoPinEdge(.leading, to: .trailing, of: leaveCallViewButton, withOffset: 8, relation: .greaterThanOrEqual)
contactNameLabel.autoHCenterInSuperview()
contactNameLabel.setContentHuggingVerticalHigh()
contactNameLabel.setCompressionResistanceHigh()
callStatusLabel.autoPinEdge(.top, to: .bottom, of: contactNameLabel, withOffset: contactVSpacing)
callStatusLabel.autoPinLeadingToSuperviewMargin()
callStatusLabel.autoHCenterInSuperview()
callStatusLabel.setContentHuggingVerticalHigh()
callStatusLabel.setCompressionResistanceHigh()
localVideoView.autoPinTrailingToSuperviewMargin(withInset: videoPreviewHMargin)
// MJK TODO, depends on whether contactNameLabel is visible
self.localVideoViewTopConstraint = localVideoView.autoPinEdge(.top, to: .bottom, of: callStatusLabel, withOffset: 4)
let localVideoSize = ScaleFromIPhone5To7Plus(80, 100)
localVideoView.autoSetDimension(.width, toSize: localVideoSize)
localVideoView.autoSetDimension(.height, toSize: localVideoSize)
remoteVideoView.autoPinEdgesToSuperviewEdges()
contactAvatarContainerView.autoPinEdge(.top, to: .bottom, of: callStatusLabel, withOffset: +avatarTopSpacing)
contactAvatarContainerView.autoPinEdge(.bottom, to: .top, of: ongoingCallControls, withOffset: -avatarBottomSpacing)
contactAvatarContainerView.autoPinWidthToSuperview(withMargin: avatarTopSpacing)
@ -565,12 +581,12 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
if localVideoView.isHidden {
let contactHMargin = CGFloat(5)
constraints.append(contactNameLabel.autoPinTrailingToSuperviewMargin(withInset: contactHMargin))
constraints.append(callStatusLabel.autoPinTrailingToSuperviewMargin(withInset: contactHMargin))
// constraints.append(contactNameLabel.autoPinTrailingToSuperviewMargin(withInset: contactHMargin))
// constraints.append(callStatusLabel.autoPinTrailingToSuperviewMargin(withInset: contactHMargin))
} else {
let spacing = CGFloat(10)
constraints.append(localVideoView.autoPinLeading(toTrailingEdgeOf: contactNameLabel, offset: spacing))
constraints.append(localVideoView.autoPinLeading(toTrailingEdgeOf: callStatusLabel, offset: spacing))
// constraints.append(localVideoView.autoPinLeading(toTrailingEdgeOf: contactNameLabel, offset: spacing))
// constraints.append(localVideoView.autoPinLeading(toTrailingEdgeOf: callStatusLabel, offset: spacing))
}
self.localVideoConstraints = constraints
@ -916,10 +932,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
preferences.setIsCallKitPrivacyEnabled(preferences.isCallKitPrivacyEnabled())
}
func didTapLeaveCall(sender: UIGestureRecognizer) {
guard sender.state == .recognized else {
return
}
func didTapLeaveCall(sender: UIButton) {
OWSWindowManager.shared().leaveCallView()
}

@ -163,12 +163,17 @@ public class ContactShareViewHelper: NSObject, CNContactViewControllerDelegate {
target: self,
action: #selector(didFinishEditingContact))
// HACK otherwise CNContactViewController Navbar is shown as black.
let modal = OWSNavigationController(rootViewController: contactViewController)
// HACK otherwise CNContactViewController Navbar is shows window background color.
// RADAR rdar://28433898 http://www.openradar.me/28433898
// CNContactViewController incompatible with opaque navigation bar
UIUtil.applyDefaultSystemAppearence()
modal.navigationBar.isTranslucent = true
if #available(iOS 10, *) {
// Contact navbar is blue in iOS9, so our white text works,
// but gray on iOS10+, in which case we want the system default black text.
UIUtil.applyDefaultSystemAppearence()
}
let modal = UINavigationController(rootViewController: contactViewController)
fromViewController.present(modal, animated: true)
}
@ -189,7 +194,7 @@ public class ContactShareViewHelper: NSObject, CNContactViewControllerDelegate {
}
let viewController = AddContactShareToExistingContactViewController(contactShare: contactShare)
UIUtil.applySignalAppearence()
navigationController.pushViewController(viewController, animated: true)
}

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -15,10 +19,11 @@
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="oaw-nZ-Bd3">
<rect key="frame" x="0.0" y="44" width="375" height="559"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="dataSource" destination="-1" id="2Ke-sU-HF0"/>
@ -26,6 +31,7 @@
</connections>
</tableView>
<searchBar contentMode="redraw" translatesAutoresizingMaskIntoConstraints="NO" id="4gV-1B-8Mf">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="fOA-ib-HG5"/>
</constraints>
@ -38,7 +44,7 @@
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="oaw-nZ-Bd3" firstAttribute="top" secondItem="4gV-1B-8Mf" secondAttribute="bottom" id="6xt-kc-7P8"/>
<constraint firstItem="4gV-1B-8Mf" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="EXL-NQ-glZ"/>
<constraint firstItem="4gV-1B-8Mf" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="topMargin" id="EXL-NQ-glZ"/>
<constraint firstItem="4gV-1B-8Mf" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Yep-bF-mvk"/>
<constraint firstItem="oaw-nZ-Bd3" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="oKu-gT-NC6"/>
<constraint firstAttribute="bottom" secondItem="oaw-nZ-Bd3" secondAttribute="bottom" id="ptG-2s-ieJ"/>

@ -60,6 +60,7 @@
#import <SignalMessaging/OWSContactOffersInteraction.h>
#import <SignalMessaging/OWSContactsManager.h>
#import <SignalMessaging/OWSFormat.h>
#import <SignalMessaging/OWSNavigationController.h>
#import <SignalMessaging/OWSUserProfile.h>
#import <SignalMessaging/TSUnreadIndicatorInteraction.h>
#import <SignalMessaging/ThreadUtil.h>
@ -289,6 +290,10 @@ typedef enum : NSUInteger {
selector:@selector(blockedPhoneNumbersDidChange:)
name:kNSNotificationName_BlockedPhoneNumbersDidChange
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowManagerCallDidChange:)
name:OWSWindowManagerCallDidChangeNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(identityStateDidChange:)
name:kNSNotificationName_IdentityStateDidChange
@ -482,8 +487,6 @@ typedef enum : NSUInteger {
[self createContents];
[self.navigationController.navigationBar setTranslucent:NO];
[self registerCellClasses];
[self createConversationScrollButtons];
@ -1225,6 +1228,11 @@ typedef enum : NSUInteger {
self.navigationItem.leftBarButtonItem = backItem;
}
- (void)windowManagerCallDidChange:(NSNotification *)notification
{
[self updateBarButtonItems];
}
- (void)updateBarButtonItems
{
if (self.userLeftGroup) {
@ -1239,9 +1247,21 @@ typedef enum : NSUInteger {
// UIBarButtonItem in order to ensure that these buttons are spaced tightly.
// The contents of the navigation bar are cramped in this view.
UIButton *callButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *image = [UIImage imageNamed:@"button_phone_white"];
UIImage *image = [[UIImage imageNamed:@"button_phone_white"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[callButton setImage:image forState:UIControlStateNormal];
if (OWSWindowManager.sharedManager.hasCall) {
callButton.enabled = NO;
callButton.userInteractionEnabled = NO;
callButton.tintColor = UIColor.lightGrayColor;
} else {
callButton.enabled = YES;
callButton.userInteractionEnabled = YES;
callButton.tintColor = UIColor.whiteColor;
}
UIEdgeInsets imageEdgeInsets = UIEdgeInsetsZero;
// We normally would want to use left and right insets that ensure the button
// is square and the icon is centered. However UINavigationBar doesn't offer us
// control over the margins and spacing of its content, and the buttons end up
@ -2579,8 +2599,8 @@ typedef enum : NSUInteger {
contactsPicker.title
= NSLocalizedString(@"CONTACT_PICKER_TITLE", @"navbar title for contact picker when sharing a contact");
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:contactsPicker];
OWSNavigationController *navigationController =
[[OWSNavigationController alloc] initWithRootViewController:contactsPicker];
[self dismissKeyBoard];
[self presentViewController:navigationController animated:YES completion:nil];
}
@ -2621,7 +2641,7 @@ typedef enum : NSUInteger {
GifPickerViewController *view =
[[GifPickerViewController alloc] initWithThread:self.thread messageSender:self.messageSender];
view.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:view];
OWSNavigationController *navigationController = [[OWSNavigationController alloc] initWithRootViewController:view];
[self dismissKeyBoard];
[self presentViewController:navigationController animated:YES completion:nil];
@ -4018,8 +4038,9 @@ typedef enum : NSUInteger {
} else if (skipApprovalDialog) {
[self sendMessageAttachment:attachment];
} else {
AttachmentApprovalViewController *approvalVC = [[AttachmentApprovalViewController alloc] initWithAttachment:attachment delegate:self];
[self presentViewController:approvalVC animated:YES completion:nil];
OWSNavigationController *modal =
[AttachmentApprovalViewController wrappedInNavControllerWithAttachment:attachment delegate:self];
[self presentViewController:modal animated:YES completion:nil];
}
});
}

@ -109,7 +109,7 @@ NS_ASSUME_NONNULL_BEGIN
[items addObject:[OWSTableItem itemWithTitle:@"Show 2FA Reminder"
actionBlock:^() {
UINavigationController *navController =
OWSNavigationController *navController =
[OWS2FAReminderViewController wrappedInNavController];
[[[UIApplication sharedApplication] frontmostViewController]
presentViewController:navController

@ -252,7 +252,6 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
self.editingDbConnection = OWSPrimaryStorage.sharedManager.newDatabaseConnection;

@ -154,7 +154,7 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
let picker = ContactsPicker(allowsMultipleSelection: true, subtitleCellType: .phoneNumber)
picker.contactsPickerDelegate = self
picker.title = NSLocalizedString("INVITE_FRIENDS_PICKER_TITLE", comment: "Navbar title")
let navigationController = UINavigationController(rootViewController: picker)
let navigationController = OWSNavigationController(rootViewController: picker)
self.presentingViewController.present(navigationController, animated: true)
}
}
@ -218,7 +218,7 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos
let picker = ContactsPicker(allowsMultipleSelection: true, subtitleCellType: .email)
picker.contactsPickerDelegate = self
picker.title = NSLocalizedString("INVITE_FRIENDS_PICKER_TITLE", comment: "Navbar title")
let navigationController = UINavigationController(rootViewController: picker)
let navigationController = OWSNavigationController(rootViewController: picker)
self.presentingViewController.present(navigationController, animated: true)
}
}

@ -184,7 +184,7 @@ protocol MediaGalleryDataSourceDelegate: class {
func mediaGalleryDataSource(_ mediaGalleryDataSource: MediaGalleryDataSource, deletedSections: IndexSet, deletedItems: [IndexPath])
}
class MediaGalleryViewController: UINavigationController, MediaGalleryDataSource, MediaTileViewControllerDelegate {
class MediaGalleryViewController: OWSNavigationController, MediaGalleryDataSource, MediaTileViewControllerDelegate {
private var pageViewController: MediaPageViewController?
@ -395,9 +395,9 @@ class MediaGalleryViewController: UINavigationController, MediaGalleryDataSource
// If we're using a navigationController other than self to present the views
// e.g. the conversation settings view controller
var fromNavController: UINavigationController?
var fromNavController: OWSNavigationController?
func pushTileView(fromNavController: UINavigationController) {
func pushTileView(fromNavController: OWSNavigationController) {
var mostRecentItem: MediaGalleryItem?
self.uiDatabaseConnection.read { transaction in
if let message = self.mediaGalleryFinder.mostRecentMediaMessage(transaction: transaction) {

@ -269,8 +269,6 @@ NS_ASSUME_NONNULL_BEGIN
// a message.
[self.contactsViewHelper.contactsManager requestSystemContactsOnce];
[self.navigationController.navigationBar setTranslucent:NO];
[self showContactAppropriateViews];
}

@ -117,7 +117,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[self.view addSubview:firstSection];
[firstSection autoSetDimension:ALDimensionHeight toSize:100.f];
[firstSection autoPinWidthToSuperview];
[firstSection autoPinEdgeToSuperviewEdge:ALEdgeTop];
[firstSection autoPinToTopLayoutGuideOfViewController:self withInset:0];
_tableViewController = [OWSTableViewController new];
_tableViewController.delegate = self;
@ -420,13 +420,6 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
#pragma mark - Methods
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

@ -14,8 +14,8 @@ public class OWS2FAReminderViewController: UIViewController, PinEntryViewDelegat
var pinEntryView: PinEntryView!
@objc
public class func wrappedInNavController() -> UINavigationController {
let navController = UINavigationController()
public class func wrappedInNavController() -> OWSNavigationController {
let navController = OWSNavigationController()
navController.pushViewController(OWS2FAReminderViewController(), animated: false)
return navController

@ -1,77 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSNavigationController.h"
// We use a category to expose UINavigationController's private
// UINavigationBarDelegate methods.
@interface UINavigationController (OWSNavigationController) <UINavigationBarDelegate>
@end
#pragma mark -
@interface OWSNavigationController () <UIGestureRecognizerDelegate>
@end
#pragma mark -
@implementation OWSNavigationController
- (void)viewDidLoad
{
[super viewDidLoad];
self.interactivePopGestureRecognizer.delegate = self;
}
#pragma mark - UINavigationBarDelegate
// All UINavigationController serve as the UINavigationBarDelegate for their navbar.
// We override shouldPopItem: in order to cancel some back button presses - for example,
// if a view has unsaved changes.
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
{
OWSAssert(self.interactivePopGestureRecognizer.delegate == self);
UIViewController *topViewController = self.topViewController;
// wasBackButtonClicked is YES if the back button was pressed but not
// if a back gesture was performed or if the view is popped programmatically.
BOOL wasBackButtonClicked = topViewController.navigationItem == item;
BOOL result = YES;
if (wasBackButtonClicked) {
if ([topViewController conformsToProtocol:@protocol(OWSNavigationView)]) {
id<OWSNavigationView> navigationView = (id<OWSNavigationView>)topViewController;
result = ![navigationView shouldCancelNavigationBack];
}
}
// If we're not going to cancel the pop/back, we need to call the super
// implementation since it has important side effects.
if (result) {
// NOTE: result might end up NO if the super implementation cancels the
// the pop/back.
result = [super navigationBar:navigationBar shouldPopItem:item];
}
return result;
}
#pragma mark - UIGestureRecognizerDelegate
// We serve as the UIGestureRecognizerDelegate of the interactivePopGestureRecognizer
// in order to cancel some "back" gestures - for example,
// if a view has unsaved changes.
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
UIViewController *topViewController = self.topViewController;
if ([topViewController conformsToProtocol:@protocol(OWSNavigationView)]) {
id<OWSNavigationView> navigationView = (id<OWSNavigationView>)topViewController;
return ![navigationView shouldCancelNavigationBack];
} else {
return YES;
}
}
@end

@ -13,6 +13,7 @@
#import "UIFont+OWS.h"
#import "UIView+OWS.h"
#import <SignalMessaging/NSString+OWS.h>
#import <SignalMessaging/OWSNavigationController.h>
#import <SignalMessaging/OWSProfileManager.h>
#import <SignalMessaging/UIViewController+OWS.h>
#import <SignalServiceKit/NSDate+OWS.h>
@ -75,7 +76,6 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
{
[super loadView];
[self.navigationController.navigationBar setTranslucent:NO];
self.title = NSLocalizedString(@"PROFILE_VIEW_TITLE", @"Title for the profile view.");
_avatarViewHelper = [AvatarViewHelper new];
@ -94,7 +94,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
UIView *contentView = [UIView containerView];
contentView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:contentView];
[contentView autoPinEdgeToSuperviewEdge:ALEdgeTop];
[contentView autoPinToTopLayoutGuideOfViewController:self withInset:0];
[contentView autoPinWidthToSuperview];
const CGFloat fontSizePoints = ScaleFromIPhone5To7Plus(16.f, 20.f);

@ -14,6 +14,7 @@
#import <SAMKeychain/SAMKeychain.h>
#import <SignalMessaging/Environment.h>
#import <SignalMessaging/NSString+OWS.h>
#import <SignalMessaging/OWSNavigationController.h>
NS_ASSUME_NONNULL_BEGIN
@ -50,7 +51,8 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
// Do any additional setup after loading the view.
[self populateDefaultCountryNameAndCode];
[SignalApp.sharedApp setSignUpFlowNavigationController:self.navigationController];
OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]);
[SignalApp.sharedApp setSignUpFlowNavigationController:(OWSNavigationController *)self.navigationController];
}
- (void)viewDidLoad
@ -354,8 +356,8 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
{
CountryCodeViewController *countryCodeController = [CountryCodeViewController new];
countryCodeController.countryCodeDelegate = self;
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:countryCodeController];
OWSNavigationController *navigationController =
[[OWSNavigationController alloc] initWithRootViewController:countryCodeController];
[self presentViewController:navigationController animated:YES completion:[UIUtil modalCompletionBlock]];
}

@ -1,8 +1,9 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "SignalsNavigationController.h"
#import "Signal-Swift.h"
#import <SignalMessaging/UIUtil.h>
#import <SignalServiceKit/NSTimer+OWS.h>
#import <SignalServiceKit/OWSSignalService.h>
@ -23,6 +24,7 @@ static double const STALLED_PROGRESS = 0.9;
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initializeObserver];
[self updateSocketStatusView];

@ -105,8 +105,8 @@ typedef void (^CustomLayoutBlock)(void);
FingerprintViewController *fingerprintViewController = [FingerprintViewController new];
[fingerprintViewController configureWithRecipientId:recipientId];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:fingerprintViewController];
OWSNavigationController *navigationController =
[[OWSNavigationController alloc] initWithRootViewController:fingerprintViewController];
[viewController presentViewController:navigationController animated:YES completion:nil];
}

@ -1173,7 +1173,8 @@ NS_ASSUME_NONNULL_BEGIN
// reference to it until we're dismissed.
self.mediaGalleryViewController = vc;
[vc pushTileViewFromNavController:self.navigationController];
OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]);
[vc pushTileViewFromNavController:(OWSNavigationController *)self.navigationController];
}
#pragma mark - Notifications

@ -97,11 +97,6 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]);
// HACK otherwise CNContactViewController Navbar is shown as black.
// RADAR rdar://28433898 http://www.openradar.me/28433898
// CNContactViewController incompatible with opaque navigation bar
[self.navigationController.navigationBar setTranslucent:YES];
self.title = _thread.groupModel.groupName;
[self updateTableContents];

@ -113,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.view addSubview:firstSection];
[firstSection autoSetDimension:ALDimensionHeight toSize:100.f];
[firstSection autoPinWidthToSuperview];
[firstSection autoPinEdgeToSuperviewEdge:ALEdgeTop];
[firstSection autoPinToTopLayoutGuideOfViewController:self withInset:0];
_tableViewController = [OWSTableViewController new];
_tableViewController.delegate = self;
@ -125,13 +125,6 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
- (void)setHasUnsavedChanges:(BOOL)hasUnsavedChanges
{
_hasUnsavedChanges = hasUnsavedChanges;

@ -10,6 +10,7 @@
@class HomeViewController;
@class NotificationsManager;
@class OWSMessageFetcherJob;
@class OWSNavigationController;
@class OWSWebRTCCallMessageHandler;
@class OutboundCallInitiator;
@class TSThread;
@ -17,7 +18,7 @@
@interface SignalApp : NSObject
@property (nonatomic, weak) HomeViewController *homeViewController;
@property (nonatomic, weak) UINavigationController *signUpFlowNavigationController;
@property (nonatomic, weak) OWSNavigationController *signUpFlowNavigationController;
// TODO: Convert to singletons?
@property (nonatomic, readonly) OWSWebRTCCallMessageHandler *callMessageHandler;

@ -128,6 +128,11 @@ NS_ASSUME_NONNULL_BEGIN
[[UIApplication sharedApplication] setStatusBarHidden:isHidden animated:isAnimated];
}
- (CGFloat)statusBarHeight
{
return [UIApplication sharedApplication].statusBarFrame.size.height;
}
- (BOOL)isInBackground
{
return [UIApplication sharedApplication].applicationState == UIApplicationStateBackground;

@ -1,25 +0,0 @@
//
// UIDevice+TSHardwareVersion.h
// Signal
//
// Created by Dylan Bourgeois on 19/12/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
// Original Source :
// Erica Sadun, http://ericasadun.com
// iPhone Developer's Cookbook, 6.x Edition
// BSD License, Use at your own risk
//
//
#import <UIKit/UIKit.h>
@interface UIDevice (TSHardwareVersion)
/*
* Returns true if device is iPhone 6 or 6+
*/
- (BOOL)isiPhoneVersionSixOrMore;
@end

@ -1,28 +0,0 @@
//
// UIDevice+TSHardwareVersion.m
// Signal
//
// Created by Dylan Bourgeois on 19/12/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
// Original Source :
// Erica Sadun, http://ericasadun.com
// iPhone Developer's Cookbook, 6.x Edition
// BSD License, Use at your own risk
//
//
#include <sys/sysctl.h>
#import "UIDevice+TSHardwareVersion.h"
@implementation UIDevice (TSHardwareVersion)
// Look for phone-type devices with a width greater than or equal to the width
// of the original iPhone 6. Hopefully, this is somewhat future proof
- (BOOL)isiPhoneVersionSixOrMore {
return
self.userInterfaceIdiom == UIUserInterfaceIdiomPhone &&
([[UIScreen mainScreen] scale] * [[UIScreen mainScreen] bounds].size.width) >= 750;
}
@end

@ -29,11 +29,13 @@ FOUNDATION_EXPORT const unsigned char SignalMessagingVersionString[];
#import <SignalMessaging/OWSFormat.h>
#import <SignalMessaging/OWSLogger.h>
#import <SignalMessaging/OWSMath.h>
#import <SignalMessaging/OWSNavigationController.h>
#import <SignalMessaging/OWSProfileManager.h>
#import <SignalMessaging/OWSQuotedReplyModel.h>
#import <SignalMessaging/OWSSounds.h>
#import <SignalMessaging/OWSTableViewController.h>
#import <SignalMessaging/OWSUserProfile.h>
#import <SignalMessaging/OWSWindowManager.h>
#import <SignalMessaging/Release.h>
#import <SignalMessaging/SharingThreadPickerViewController.h>
#import <SignalMessaging/SignalKeyingStorage.h>

@ -1,9 +1,11 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
// Any view controller which wants to be able cancel back button
// presses and back gestures should implement this protocol.
@protocol OWSNavigationView <NSObject>
@ -22,3 +24,5 @@
@interface OWSNavigationController : UINavigationController
@end
NS_ASSUME_NONNULL_END

@ -0,0 +1,155 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSNavigationController.h"
#import <SignalMessaging/SignalMessaging-Swift.h>
NS_ASSUME_NONNULL_BEGIN
@interface UINavigationController (OWSNavigationController) <UINavigationBarDelegate, NavBarLayoutDelegate>
@end
#pragma mark -
// Expose that UINavigationController already secretly implements UIGestureRecognizerDelegate
// so we can call [super navigationBar:shouldPopItem] in our own implementation to take advantage
// of the important side effects of that method.
@interface OWSNavigationController () <UIGestureRecognizerDelegate>
@end
#pragma mark -
@implementation OWSNavigationController
- (instancetype)initWithRootViewController:(UIViewController *)rootViewController
{
self = [self initWithNavigationBarClass:[OWSNavigationBar class] toolbarClass:nil];
if (!self) {
return self;
}
[self pushViewController:rootViewController animated:NO];
if (![self.navigationBar isKindOfClass:[OWSNavigationBar class]]) {
OWSFail(@"%@ navigationBar was unexpected class: %@", self.logTag, self.navigationBar);
return self;
}
OWSNavigationBar *navbar = (OWSNavigationBar *)self.navigationBar;
navbar.navBarLayoutDelegate = self;
[self updateLayoutForNavbar:navbar];
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.interactivePopGestureRecognizer.delegate = self;
}
#pragma mark - UINavigationBarDelegate
// All OWSNavigationController serve as the UINavigationBarDelegate for their navbar.
// We override shouldPopItem: in order to cancel some back button presses - for example,
// if a view has unsaved changes.
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
{
OWSAssert(self.interactivePopGestureRecognizer.delegate == self);
UIViewController *topViewController = self.topViewController;
// wasBackButtonClicked is YES if the back button was pressed but not
// if a back gesture was performed or if the view is popped programmatically.
BOOL wasBackButtonClicked = topViewController.navigationItem == item;
BOOL result = YES;
if (wasBackButtonClicked) {
if ([topViewController conformsToProtocol:@protocol(OWSNavigationView)]) {
id<OWSNavigationView> navigationView = (id<OWSNavigationView>)topViewController;
result = ![navigationView shouldCancelNavigationBack];
}
}
// If we're not going to cancel the pop/back, we need to call the super
// implementation since it has important side effects.
if (result) {
// NOTE: result might end up NO if the super implementation cancels the
// the pop/back.
[super navigationBar:navigationBar shouldPopItem:item];
result = YES;
}
return result;
}
#pragma mark - UIGestureRecognizerDelegate
// We serve as the UIGestureRecognizerDelegate of the interactivePopGestureRecognizer
// in order to cancel some "back" gestures - for example,
// if a view has unsaved changes.
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
UIViewController *topViewController = self.topViewController;
if ([topViewController conformsToProtocol:@protocol(OWSNavigationView)]) {
id<OWSNavigationView> navigationView = (id<OWSNavigationView>)topViewController;
return ![navigationView shouldCancelNavigationBack];
} else {
return YES;
}
}
#pragma mark - NavBarLayoutDelegate
- (void)navBarCallLayoutDidChangeWithNavbar:(OWSNavigationBar *)navbar
{
[self updateLayoutForNavbar:navbar];
}
- (void)updateLayoutForNavbar:(OWSNavigationBar *)navbar
{
DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__);
if (@available(iOS 11.0, *)) {
if (OWSWindowManager.sharedManager.hasCall) {
if (UIDevice.currentDevice.isIPhoneX) {
// iPhoneX computes status bar height differently.
// IOS_DEVICE_CONSTANT
self.additionalSafeAreaInsets = UIEdgeInsetsMake(navbar.navbarWithoutStatusHeight + 20, 0, 0, 0);
} else {
self.additionalSafeAreaInsets
= UIEdgeInsetsMake(navbar.navbarWithoutStatusHeight + CurrentAppContext().statusBarHeight, 0, 0, 0);
}
} else {
self.additionalSafeAreaInsets = UIEdgeInsetsZero;
}
// in iOS11 we have to ensure the navbar frame *in* layoutSubviews.
[navbar layoutSubviews];
} else {
// Pre iOS11 we size the navbar, and position it vertically once.
[navbar sizeToFit];
if (OWSWindowManager.sharedManager.hasCall) {
CGRect oldFrame = navbar.frame;
CGRect newFrame = oldFrame;
newFrame.size.height = navbar.callBannerHeight;
navbar.frame = newFrame;
} else {
CGRect oldFrame = navbar.frame;
CGRect newFrame
= CGRectMake(oldFrame.origin.x, navbar.statusBarHeight, oldFrame.size.width, oldFrame.size.height);
navbar.frame = newFrame;
}
// Since the navbar's frame was updated, we need to be sure our child VC's
// container view is updated.
[self.view setNeedsLayout];
}
}
@end
NS_ASSUME_NONNULL_END

@ -3,6 +3,7 @@
//
#import "OWSTableViewController.h"
#import "OWSNavigationController.h"
#import "UIFont+OWS.h"
#import "UIView+OWS.h"
@ -463,13 +464,6 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kOWSTableCellIdentifier];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
@ -659,7 +653,7 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
{
OWSAssert(fromViewController);
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self];
OWSNavigationController *navigationController = [[OWSNavigationController alloc] initWithRootViewController:self];
self.navigationItem.leftBarButtonItem =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
target:self

@ -0,0 +1,77 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import Foundation
@objc
public protocol ReturnToCallViewControllerDelegate: class {
func returnToCallWasTapped(_ viewController: ReturnToCallViewController)
}
@objc
public class ReturnToCallViewController: UIViewController {
public weak var delegate: ReturnToCallViewControllerDelegate?
let returnToCallLabel = UILabel()
public func startAnimating() {
NotificationCenter.default.addObserver(self, selector: #selector(didTapStatusBar(notification:)), name: .TappedStatusBar, object: nil)
self.returnToCallLabel.layer.removeAllAnimations()
self.returnToCallLabel.alpha = 1
UIView.animate(withDuration: 1,
delay: 0,
options: [.repeat, .autoreverse],
animations: { self.returnToCallLabel.alpha = 0 },
completion: { _ in self.returnToCallLabel.alpha = 1 })
}
public func stopAnimating() {
NotificationCenter.default.removeObserver(self, name: .TappedStatusBar, object: nil)
self.returnToCallLabel.layer.removeAllAnimations()
}
override public func loadView() {
self.view = UIView()
// This is the color of the iOS "return to call" banner.
view.backgroundColor = UIColor(rgbHex: 0x4cd964)
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTapView))
view.addGestureRecognizer(tapGesture)
view.addSubview(returnToCallLabel)
// System UI doesn't use dynamic type for status bar; neither do we.
returnToCallLabel.font = UIFont.ows_regularFont(withSize: 14)
returnToCallLabel.text = NSLocalizedString("CALL_WINDOW_RETURN_TO_CALL", comment: "Label for the 'return to call' banner.")
returnToCallLabel.textColor = .white
returnToCallLabel.autoPinEdge(toSuperviewEdge: .bottom, withInset: 2)
returnToCallLabel.setCompressionResistanceHigh()
returnToCallLabel.setContentHuggingHigh()
returnToCallLabel.autoHCenterInSuperview()
}
@objc
public func didTapView(gestureRecognizer: UITapGestureRecognizer) {
self.delegate?.returnToCallWasTapped(self)
}
@objc
public func didTapStatusBar(notification: Notification) {
self.delegate?.returnToCallWasTapped(self)
}
override public func viewWillLayoutSubviews() {
Logger.debug("\(self.logTag) in \(#function)")
super.viewWillLayoutSubviews()
}
override public func viewDidLayoutSubviews() {
Logger.debug("\(self.logTag) in \(#function)")
super.viewDidLayoutSubviews()
}
}

@ -392,19 +392,23 @@ NS_ASSUME_NONNULL_BEGIN
target:fromViewController
action:@selector(didFinishEditingContact)];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:contactViewController];
OWSNavigationController *modal = [[OWSNavigationController alloc] initWithRootViewController:contactViewController];
// HACK otherwise CNContactViewController Navbar is shows window background color.
// RADAR rdar://28433898 http://www.openradar.me/28433898
// CNContactViewController incompatible with opaque navigation bar
modal.navigationBar.translucent = YES;
if (@available(iOS 10, *)) {
// Contact navbar is blue in iOS9, so our white tex works,
// but gray on iOS10+, in which case we want the system default black text.
[UIUtil applyDefaultSystemAppearence];
}
// We want the presentation to imply a "replacement" in this case.
if (shouldEditImmediately) {
navigationController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
modal.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
}
[fromViewController presentViewController:navigationController animated:YES completion:nil];
// HACK otherwise CNContactViewController Navbar is shown as black.
// RADAR rdar://28433898 http://www.openradar.me/28433898
// CNContactViewController incompatible with opaque navigation bar
[UIUtil applyDefaultSystemAppearence];
[fromViewController presentViewController:modal animated:YES completion:nil];
}
@end

@ -0,0 +1,99 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import Foundation
import UIKit
@objc
protocol NavBarLayoutDelegate: class {
func navBarCallLayoutDidChange(navbar: OWSNavigationBar)
}
@objc
class OWSNavigationBar: UINavigationBar {
weak var navBarLayoutDelegate: NavBarLayoutDelegate?
let navbarWithoutStatusHeight: CGFloat = 44
var callBannerHeight: CGFloat {
return OWSWindowManagerCallScreenHeight()
}
var statusBarHeight: CGFloat {
return CurrentAppContext().statusBarHeight
}
var fullWidth: CGFloat {
return UIScreen.main.bounds.size.width
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
self.isTranslucent = false
NotificationCenter.default.addObserver(self, selector: #selector(callDidChange), name: .OWSWindowManagerCallDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didChangeStatusBarFrame), name: .UIApplicationDidChangeStatusBarFrame, object: nil)
}
@objc
public func callDidChange() {
Logger.debug("\(self.logTag) in \(#function)")
self.navBarLayoutDelegate?.navBarCallLayoutDidChange(navbar: self)
}
@objc
public func didChangeStatusBarFrame() {
Logger.debug("\(self.logTag) in \(#function)")
self.navBarLayoutDelegate?.navBarCallLayoutDidChange(navbar: self)
}
override func sizeThatFits(_ size: CGSize) -> CGSize {
guard OWSWindowManager.shared().hasCall() else {
return super.sizeThatFits(size)
}
if #available(iOS 11, *) {
return super.sizeThatFits(size)
} else {
// pre iOS11, sizeThatFits is repeatedly called to determine how much space to reserve for that navbar.
// That is, increasing this causes the child view controller to be pushed down.
// (as of iOS11, this is not used and instead we use additionalSafeAreaInsets)
return CGSize(width: fullWidth, height: navbarWithoutStatusHeight + statusBarHeight)
}
}
override func layoutSubviews() {
guard OWSWindowManager.shared().hasCall() else {
super.layoutSubviews()
return
}
self.frame = CGRect(x: 0, y: callBannerHeight, width: fullWidth, height: navbarWithoutStatusHeight)
self.bounds = CGRect(x: 0, y: 0, width: fullWidth, height: navbarWithoutStatusHeight)
super.layoutSubviews()
guard #available(iOS 11, *) else {
return
}
// This is only necessary on iOS11, which has some private views within that lay outside of the navbar.
// They aren't actually visible behind the call status bar, but they looks strange during present/dismiss
// animations for modal VC's
for subview in self.subviews {
let stringFromClass = NSStringFromClass(subview.classForCoder)
if stringFromClass.contains("BarBackground") {
subview.frame = self.bounds
} else if stringFromClass.contains("BarContentView") {
subview.frame = self.bounds
}
}
}
}

@ -55,7 +55,26 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
override public func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.title = dialogTitle()
self.navigationItem.title = nil
let cancelButton = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(cancelPressed))
cancelButton.tintColor = .white
self.navigationItem.leftBarButtonItem = cancelButton
}
@objc
public class func wrappedInNavController(attachment: SignalAttachment, delegate: AttachmentApprovalViewControllerDelegate) -> OWSNavigationController {
let vc = AttachmentApprovalViewController(attachment: attachment, delegate: delegate)
let navController = OWSNavigationController(rootViewController: vc)
// Make navigationBar clear
navController.navigationBar.backgroundColor = .clear
navController.navigationBar.setBackgroundImage(UIImage(), for: .default)
navController.navigationBar.isTranslucent = true
navController.navigationBar.shadowImage = UIImage()
navController.navigationBar.clipsToBounds = true
return navController
}
override public func viewWillLayoutSubviews() {
@ -66,14 +85,6 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
updateMinZoomScaleForSize(view.bounds.size)
}
private func dialogTitle() -> String {
guard let filename = mediaMessageView.formattedFileName() else {
return NSLocalizedString("ATTACHMENT_APPROVAL_DIALOG_TITLE",
comment: "Title for the 'attachment approval' dialog.")
}
return filename
}
override public func viewWillAppear(_ animated: Bool) {
Logger.debug("\(logTag) in \(#function)")
super.viewWillAppear(animated)
@ -150,19 +161,6 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
topGradient.autoSetDimension(.height, toSize: ScaleFromIPhone5(60))
}
// Top Toolbar
let topToolbar = makeClearToolbar()
self.view.addSubview(topToolbar)
topToolbar.autoPinWidthToSuperview()
topToolbar.autoPin(toTopLayoutGuideOf: self, withInset: 0)
topToolbar.setContentHuggingVerticalHigh()
topToolbar.setCompressionResistanceVerticalHigh()
let cancelButton = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(cancelPressed))
cancelButton.tintColor = UIColor.white
topToolbar.items = [cancelButton]
// Bottom Toolbar
let captioningToolbar = CaptioningToolbar()
captioningToolbar.captioningToolbarDelegate = self
@ -198,7 +196,7 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
// pops the keyboard.
contentContainer.addSubview(progressBar)
progressBar.autoPinEdge(.top, to: .bottom, of: topToolbar)
progressBar.autoPin(toTopLayoutGuideOf: self, withInset: 0)
progressBar.autoPinWidthToSuperview()
progressBar.autoSetDimension(.height, toSize: 44)
@ -320,7 +318,6 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
}
public func playerProgressBarDidStartScrubbing(_ playerProgressBar: PlayerProgressBar) {
// [self.videoPlayer pause];
guard let videoPlayer = self.videoPlayer else {
owsFail("\(TAG) video player was unexpectedly nil")
return

@ -23,7 +23,13 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
let contactsManager: OWSContactsManager
private(set) var textView: UITextView!
private(set) var topToolbar: UIToolbar!
private var sendButton: UIBarButtonItem = {
return UIBarButtonItem(title: NSLocalizedString("SEND_BUTTON_TITLE",
comment: "Label for the send button in the conversation view."),
style: .plain,
target: self,
action: #selector(sendPressed))
}()
// MARK: Initializers
@ -48,26 +54,13 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
super.viewDidLoad()
self.navigationItem.title = NSLocalizedString("MESSAGE_APPROVAL_DIALOG_TITLE",
comment: "Title for the 'message approval' dialog.")
}
private func updateToolbar() {
var items = [UIBarButtonItem]()
let cancelButton = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(cancelPressed))
items.append(cancelButton)
if textView.text.count > 0 {
let spacer = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
items.append(spacer)
let sendButton = UIBarButtonItem(title: NSLocalizedString("SEND_BUTTON_TITLE",
comment: "Label for the send button in the conversation view."),
style: .plain,
target: self,
action: #selector(sendPressed))
items.append(sendButton)
}
self.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(cancelPressed))
self.navigationItem.rightBarButtonItem = sendButton
}
topToolbar.items = items
private func updateSendButton() {
sendButton.isEnabled = textView.text.count > 0
}
// MARK: - Create Views
@ -77,20 +70,11 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
self.view = UIView.container()
self.view.backgroundColor = UIColor.white
// Top Toolbar
topToolbar = UIToolbar()
topToolbar.backgroundColor = UIColor.ows_toolbarBackground
self.view.addSubview(topToolbar)
topToolbar.autoPinWidthToSuperview()
topToolbar.autoPin(toTopLayoutGuideOf: self, withInset: 0)
topToolbar.setContentHuggingVerticalHigh()
topToolbar.setCompressionResistanceVerticalHigh()
// Recipient Row
let recipientRow = createRecipientRow()
view.addSubview(recipientRow)
recipientRow.autoPinWidthToSuperview()
recipientRow.autoPinEdge(.top, to: .bottom, of: topToolbar)
recipientRow.autoPin(toTopLayoutGuideOf: self, withInset: 0)
// Text View
textView = UITextView()
@ -105,8 +89,6 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
textView.autoPinWidthToSuperview()
textView.autoPinEdge(.top, to: .bottom, of: recipientRow)
textView.autoPin(toBottomLayoutGuideOf: self, withInset: 0)
updateToolbar()
}
private func createRecipientRow() -> UIView {
@ -223,6 +205,6 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
// MARK: - UITextViewDelegate
public func textViewDidChange(_ textView: UITextView) {
updateToolbar()
updateSendButton()
}
}

@ -185,12 +185,6 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
NSString *_Nullable messageText = [self convertAttachmentToMessageTextIfPossible];
// Hide the navigation bar before presenting the approval view.
//
// Note that cancelling in the approval views will dismiss the entire
// share extension, so there is no "back" button.
self.navigationController.navigationBarHidden = YES;
if (messageText) {
MessageApprovalViewController *approvalVC =
[[MessageApprovalViewController alloc] initWithMessageText:messageText
@ -200,10 +194,9 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
[self.navigationController pushViewController:approvalVC animated:YES];
} else {
AttachmentApprovalViewController *approvalVC =
[[AttachmentApprovalViewController alloc] initWithAttachment:self.attachment delegate:self];
[self.navigationController pushViewController:approvalVC animated:YES];
OWSNavigationController *approvalModal =
[AttachmentApprovalViewController wrappedInNavControllerWithAttachment:self.attachment delegate:self];
[self presentViewController:approvalModal animated:YES completion:nil];
}
}

@ -0,0 +1,31 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import Foundation
public extension UIDevice {
var supportsCallKit: Bool {
return ProcessInfo().isOperatingSystemAtLeast(OperatingSystemVersion(majorVersion: 10, minorVersion: 0, patchVersion: 0))
}
var isIPhoneX: Bool {
switch UIScreen.main.nativeBounds.height {
case 1136:
// iPhone 5 or 5S or 5C
return false
case 1334:
// iPhone 6/6S/7/8
return false
case 1920, 2208:
// iPhone 6+/6S+/7+/8+//
return false
case 2436:
return true
default:
// Verify all our IOS_DEVICE_CONSTANT tags make sense when adding a new device size.
owsFail("\(logTag) in \(#function) unknown device format")
return false
}
}
}

@ -26,7 +26,6 @@
[super loadView];
self.view.backgroundColor = [UIColor whiteColor];
[self.navigationController.navigationBar setTranslucent:NO];
self.title = NSLocalizedString(@"COUNTRYCODE_SELECT_TITLE", @"");
self.countryCodes = [PhoneNumberUtil countryCodesForSearchTerm:nil];

@ -55,7 +55,6 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
[super loadView];
self.view.backgroundColor = [UIColor whiteColor];
[self.navigationController.navigationBar setTranslucent:NO];
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];
@ -267,8 +266,8 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
if (self.isPresentedInNavigationController) {
[self.navigationController pushViewController:countryCodeController animated:YES];
} else {
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:countryCodeController];
OWSNavigationController *navigationController =
[[OWSNavigationController alloc] initWithRootViewController:countryCodeController];
[self presentViewController:navigationController animated:YES completion:[UIUtil modalCompletionBlock]];
}
}

@ -81,12 +81,6 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
- (void)createViews
{
OWSAssert(self.selectThreadViewDelegate);

@ -8,6 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
extern const NSUInteger kMin2FAPinLength;
extern const NSUInteger kMax2FAPinLength;
extern NSString *const TappedStatusBarNotification;
@interface ViewControllerUtils : NSObject

@ -11,6 +11,8 @@
NS_ASSUME_NONNULL_BEGIN
NSString *const TappedStatusBarNotification = @"TappedStatusBarNotification";
const NSUInteger kMin2FAPinLength = 4;
const NSUInteger kMax2FAPinLength = 16;

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSPreferences.h"
@ -16,10 +16,10 @@
@class ContactsUpdater;
@class OWSContactsManager;
@class OWSMessageSender;
@class OWSNavigationController;
@class TSGroupThread;
@class TSNetworkManager;
@class TSThread;
@class UINavigationController;
@interface Environment : NSObject

@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark -
extern NSString *const OWSWindowManagerCallDidChangeNotification;
const CGFloat OWSWindowManagerCallScreenHeight(void);
extern const UIWindowLevel UIWindowLevel_Background;
@interface OWSWindowManager : NSObject
@ -29,7 +32,6 @@ extern const UIWindowLevel UIWindowLevel_Background;
- (void)startCall:(UIViewController *)callViewController;
- (void)endCall:(UIViewController *)callViewController;
- (void)leaveCallView;
- (void)returnToCallView;
- (BOOL)hasCall;
@end

@ -3,29 +3,46 @@
//
#import "OWSWindowManager.h"
#import "Signal-Swift.h"
#import <SignalMessaging/UIColor+OWS.h>
#import <SignalMessaging/UIFont+OWS.h>
#import <SignalMessaging/UIView+OWS.h>
#import "UIColor+OWS.h"
#import "UIFont+OWS.h"
#import "UIView+OWS.h"
#import <SignalMessaging/SignalMessaging-Swift.h>
NS_ASSUME_NONNULL_BEGIN
NSString *const OWSWindowManagerCallDidChangeNotification = @"OWSWindowManagerCallDidChangeNotification";
const CGFloat OWSWindowManagerCallScreenHeight(void)
{
if ([UIDevice currentDevice].isIPhoneX) {
// On an iPhoneX, the system return-to-call banner has been replaced by a much subtler green
// circle behind the system clock. Instead, we mimic the old system call banner as on older devices,
// but it has to be taller to fit beneath the notch.
// IOS_DEVICE_CONSTANT, we'll want to revisit this when new device dimensions are introduced.
return 64;
} else {
return CurrentAppContext().statusBarHeight + 20;
}
}
// Behind everything, especially the root window.
const UIWindowLevel UIWindowLevel_Background = -1.f;
// In front of the root window _and_ status bar
// but behind the screen blocking window.
const UIWindowLevel UIWindowLevel_ReturnToCall(void);
const UIWindowLevel UIWindowLevel_ReturnToCall(void)
{
return UIWindowLevelStatusBar + 1.f;
return UIWindowLevelStatusBar - 1;
}
// In front of the root window, behind the screen blocking window.
const UIWindowLevel UIWindowLevel_CallView(void);
const UIWindowLevel UIWindowLevel_CallView(void)
{
return UIWindowLevelNormal + 1.f;
}
// In front of everything, including the status bar.
const UIWindowLevel UIWindowLevel_ScreenBlocking(void);
const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
@ -44,18 +61,18 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
#pragma mark -
@interface OWSWindowManager ()
@interface OWSWindowManager () <ReturnToCallViewControllerDelegate>
// UIWindowLevelNormal
@property (nonatomic) UIWindow *rootWindow;
// UIWindowLevel_ReturnToCall
@property (nonatomic) UIWindow *returnToCallWindow;
@property (nonatomic) UILabel *returnToCallLabel;
@property (nonatomic) ReturnToCallViewController *returnToCallViewController;
// UIWindowLevel_CallView
@property (nonatomic) UIWindow *callViewWindow;
@property (nonatomic) UINavigationController *callNavigationController;
@property (nonatomic) OWSNavigationController *callNavigationController;
// UIWindowLevel_Background if inactive,
// UIWindowLevel_ScreenBlocking() if active.
@ -63,7 +80,7 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
@property (nonatomic) BOOL isScreenBlockActive;
@property (nonatomic) BOOL isCallViewActive;
@property (nonatomic) BOOL shouldShowCallView;
@property (nonatomic, nullable) UIViewController *callViewController;
@ -111,84 +128,47 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
self.returnToCallWindow = [self createReturnToCallWindow:rootWindow];
self.callViewWindow = [self createCallViewWindow:rootWindow];
[self updateReturnToCallWindowLayout];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didChangeStatusBarFrame:)
name:UIApplicationDidChangeStatusBarFrameNotification
object:nil];
[self ensureWindowState];
}
- (void)didChangeStatusBarFrame:(NSNotification *)notification
{
CGRect newFrame = self.returnToCallWindow.frame;
newFrame.size.height = OWSWindowManagerCallScreenHeight();
DDLogDebug(@"%@ StatusBar changed frames - updating returnToCallWindowFrame: %@",
self.logTag,
NSStringFromCGRect(newFrame));
self.returnToCallWindow.frame = newFrame;
}
- (UIWindow *)createReturnToCallWindow:(UIWindow *)rootWindow
{
OWSAssertIsOnMainThread();
OWSAssert(rootWindow);
// "Return to call" should remain at the top of the screen.
CGRect windowFrame = rootWindow.bounds;
// Use zero height until updateReturnToCallWindowLayout.
windowFrame.size.height = 0;
CGRect windowFrame = UIScreen.mainScreen.bounds;
windowFrame.size.height = OWSWindowManagerCallScreenHeight();
UIWindow *window = [[UIWindow alloc] initWithFrame:windowFrame];
window.hidden = YES;
window.windowLevel = UIWindowLevel_ReturnToCall();
window.opaque = YES;
// This is the color of the iOS "return to call" banner.
// TODO: What's the right color to use here?
UIColor *backgroundColor = [UIColor colorWithRGBHex:0x4cd964];
window.backgroundColor = backgroundColor;
UIViewController *viewController = [OWSWindowRootViewController new];
viewController.view.backgroundColor = backgroundColor;
UIView *rootView = viewController.view;
rootView.userInteractionEnabled = YES;
[rootView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(returnToCallWasTapped:)]];
rootView.layoutMargins = UIEdgeInsetsZero;
UILabel *label = [UILabel new];
label.text = NSLocalizedString(@"CALL_WINDOW_RETURN_TO_CALL", @"Label for the 'return to call' banner.");
label.textColor = [UIColor whiteColor];
// System UI doesn't use dynamic type; neither do we.
label.font = [UIFont ows_regularFontWithSize:14.f];
[rootView addSubview:label];
// returnToCallLabel uses manual layout.
//
// TODO: Is there a better way to do this?
label.translatesAutoresizingMaskIntoConstraints = NO;
self.returnToCallLabel = label;
ReturnToCallViewController *viewController = [ReturnToCallViewController new];
self.returnToCallViewController = viewController;
viewController.delegate = self;
window.rootViewController = viewController;
return window;
}
- (void)updateReturnToCallWindowLayout
{
OWSAssertIsOnMainThread();
CGRect statusBarFrame = UIApplication.sharedApplication.statusBarFrame;
CGFloat statusBarHeight = statusBarFrame.size.height;
CGRect windowFrame = self.rootWindow.bounds;
windowFrame.size.height = statusBarHeight + 20.f;
self.returnToCallWindow.frame = windowFrame;
self.returnToCallWindow.rootViewController.view.frame = windowFrame;
[self.returnToCallLabel sizeToFit];
CGRect labelFrame = self.returnToCallLabel.frame;
labelFrame.origin.x = floor(windowFrame.size.width - labelFrame.size.width);
self.returnToCallLabel.frame = labelFrame;
UIView *rootView = self.returnToCallWindow.rootViewController.view;
[rootView setNeedsLayout];
[rootView layoutIfNeeded];
for (UIView *subview in rootView.subviews) {
[subview setNeedsLayout];
[subview layoutIfNeeded];
}
}
- (UIWindow *)createCallViewWindow:(UIWindow *)rootWindow
{
OWSAssertIsOnMainThread();
@ -204,8 +184,8 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
UIViewController *viewController = [OWSWindowRootViewController new];
viewController.view.backgroundColor = [UIColor ows_materialBlueColor];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:viewController];
OWSNavigationController *navigationController =
[[OWSNavigationController alloc] initWithRootViewController:viewController];
navigationController.navigationBarHidden = YES;
OWSAssert(!self.callNavigationController);
self.callNavigationController = navigationController;
@ -226,6 +206,19 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
#pragma mark - Calls
- (void)setCallViewController:(nullable UIViewController *)callViewController
{
OWSAssertIsOnMainThread();
if (callViewController == _callViewController) {
return;
}
_callViewController = callViewController;
[NSNotificationCenter.defaultCenter postNotificationName:OWSWindowManagerCallDidChangeNotification object:nil];
}
- (void)startCall:(UIViewController *)callViewController
{
OWSAssertIsOnMainThread();
@ -233,12 +226,11 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
OWSAssert(!self.callViewController);
self.callViewController = callViewController;
// Attach callViewController to window.
[self.callNavigationController popToRootViewControllerAnimated:NO];
[self.callNavigationController pushViewController:callViewController animated:NO];
self.isCallViewActive = YES;
[self updateReturnToCallWindowLayout];
self.shouldShowCallView = YES;
[self ensureWindowState];
}
@ -257,7 +249,8 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
// Dettach callViewController from window.
[self.callNavigationController popToRootViewControllerAnimated:NO];
self.callViewController = nil;
self.isCallViewActive = NO;
self.shouldShowCallView = NO;
[self ensureWindowState];
}
@ -266,20 +259,20 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
{
OWSAssertIsOnMainThread();
OWSAssert(self.callViewController);
OWSAssert(self.isCallViewActive);
OWSAssert(self.shouldShowCallView);
self.isCallViewActive = NO;
self.shouldShowCallView = NO;
[self ensureWindowState];
}
- (void)returnToCallView
- (void)showCallView
{
OWSAssertIsOnMainThread();
OWSAssert(self.callViewController);
OWSAssert(!self.isCallViewActive);
OWSAssert(!self.shouldShowCallView);
self.isCallViewActive = YES;
self.shouldShowCallView = YES;
[self ensureWindowState];
}
@ -313,7 +306,7 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
[self ensureReturnToCallWindowHidden];
[self ensureCallViewWindowHidden];
[self ensureScreenBlockWindowShown];
} else if (self.callViewController && self.isCallViewActive) {
} else if (self.callViewController && self.shouldShowCallView) {
// Show Call View.
[self ensureRootWindowHidden];
@ -349,7 +342,6 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
// In the normal case, that means the SignalViewController will call `becomeFirstResponder`
// on the vc on top of its navigation stack.
[self.rootWindow makeKeyAndVisible];
}
- (void)ensureRootWindowHidden
@ -367,38 +359,26 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
{
OWSAssertIsOnMainThread();
if (self.returnToCallWindow.hidden) {
DDLogInfo(@"%@ showing 'return to call' window.", self.logTag);
[self.returnToCallLabel.layer removeAllAnimations];
self.returnToCallLabel.alpha = 1.f;
[UIView animateWithDuration:1.f
delay:0.f
options:(UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse
| UIViewAnimationOptionBeginFromCurrentState)
animations:^{
self.returnToCallLabel.alpha = 0.f;
}
completion:^(BOOL finished) {
self.returnToCallLabel.alpha = 1.f;
}];
if (!self.returnToCallWindow.hidden) {
return;
}
DDLogInfo(@"%@ showing 'return to call' window.", self.logTag);
self.returnToCallWindow.hidden = NO;
[self updateReturnToCallWindowLayout];
[self.returnToCallViewController startAnimating];
}
- (void)ensureReturnToCallWindowHidden
{
OWSAssertIsOnMainThread();
if (!self.returnToCallWindow.hidden) {
DDLogInfo(@"%@ hiding 'return to call' window.", self.logTag);
if (self.returnToCallWindow.hidden) {
return;
}
DDLogInfo(@"%@ hiding 'return to call' window.", self.logTag);
self.returnToCallWindow.hidden = YES;
[self.returnToCallLabel.layer removeAllAnimations];
[self.returnToCallViewController stopAnimating];
}
- (void)ensureCallViewWindowShown
@ -449,15 +429,11 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
self.screenBlockingWindow.windowLevel = UIWindowLevel_Background;
}
#pragma mark - Events
#pragma mark - ReturnToCallViewControllerDelegate
- (void)returnToCallWasTapped:(UIGestureRecognizer *)sender
- (void)returnToCallWasTapped:(ReturnToCallViewController *)viewController
{
if (sender.state != UIGestureRecognizerStateRecognized) {
return;
}
[self returnToCallView];
[self showCallView];
}
@end

@ -59,6 +59,8 @@ NSString *NSStringForUIApplicationState(UIApplicationState value);
- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle;
- (void)setStatusBarHidden:(BOOL)isHidden animated:(BOOL)isAnimated;
@property (nonatomic, readonly) CGFloat statusBarHeight;
// Returns the VC that should be used to present alerts, modals, etc.
- (nullable UIViewController *)frontmostViewController;

@ -26,7 +26,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
private var progressPoller: ProgressPoller?
var loadViewController: SAELoadViewController?
let shareViewNavigationController: UINavigationController = UINavigationController()
let shareViewNavigationController: OWSNavigationController = OWSNavigationController()
override open func loadView() {
super.loadView()

@ -135,6 +135,12 @@ NS_ASSUME_NONNULL_BEGIN
DDLogInfo(@"Ignoring request to show/hide status bar style since we're in an app extension");
}
- (CGFloat)statusBarHeight
{
OWSFail(@"%@ in %s unexpected for share extension", self.logTag, __PRETTY_FUNCTION__);
return 20;
}
- (BOOL)isInBackground
{
return self.isSAEInBackground;

Loading…
Cancel
Save