diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.h b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.h index f907e6ae1..3116bce7e 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.h +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.h @@ -1,11 +1,13 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // #import "ConversationViewCell.h" NS_ASSUME_NONNULL_BEGIN +extern const CGFloat OWSMessageCellCornerRadius; + @interface OWSMessageCell : ConversationViewCell + (NSString *)cellReuseIdentifier; diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m index 2aedc8d45..9a59ce6e0 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m @@ -17,6 +17,9 @@ NS_ASSUME_NONNULL_BEGIN +// This approximates the curve of our message bubbles, which makes the animation feel a little smoother. +const CGFloat OWSMessageCellCornerRadius = 17; + @interface BubbleMaskingView : UIView @property (nonatomic) BOOL isOutgoing; diff --git a/Signal/src/ViewControllers/MediaDetailViewController.m b/Signal/src/ViewControllers/MediaDetailViewController.m index 6ef8f8c71..305a3e12e 100644 --- a/Signal/src/ViewControllers/MediaDetailViewController.m +++ b/Signal/src/ViewControllers/MediaDetailViewController.m @@ -6,6 +6,7 @@ #import "AttachmentSharing.h" #import "ConversationViewController.h" #import "ConversationViewItem.h" +#import "OWSMessageCell.h" #import "Signal-Swift.h" #import "TSAttachmentStream.h" #import "TSInteraction.h" @@ -44,9 +45,6 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - -// This approximates the curve of our message bubbles, which makes the animation feel a little smoother. -const CGFloat MediaDetailViewControllerMediaCornerRadius = 17; - @interface MediaDetailViewController () @property (nonatomic) UIScrollView *scrollView; @@ -716,9 +714,9 @@ const CGFloat MediaDetailViewControllerMediaCornerRadius = 17; // "zoomed" view's pre-presentation position. OWSAssert(self.scrollView.zoomScale == 1.0); [self.mediaView.superview layoutIfNeeded]; - - self.mediaView.layer.cornerRadius = MediaDetailViewControllerMediaCornerRadius; - + + self.mediaView.layer.cornerRadius = OWSMessageCellCornerRadius; + [viewController presentViewController:navController animated:NO completion:^{ @@ -737,8 +735,8 @@ const CGFloat MediaDetailViewControllerMediaCornerRadius = 17; // 2. Animate imageView from it's initial position, which should match where it was // in the presenting view to it's final position, front and center in this view. This // animation duration intentionally overlaps the previous - [UIView animateWithDuration:2.2 - delay:2.08 + [UIView animateWithDuration:0.2 + delay:0.08 options:UIViewAnimationOptionCurveEaseOut animations:^(void) { self.mediaView.layer.cornerRadius = 0; @@ -785,8 +783,8 @@ const CGFloat MediaDetailViewControllerMediaCornerRadius = 17; // Our zoomScale must == 1 in order for our initialMediaViewConstraints to align with the // "zoomed" view's pre-presentation position. self.scrollView.zoomScale = 1.0; - self.mediaView.layer.cornerRadius = MediaDetailViewControllerMediaCornerRadius; - + self.mediaView.layer.cornerRadius = OWSMessageCellCornerRadius; + // In case user has hidden bars, which changes background to black. self.view.backgroundColor = UIColor.whiteColor;