From a4093a5f7f399a13ead925d46250898128b35a02 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 17 Feb 2017 17:30:49 -0500 Subject: [PATCH] Respond to CR. // FREEBIE --- Signal.xcodeproj/project.pbxproj | 6 ++++ Signal/src/Storyboard/Main.storyboard | 2 +- Signal/src/util/UIViewController+OWS.h | 16 +++++++++ Signal/src/util/UIViewController+OWS.m | 35 +++++++++++++++++++ .../AboutTableViewController.m | 8 ++--- .../AdvancedSettingsTableViewController.m | 3 ++ .../FingerprintViewController.m | 7 ++-- .../MessageComposeTableViewController.m | 4 ++- .../view controllers/MessagesViewController.m | 20 +++++------ .../view controllers/NewGroupViewController.m | 4 ++- ...otificationSettingsOptionsViewController.m | 11 +++--- .../NotificationSettingsViewController.m | 9 ++--- ...SConversationSettingsTableViewController.m | 8 +++-- .../OWSLinkDeviceViewController.m | 7 +++- .../OWSLinkedDevicesTableViewController.m | 7 +++- .../PrivacySettingsTableViewController.m | 9 +++-- .../ShowGroupMembersViewController.m | 16 +++------ .../view controllers/SignalsViewController.m | 2 +- 18 files changed, 117 insertions(+), 57 deletions(-) create mode 100644 Signal/src/util/UIViewController+OWS.h create mode 100644 Signal/src/util/UIViewController+OWS.m diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 182b5b841..96ffbc4f9 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 340757C21E5602D6001F15DD /* AttachmentSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 340757C11E5602D6001F15DD /* AttachmentSharing.m */; }; 341BB7491DB727EE001E2975 /* JSQMediaItem+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 341BB7481DB727EE001E2975 /* JSQMediaItem+OWS.m */; }; + 344F2F671E57A932000D9322 /* UIViewController+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 344F2F661E57A932000D9322 /* UIViewController+OWS.m */; }; 34535D821E256BE9008A4747 /* UIView+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 34535D811E256BE9008A4747 /* UIView+OWS.m */; }; 348F3A4F1E4A533900750D44 /* CallInterstitialViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 348F3A4E1E4A533900750D44 /* CallInterstitialViewController.swift */; }; 34FD93701E3BD43A00109093 /* OWSAnyTouchGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 34FD936F1E3BD43A00109093 /* OWSAnyTouchGestureRecognizer.m */; }; @@ -604,6 +605,8 @@ 340757C11E5602D6001F15DD /* AttachmentSharing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AttachmentSharing.m; sourceTree = ""; }; 341BB7471DB727EE001E2975 /* JSQMediaItem+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JSQMediaItem+OWS.h"; sourceTree = ""; }; 341BB7481DB727EE001E2975 /* JSQMediaItem+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "JSQMediaItem+OWS.m"; sourceTree = ""; }; + 344F2F651E57A932000D9322 /* UIViewController+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+OWS.h"; path = "util/UIViewController+OWS.h"; sourceTree = ""; }; + 344F2F661E57A932000D9322 /* UIViewController+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+OWS.m"; path = "util/UIViewController+OWS.m"; sourceTree = ""; }; 34535D801E256BE9008A4747 /* UIView+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+OWS.h"; sourceTree = ""; }; 34535D811E256BE9008A4747 /* UIView+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+OWS.m"; sourceTree = ""; }; 348F3A4E1E4A533900750D44 /* CallInterstitialViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallInterstitialViewController.swift; sourceTree = ""; }; @@ -2651,6 +2654,8 @@ 34535D811E256BE9008A4747 /* UIView+OWS.m */, EF764C331DB67CC5000D9A87 /* UIViewController+CameraPermissions.h */, EF764C341DB67CC5000D9A87 /* UIViewController+CameraPermissions.m */, + 344F2F651E57A932000D9322 /* UIViewController+OWS.h */, + 344F2F661E57A932000D9322 /* UIViewController+OWS.m */, ); name = "UI Categories"; path = ..; @@ -3067,6 +3072,7 @@ 76EB060E18170B33006006FC /* DecayingSampleEstimator.m in Sources */, 340757C21E5602D6001F15DD /* AttachmentSharing.m in Sources */, 76EB05BA18170B33006006FC /* CommitPacket.m in Sources */, + 344F2F671E57A932000D9322 /* UIViewController+OWS.m in Sources */, 76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */, 76EB05FC18170B33006006FC /* CallConnectUtil_Server.m in Sources */, B6DA6B071B8A2F9A00CA6F98 /* AppStoreRating.m in Sources */, diff --git a/Signal/src/Storyboard/Main.storyboard b/Signal/src/Storyboard/Main.storyboard index f3bdf6918..d49ab2c5a 100644 --- a/Signal/src/Storyboard/Main.storyboard +++ b/Signal/src/Storyboard/Main.storyboard @@ -77,7 +77,7 @@ - + diff --git a/Signal/src/util/UIViewController+OWS.h b/Signal/src/util/UIViewController+OWS.h new file mode 100644 index 000000000..b95a4b48f --- /dev/null +++ b/Signal/src/util/UIViewController+OWS.h @@ -0,0 +1,16 @@ +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIViewController (OWS) + +- (UIBarButtonItem *)createOWSBackButton; +- (void)useOWSBackButton; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Signal/src/util/UIViewController+OWS.m b/Signal/src/util/UIViewController+OWS.m new file mode 100644 index 000000000..238e38afa --- /dev/null +++ b/Signal/src/util/UIViewController+OWS.m @@ -0,0 +1,35 @@ +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// + +#import "UIViewController+OWS.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation UIViewController (OWS) + +- (UIBarButtonItem *)createOWSBackButton +{ + UIImage *backImage = [UIImage imageNamed:@"NavBarBack"]; + OWSAssert(backImage); + UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:backImage + style:UIBarButtonItemStylePlain + target:self + action:@selector(backButtonPressed:)]; + return backItem; +} + +- (void)useOWSBackButton +{ + self.navigationItem.leftBarButtonItem = [self createOWSBackButton]; +} + +#pragma mark - Event Handling + +- (void)backButtonPressed:(id)sender { + [self.navigationController popViewControllerAnimated:YES]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/Signal/src/view controllers/AboutTableViewController.m b/Signal/src/view controllers/AboutTableViewController.m index d78b120ec..047fd5041 100644 --- a/Signal/src/view controllers/AboutTableViewController.m +++ b/Signal/src/view controllers/AboutTableViewController.m @@ -1,14 +1,11 @@ // -// AboutTableViewController.m -// Signal -// -// Created by Dylan Bourgeois on 05/01/15. -// Copyright (c) 2015 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import #import "AboutTableViewController.h" #import "UIUtil.h" +#import "UIViewController+OWS.h" @interface AboutTableViewController () @@ -36,6 +33,7 @@ typedef NS_ENUM(NSUInteger, AboutTableViewControllerSection) { - (void)viewDidLoad { [super viewDidLoad]; [self.navigationController.navigationBar setTranslucent:NO]; + [self useOWSBackButton]; self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; } diff --git a/Signal/src/view controllers/AdvancedSettingsTableViewController.m b/Signal/src/view controllers/AdvancedSettingsTableViewController.m index 6f8f0fa5f..467207ea5 100644 --- a/Signal/src/view controllers/AdvancedSettingsTableViewController.m +++ b/Signal/src/view controllers/AdvancedSettingsTableViewController.m @@ -10,6 +10,7 @@ #import "RPAccountManager.h" #import "Signal-Swift.h" #import "TSAccountManager.h" +#import "UIViewController+OWS.h" #import #import @@ -56,6 +57,8 @@ typedef NS_ENUM(NSInteger, AdvancedSettingsTableViewControllerSection) { self.title = NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @""); + [self useOWSBackButton]; + // WebRTC self.enableWebRTCCell = [[UITableViewCell alloc] init]; self.enableWebRTCCell.textLabel.text = NSLocalizedString(@"SETTINGS_ADVANCED_WEBRTC", diff --git a/Signal/src/view controllers/FingerprintViewController.m b/Signal/src/view controllers/FingerprintViewController.m index f3a1286b0..266684447 100644 --- a/Signal/src/view controllers/FingerprintViewController.m +++ b/Signal/src/view controllers/FingerprintViewController.m @@ -1,9 +1,5 @@ // -// FingerprintViewController.m -// Signal -// -// Created by Dylan Bourgeois on 02/11/14. -// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "FingerprintViewController.h" @@ -12,6 +8,7 @@ #import "Signal-Swift.h" #import "UIUtil.h" #import "UIViewController+CameraPermissions.h" +#import "UIViewController+OWS.h" #import #import #import diff --git a/Signal/src/view controllers/MessageComposeTableViewController.m b/Signal/src/view controllers/MessageComposeTableViewController.m index aea995462..b18d92c87 100644 --- a/Signal/src/view controllers/MessageComposeTableViewController.m +++ b/Signal/src/view controllers/MessageComposeTableViewController.m @@ -13,6 +13,7 @@ #import "Signal-Swift.h" #import "UIColor+OWS.h" #import "UIUtil.h" +#import "UIViewController+OWS.h" NS_ASSUME_NONNULL_BEGIN @@ -116,7 +117,8 @@ NSString *const MessageComposeTableViewControllerCellContact = @"ContactTableVie - (void)viewDidLoad { [super viewDidLoad]; [self.navigationController.navigationBar setTranslucent:NO]; - + [self useOWSBackButton]; + self.tableView.estimatedRowHeight = (CGFloat)60.0; self.tableView.rowHeight = UITableViewAutomaticDimension; diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index 44f3eb617..132f1f29b 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -37,6 +37,7 @@ #import "UIFont+OWS.h" #import "UIUtil.h" #import "UIViewController+CameraPermissions.h" +#import "UIViewController+OWS.h" #import #import #import @@ -509,10 +510,8 @@ typedef enum : NSUInteger { - (void)setBarButtonItemsForDisappearingMessagesConfiguration: (OWSDisappearingMessagesConfiguration *)disappearingMessagesConfiguration { - UIImage *backImage = [UIImage imageNamed:@"NavBarBack"]; - OWSAssert(backImage); - UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:backImage style:UIBarButtonItemStylePlain target:self action:@selector(backButtonPressed:)]; - + UIBarButtonItem *backItem = [self createOWSBackButton]; + const CGFloat kTitleVSpacing = 0.f; if (!self.navigationBarTitleView) { self.navigationBarTitleView = [UIView new]; @@ -539,8 +538,8 @@ typedef enum : NSUInteger { [self.navigationBarSubtitleLabel sizeToFit]; const CGFloat kShortScreenDimension = MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height); - // We want to leave space for the "back" button, the "timer" button, the "call" or - // "group settings" button, and all of the whitespace around these views. There + // We want to leave space for the "back" button, the "timer" button, and the "call" + // button, and all of the whitespace around these views. There // isn't a convenient way to calculate these in a navigation bar, so we just leave // a constant amount of space which will be safe unless Apple makes radical changes // to the appearance of the navigation bar. @@ -561,6 +560,7 @@ typedef enum : NSUInteger { break; default: OWSAssert(0); + // In production, fall through to the largest defined case. case 2: rightBarButtonSize = 145; break; @@ -610,7 +610,7 @@ typedef enum : NSUInteger { // too far apart and too far from the edge of the screen. So we use a smaller // right inset tighten up the layout. imageEdgeInsets.left = round((kBarButtonSize - image.size.width) * 0.5f); - imageEdgeInsets.right = round((kBarButtonSize - (image.size.width + imageEdgeInsets.left)) * 0.25f); + imageEdgeInsets.right = round((kBarButtonSize - (image.size.width + imageEdgeInsets.left)) * 0.5f); imageEdgeInsets.top = round((kBarButtonSize - image.size.height) * 0.5f); imageEdgeInsets.bottom = round(kBarButtonSize - (image.size.height + imageEdgeInsets.top)); callButton.imageEdgeInsets = imageEdgeInsets; @@ -636,7 +636,7 @@ typedef enum : NSUInteger { // too far apart and too far from the edge of the screen. So we use a smaller // right inset tighten up the layout. imageEdgeInsets.left = round((kBarButtonSize - image.size.width) * 0.5f); - imageEdgeInsets.right = round((kBarButtonSize - (image.size.width + imageEdgeInsets.left)) * 0.25f); + imageEdgeInsets.right = round((kBarButtonSize - (image.size.width + imageEdgeInsets.left)) * 0.5f); imageEdgeInsets.top = round((kBarButtonSize - image.size.height) * 0.5f); imageEdgeInsets.bottom = round(kBarButtonSize - (image.size.height + imageEdgeInsets.top)); timerButton.imageEdgeInsets = imageEdgeInsets; @@ -2403,10 +2403,6 @@ typedef enum : NSUInteger { #pragma mark - Event Handling -- (void)backButtonPressed:(id)sender { - [self.navigationController popViewControllerAnimated:YES]; -} - - (void)navigationTitleTapped:(UIGestureRecognizer *)gestureRecognizer { if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) { [self showConversationSettings]; diff --git a/Signal/src/view controllers/NewGroupViewController.m b/Signal/src/view controllers/NewGroupViewController.m index 4a8ac6fb8..6d1ec0504 100644 --- a/Signal/src/view controllers/NewGroupViewController.m +++ b/Signal/src/view controllers/NewGroupViewController.m @@ -12,6 +12,7 @@ #import "TSOutgoingMessage.h" #import "UIImage+normalizeImage.h" #import "UIUtil.h" +#import "UIViewController+OWS.h" #import #import #import @@ -100,7 +101,8 @@ static NSString *const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue" - (void)viewDidLoad { [super viewDidLoad]; [self.navigationController.navigationBar setTranslucent:NO]; - + [self useOWSBackButton]; + contacts = self.contactsManager.signalContacts; diff --git a/Signal/src/view controllers/NotificationSettingsOptionsViewController.m b/Signal/src/view controllers/NotificationSettingsOptionsViewController.m index eb9bb5f63..82c2292d2 100644 --- a/Signal/src/view controllers/NotificationSettingsOptionsViewController.m +++ b/Signal/src/view controllers/NotificationSettingsOptionsViewController.m @@ -1,17 +1,16 @@ // -// NotificationSettingsOptionsViewController.m -// Signal -// -// Created by Frederic Jacobs on 24/04/15. -// Copyright (c) 2015 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "NotificationSettingsOptionsViewController.h" #import "Environment.h" #import "PropertyListPreferences.h" +#import "UIViewController+OWS.h" @interface NotificationSettingsOptionsViewController () + @property NSArray *options; + @end @implementation NotificationSettingsOptionsViewController @@ -20,6 +19,8 @@ self.options = @[ @(NotificationNamePreview), @(NotificationNameNoPreview), @(NotificationNoNameNoPreview) ]; [super viewDidLoad]; + + [self useOWSBackButton]; } #pragma mark - Table view data source diff --git a/Signal/src/view controllers/NotificationSettingsViewController.m b/Signal/src/view controllers/NotificationSettingsViewController.m index d96ff3727..5669078c1 100644 --- a/Signal/src/view controllers/NotificationSettingsViewController.m +++ b/Signal/src/view controllers/NotificationSettingsViewController.m @@ -1,16 +1,12 @@ // -// NotificationPreviewViewController.m -// Signal -// -// Created by Frederic Jacobs on 09/12/14. -// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "NotificationSettingsViewController.h" - #import "Environment.h" #import "NotificationSettingsOptionsViewController.h" #import "PropertyListPreferences.h" +#import "UIViewController+OWS.h" #define kNotificationOptionSection 0 @@ -30,6 +26,7 @@ [super viewDidLoad]; [self setTitle:NSLocalizedString(@"SETTINGS_NOTIFICATIONS", nil)]; + [self useOWSBackButton]; self.notificationsSections = @[ NSLocalizedString(@"NOTIFICATIONS_SECTION_BACKGROUND", nil), diff --git a/Signal/src/view controllers/OWSConversationSettingsTableViewController.m b/Signal/src/view controllers/OWSConversationSettingsTableViewController.m index 61383f145..b5abbe19c 100644 --- a/Signal/src/view controllers/OWSConversationSettingsTableViewController.m +++ b/Signal/src/view controllers/OWSConversationSettingsTableViewController.m @@ -1,5 +1,6 @@ -// Created by Michael Kirk on 9/21/16. -// Copyright © 2016 Open Whisper Systems. All rights reserved. +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// #import "OWSConversationSettingsTableViewController.h" #import "Environment.h" @@ -11,6 +12,7 @@ #import "ShowGroupMembersViewController.h" #import "UIFont+OWS.h" #import "UIUtil.h" +#import "UIViewController+OWS.h" #import <25519/Curve25519.h> #import #import @@ -166,6 +168,8 @@ static NSString *const OWSConversationSettingsTableViewControllerSegueShowGroupM self.listGroupMembersCell.textLabel.text = NSLocalizedString(@"LIST_GROUP_MEMBERS_ACTION", @"table cell label in conversation settings"); + [self useOWSBackButton]; + self.toggleDisappearingMessagesCell.selectionStyle = UITableViewCellSelectionStyleNone; self.disappearingMessagesDurationCell.selectionStyle = UITableViewCellSelectionStyleNone; diff --git a/Signal/src/view controllers/OWSLinkDeviceViewController.m b/Signal/src/view controllers/OWSLinkDeviceViewController.m index a6e39b556..cafbe294c 100644 --- a/Signal/src/view controllers/OWSLinkDeviceViewController.m +++ b/Signal/src/view controllers/OWSLinkDeviceViewController.m @@ -1,9 +1,12 @@ -// Copyright © 2016 Open Whisper Systems. All rights reserved. +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// #import "OWSLinkDeviceViewController.h" #import "OWSDeviceProvisioningURLParser.h" #import "OWSLinkedDevicesTableViewController.h" #import "SettingsTableViewController.h" +#import "UIViewController+OWS.h" #import #import #import @@ -25,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN { [super viewDidLoad]; + [self useOWSBackButton]; + // HACK to get full width preview layer CGRect oldFrame = self.qrScanningView.frame; self.qrScanningView.frame = CGRectMake( diff --git a/Signal/src/view controllers/OWSLinkedDevicesTableViewController.m b/Signal/src/view controllers/OWSLinkedDevicesTableViewController.m index 8ec8e9986..858ba284f 100644 --- a/Signal/src/view controllers/OWSLinkedDevicesTableViewController.m +++ b/Signal/src/view controllers/OWSLinkedDevicesTableViewController.m @@ -1,9 +1,12 @@ -// Copyright © 2016 Open Whisper Systems. All rights reserved. +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// #import "OWSLinkedDevicesTableViewController.h" #import "OWSDeviceTableViewCell.h" #import "OWSLinkDeviceViewController.h" #import "UIViewController+CameraPermissions.h" +#import "UIViewController+OWS.h" #import #import #import @@ -38,6 +41,8 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1; [super viewDidLoad]; self.title = NSLocalizedString(@"LINKED_DEVICES_TITLE", @"Menu item and navbar title for the device manager"); + [self useOWSBackButton]; + self.isExpectingMoreDevices = NO; self.tableView.rowHeight = UITableViewAutomaticDimension; self.tableView.estimatedRowHeight = 70; diff --git a/Signal/src/view controllers/PrivacySettingsTableViewController.m b/Signal/src/view controllers/PrivacySettingsTableViewController.m index 5d89a8578..0313d9d02 100644 --- a/Signal/src/view controllers/PrivacySettingsTableViewController.m +++ b/Signal/src/view controllers/PrivacySettingsTableViewController.m @@ -1,9 +1,5 @@ // -// PrivacySettingsTableViewController.m -// Signal -// -// Created by Dylan Bourgeois on 05/01/15. -// Copyright (c) 2015 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "PrivacySettingsTableViewController.h" @@ -11,6 +7,7 @@ #import "Environment.h" #import "PropertyListPreferences.h" #import "UIUtil.h" +#import "UIViewController+OWS.h" #import <25519/Curve25519.h> NS_ASSUME_NONNULL_BEGIN @@ -49,6 +46,8 @@ typedef NS_ENUM(NSInteger, PrivacySettingsTableViewControllerSectionIndex) { self.title = NSLocalizedString(@"SETTINGS_PRIVACY_TITLE", @""); + [self useOWSBackButton]; + // Enable Screen Security Cell self.enableScreenSecurityCell = [[UITableViewCell alloc] init]; self.enableScreenSecurityCell.textLabel.text = NSLocalizedString(@"SETTINGS_SCREEN_SECURITY", @""); diff --git a/Signal/src/view controllers/ShowGroupMembersViewController.m b/Signal/src/view controllers/ShowGroupMembersViewController.m index 70c35c9b7..b2efc72bc 100644 --- a/Signal/src/view controllers/ShowGroupMembersViewController.m +++ b/Signal/src/view controllers/ShowGroupMembersViewController.m @@ -1,22 +1,14 @@ // -// ShowGroupMembersViewController.m -// Signal -// -// Created by Dylan Bourgeois on 13/11/14. -// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "ShowGroupMembersViewController.h" - - #import "SignalsViewController.h" - #import "OWSContactsManager.h" #import "Environment.h" #import "GroupContactsResult.h" - #import "UIUtil.h" - +#import "UIViewController+OWS.h" #import NS_ASSUME_NONNULL_BEGIN @@ -27,7 +19,7 @@ static NSString *const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue" @property GroupContactsResult *groupContacts; @property TSGroupThread *thread; -@property (nonatomic, readonly, strong) OWSContactsManager *_Nonnull contactsManager; +@property (nonatomic, readonly) OWSContactsManager *_Nonnull contactsManager; @end @@ -67,6 +59,8 @@ static NSString *const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue" self.title = _thread.groupModel.groupName; + [self useOWSBackButton]; + [self initializeTableView]; self.groupContacts = diff --git a/Signal/src/view controllers/SignalsViewController.m b/Signal/src/view controllers/SignalsViewController.m index 2a47f9dc5..708d18c64 100644 --- a/Signal/src/view controllers/SignalsViewController.m +++ b/Signal/src/view controllers/SignalsViewController.m @@ -159,7 +159,7 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS // too far apart and too far from the edge of the screen. So we use a smaller // left inset tighten up the layout. imageEdgeInsets.right = round((kBarButtonSize - image.size.width) * 0.5f); - imageEdgeInsets.left = round((kBarButtonSize - (image.size.width + imageEdgeInsets.right)) * 0.25f); + imageEdgeInsets.left = round((kBarButtonSize - (image.size.width + imageEdgeInsets.right)) * 0.5f); imageEdgeInsets.top = round((kBarButtonSize - image.size.height) * 0.5f); imageEdgeInsets.bottom = round(kBarButtonSize - (image.size.height + imageEdgeInsets.top)); button.imageEdgeInsets = imageEdgeInsets;