From a52771e2869b14d6578357330313042c35755045 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 13 Feb 2017 16:30:54 -0500 Subject: [PATCH] Respond to CR. // FREEBIE --- Signal/src/Signal-Bridging-Header.h | 2 +- Signal/src/UIView+OWS.h | 2 +- .../src/view controllers/FullImageViewController.m | 6 +++--- .../src/view controllers/MessagesViewController.m | 14 ++++++-------- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Signal/src/Signal-Bridging-Header.h b/Signal/src/Signal-Bridging-Header.h index 9dcf0dadb..55fadea30 100644 --- a/Signal/src/Signal-Bridging-Header.h +++ b/Signal/src/Signal-Bridging-Header.h @@ -18,7 +18,6 @@ #import "OWSWebRTCDataProtos.pb.h" #import "PhoneManager.h" #import "PropertyListPreferences.h" -#import "PureLayout.h" #import "PushManager.h" #import "RPAccountManager.h" #import "TSSocketManager.h" @@ -27,6 +26,7 @@ #import "UIUtil.h" #import "UIView+OWS.h" #import +#import #import #import #import diff --git a/Signal/src/UIView+OWS.h b/Signal/src/UIView+OWS.h index 2fa8a51ca..f885d1c44 100644 --- a/Signal/src/UIView+OWS.h +++ b/Signal/src/UIView+OWS.h @@ -2,7 +2,7 @@ // Copyright (c) 2017 Open Whisper Systems. All rights reserved. // -#import "PureLayout.h" +#import #import // A convenience method for doing responsive layout. Scales between two diff --git a/Signal/src/view controllers/FullImageViewController.m b/Signal/src/view controllers/FullImageViewController.m index 7cf124085..89b849053 100644 --- a/Signal/src/view controllers/FullImageViewController.m +++ b/Signal/src/view controllers/FullImageViewController.m @@ -195,9 +195,9 @@ #pragma mark - Gesture Recognizers - (void)imageDismissGesture:(UIGestureRecognizer *)sender { - if (sender.state == UIGestureRecognizerStateRecognized) { - [self dismiss]; - } + if (sender.state == UIGestureRecognizerStateRecognized) { + [self dismiss]; + } } - (void)longPressGesture:(UIGestureRecognizer *)sender { diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index 0d360281e..a18fade99 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -1238,10 +1238,6 @@ typedef enum : NSUInteger { _videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:attStream.mediaURL]; [_videoPlayer prepareToPlay]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(moviePlayBackDidFinish:) - name:MPMoviePlayerPlaybackDidFinishNotification - object:_videoPlayer]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerWillExitFullscreen:) name:MPMoviePlayerWillExitFullscreenNotification @@ -1389,16 +1385,18 @@ typedef enum : NSUInteger { } } -- (void)moviePlayBackDidFinish:(id)sender { - DDLogDebug(@"%@ %s", self.tag, __PRETTY_FUNCTION__); -} - +// There's more than one way to exit the fullscreen video playback. +// There's a done button, a "toggle fullscreen" button and I think +// there's some gestures too. These fire slightly different notifications. +// We want to hide & clean up the video player immediately in all of +// these cases. - (void)moviePlayerWillExitFullscreen:(id)sender { DDLogDebug(@"%@ %s", self.tag, __PRETTY_FUNCTION__); [self clearVideoPlayer]; } +// See comment on moviePlayerWillExitFullscreen: - (void)moviePlayerDidExitFullscreen:(id)sender { DDLogDebug(@"%@ %s", self.tag, __PRETTY_FUNCTION__);