Respond to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent b1744c2b4a
commit a4093a5f7f

@ -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 = "<group>"; };
341BB7471DB727EE001E2975 /* JSQMediaItem+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JSQMediaItem+OWS.h"; sourceTree = "<group>"; };
341BB7481DB727EE001E2975 /* JSQMediaItem+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "JSQMediaItem+OWS.m"; sourceTree = "<group>"; };
344F2F651E57A932000D9322 /* UIViewController+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+OWS.h"; path = "util/UIViewController+OWS.h"; sourceTree = "<group>"; };
344F2F661E57A932000D9322 /* UIViewController+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+OWS.m"; path = "util/UIViewController+OWS.m"; sourceTree = "<group>"; };
34535D801E256BE9008A4747 /* UIView+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+OWS.h"; sourceTree = "<group>"; };
34535D811E256BE9008A4747 /* UIView+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+OWS.m"; sourceTree = "<group>"; };
348F3A4E1E4A533900750D44 /* CallInterstitialViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallInterstitialViewController.swift; sourceTree = "<group>"; };
@ -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 */,

@ -77,7 +77,7 @@
<inset key="imageInsets" minX="-10" minY="0.0" maxX="0.0" maxY="0.0"/>
<color key="tintColor" red="0.99987119436264038" green="0.99998223781585693" blue="0.99984109401702881" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<segue destination="u7y-N1-6Ba" kind="modal" id="0Mt-zV-9BX"/>
<segue destination="u7y-N1-6Ba" kind="modal" identifier="ShowAppSettingsSegue" id="0Mt-zV-9BX"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" systemItem="compose" id="Oft-fU-tf5">

@ -0,0 +1,16 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIViewController (OWS)
- (UIBarButtonItem *)createOWSBackButton;
- (void)useOWSBackButton;
@end
NS_ASSUME_NONNULL_END

@ -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

@ -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 <Social/Social.h>
#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];
}

@ -10,6 +10,7 @@
#import "RPAccountManager.h"
#import "Signal-Swift.h"
#import "TSAccountManager.h"
#import "UIViewController+OWS.h"
#import <PastelogKit/Pastelog.h>
#import <PromiseKit/AnyPromise.h>
@ -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",

@ -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 <SignalServiceKit/NSDate+millisecondTimeStamp.h>
#import <SignalServiceKit/OWSError.h>
#import <SignalServiceKit/OWSFingerprint.h>

@ -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;

@ -37,6 +37,7 @@
#import "UIFont+OWS.h"
#import "UIUtil.h"
#import "UIViewController+CameraPermissions.h"
#import "UIViewController+OWS.h"
#import <AddressBookUI/AddressBookUI.h>
#import <ContactsUI/CNContactViewController.h>
#import <JSQMessagesViewController/JSQMessagesBubbleImage.h>
@ -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];

@ -12,6 +12,7 @@
#import "TSOutgoingMessage.h"
#import "UIImage+normalizeImage.h"
#import "UIUtil.h"
#import "UIViewController+OWS.h"
#import <MobileCoreServices/UTCoreTypes.h>
#import <SignalServiceKit/MimeTypeUtil.h>
#import <SignalServiceKit/NSDate+millisecondTimeStamp.h>
@ -100,7 +101,8 @@ static NSString *const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue"
- (void)viewDidLoad {
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
[self useOWSBackButton];
contacts = self.contactsManager.signalContacts;

@ -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

@ -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),

@ -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 <SignalServiceKit/NSDate+millisecondTimeStamp.h>
#import <SignalServiceKit/OWSDisappearingConfigurationUpdateInfoMessage.h>
@ -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;

@ -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 <SignalServiceKit/ECKeyPair+OWSPrivateKey.h>
#import <SignalServiceKit/OWSDeviceProvisioner.h>
#import <SignalServiceKit/TSStorageManager+IdentityKeyStore.h>
@ -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(

@ -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 <SignalServiceKit/OWSDevice.h>
#import <SignalServiceKit/OWSDevicesService.h>
#import <SignalServiceKit/TSDatabaseView.h>
@ -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;

@ -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", @"");

@ -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 <AddressBookUI/AddressBookUI.h>
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 =

@ -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;

Loading…
Cancel
Save