Merge branch 'charlesmchen/messagesViewNavBar'

pull/1/head
Matthew Chen 8 years ago
commit 5cd1d17056

@ -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 */,

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "NavBarBackWhite@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "NavBarBackWhite@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "NavBarBackWhite@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "button_phone_white@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "button_phone_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "button_phone_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "button_settings_white@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "button_settings_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "button_settings_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "button_timer_white@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "button_timer_white@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "button_timer_white@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

@ -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>
@ -108,7 +109,9 @@ typedef enum : NSUInteger {
@property (nonatomic, strong) TSVideoAttachmentAdapter *currentMediaAdapter;
@property (nonatomic, retain) NSTimer *readTimer;
@property (nonatomic, strong) UILabel *navbarTitleLabel;
@property (nonatomic, strong) UIView *navigationBarTitleView;
@property (nonatomic, strong) UILabel *navigationBarTitleLabel;
@property (nonatomic, strong) UILabel *navigationBarSubtitleLabel;
@property (nonatomic, retain) UIButton *attachButton;
@property (nonatomic) CGFloat previousCollectionViewFrameWidth;
@ -281,11 +284,6 @@ typedef enum : NSUInteger {
}
}
- (void)didMoveToParentViewController:(UIViewController *)parent
{
[self setupTitleLabelGestureRecognizer];
}
- (void)registerCustomMessageNibs
{
[self.collectionView registerNib:[OWSCallCollectionViewCell nib]
@ -495,50 +493,165 @@ typedef enum : NSUInteger {
if (isGroupConversation && [navTitle length] == 0) {
navTitle = NSLocalizedString(@"NEW_GROUP_DEFAULT_TITLE", @"");
}
self.title = navTitle;
self.title = nil;
if ([navTitle isEqualToString:self.navigationBarTitleLabel.text]) {
return;
}
self.navigationBarTitleLabel.text = navTitle;
// Changing the title requires relayout of the nav bar contents.
OWSDisappearingMessagesConfiguration *configuration =
[OWSDisappearingMessagesConfiguration fetchObjectWithUniqueID:self.thread.uniqueId];
[self setBarButtonItemsForDisappearingMessagesConfiguration:configuration];
}
- (void)setBarButtonItemsForDisappearingMessagesConfiguration:
(OWSDisappearingMessagesConfiguration *)disappearingMessagesConfiguration
{
UIBarButtonItem *backItem = [self createOWSBackButton];
const CGFloat kTitleVSpacing = 0.f;
if (!self.navigationBarTitleView) {
self.navigationBarTitleView = [UIView new];
[self.navigationBarTitleView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(navigationTitleTapped:)]];
self.navigationBarTitleLabel = [UILabel new];
self.navigationBarTitleLabel.textColor = [UIColor whiteColor];
self.navigationBarTitleLabel.font = [UIFont ows_boldFontWithSize:18.f];
self.navigationBarTitleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[self.navigationBarTitleView addSubview:self.navigationBarTitleLabel];
self.navigationBarSubtitleLabel = [UILabel new];
self.navigationBarSubtitleLabel.textColor = [UIColor colorWithWhite:0.85f alpha:1.f];
self.navigationBarSubtitleLabel.font = [UIFont ows_boldFontWithSize:9.f];
self.navigationBarSubtitleLabel.text = NSLocalizedString(@"MESSAGES_VIEW_TITLE_SUBTITLE",
@"The subtitle for the messages view title indicates that the title can be tapped to access settings for this conversation.");
[self.navigationBarTitleView addSubview:self.navigationBarSubtitleLabel];
}
// We need to manually resize and position the title views;
// iOS AutoLayout doesn't work inside navigation bar items.
[self.navigationBarTitleLabel sizeToFit];
[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, 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.
int rightBarButtonItemCount = 0;
if ([self canCall]) {
rightBarButtonItemCount++;
}
if (disappearingMessagesConfiguration.isEnabled) {
rightBarButtonItemCount++;
}
CGFloat rightBarButtonSize = 0;
switch (rightBarButtonItemCount) {
case 0:
rightBarButtonSize = 65;
break;
case 1:
rightBarButtonSize = 100;
break;
default:
OWSAssert(0);
// In production, fall through to the largest defined case.
case 2:
rightBarButtonSize = 145;
break;
}
CGFloat maxTitleViewWidth = kShortScreenDimension - rightBarButtonSize;
const CGFloat titleViewWidth = MIN(maxTitleViewWidth,
MAX(self.navigationBarTitleLabel.frame.size.width,
self.navigationBarSubtitleLabel.frame.size.width));
self.navigationBarTitleView.frame = CGRectMake(0, 0,
titleViewWidth,
self.navigationBarTitleLabel.frame.size.height +
self.navigationBarSubtitleLabel.frame.size.height +
kTitleVSpacing);
self.navigationBarTitleLabel.frame = CGRectMake(0,
0,
titleViewWidth,
self.navigationBarTitleLabel.frame.size.height);
self.navigationBarSubtitleLabel.frame = CGRectMake(0,
self.navigationBarTitleView.frame.size.height - self.navigationBarSubtitleLabel.frame.size.height,
titleViewWidth,
self.navigationBarSubtitleLabel.frame.size.height);
self.navigationItem.leftBarButtonItems = @[
backItem,
[[UIBarButtonItem alloc] initWithCustomView:self.navigationBarTitleView],
];
if (self.userLeftGroup) {
self.navigationItem.rightBarButtonItems = @[];
return;
}
const CGFloat kBarButtonSize = 44;
NSMutableArray<UIBarButtonItem *> *barButtons = [NSMutableArray new];
if ([self canCall]) {
UIBarButtonItem *callButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"btnPhone--white"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(callAction)];
// We use UIButtons with [UIBarButtonItem initWithCustomView:...] instead of
// 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"];
[callButton setImage:image
forState:UIControlStateNormal];
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
// 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.5f);
imageEdgeInsets.top = round((kBarButtonSize - image.size.height) * 0.5f);
imageEdgeInsets.bottom = round(kBarButtonSize - (image.size.height + imageEdgeInsets.top));
callButton.imageEdgeInsets = imageEdgeInsets;
callButton.accessibilityLabel = NSLocalizedString(@"CALL_LABEL", "Accessibilty label for placing call button");
callButton.imageInsets = UIEdgeInsetsMake(0, -10, 0, 10);
[barButtons addObject:callButton];
} else if ([self.thread isGroupThread]) {
UIBarButtonItem *manageGroupButton =
[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"contact-options-action"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(didTapManageGroupButton:)];
// Hack to shrink button image
manageGroupButton.imageInsets = UIEdgeInsetsMake(10, 20, 10, 0);
manageGroupButton.accessibilityLabel = NSLocalizedString(@"GROUP_SETTINGS_LABEL", @"Accessibilty label for group settings");
[barButtons addObject:manageGroupButton];
[callButton addTarget:self
action:@selector(callAction:)
forControlEvents:UIControlEventTouchUpInside];
callButton.frame = CGRectMake(0, 0,
round(image.size.width + imageEdgeInsets.left + imageEdgeInsets.right),
round(image.size.height + imageEdgeInsets.top + imageEdgeInsets.bottom));
[barButtons addObject:[[UIBarButtonItem alloc] initWithCustomView:callButton]];
}
if (disappearingMessagesConfiguration.isEnabled) {
UIBarButtonItem *timerButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_timer"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(didTapTimerInNavbar)];
UIButton *timerButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *image = [UIImage imageNamed:@"button_timer_white"];
[timerButton setImage:image
forState:UIControlStateNormal];
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
// 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.5f);
imageEdgeInsets.top = round((kBarButtonSize - image.size.height) * 0.5f);
imageEdgeInsets.bottom = round(kBarButtonSize - (image.size.height + imageEdgeInsets.top));
timerButton.imageEdgeInsets = imageEdgeInsets;
timerButton.accessibilityLabel = NSLocalizedString(@"DISAPPEARING_MESSAGES_LABEL", @"Accessibility label for disappearing messages");
NSString *formatString = NSLocalizedString(@"DISAPPEARING_MESSAGES_HINT", @"Accessibility hint that contains current timeout information");
timerButton.accessibilityHint = [NSString stringWithFormat:formatString, [disappearingMessagesConfiguration durationString]];
[barButtons addObject:timerButton];
[timerButton addTarget:self
action:@selector(didTapTimerInNavbar:)
forControlEvents:UIControlEventTouchUpInside];
timerButton.frame = CGRectMake(0, 0,
round(image.size.width + imageEdgeInsets.left + imageEdgeInsets.right),
round(image.size.height + imageEdgeInsets.top + imageEdgeInsets.bottom));
[barButtons addObject:[[UIBarButtonItem alloc] initWithCustomView:timerButton]];
}
self.navigationItem.rightBarButtonItems = [barButtons copy];
}
@ -554,28 +667,6 @@ typedef enum : NSUInteger {
self.inputToolbar.maximumHeight = 300;
}
- (void)setupTitleLabelGestureRecognizer
{
// Called on load/unload, but we only want to init once.
if (self.navbarTitleLabel) {
return;
}
UILabel *navbarTitleLabel = [self findNavbarTitleLabel];
if (!navbarTitleLabel) {
DDLogError(@"%@ Unable to find navbar title label. Skipping gesture recognition", self.tag);
return;
}
self.navbarTitleLabel = navbarTitleLabel;
navbarTitleLabel.userInteractionEnabled = YES;
navbarTitleLabel.superview.userInteractionEnabled = YES;
UITapGestureRecognizer *titleTapRecognizer =
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapTitle)];
[navbarTitleLabel addGestureRecognizer:titleTapRecognizer];
}
- (nullable UILabel *)findNavbarTitleLabel
{
for (UIView *view in self.navigationController.navigationBar.subviews) {
@ -637,7 +728,7 @@ typedef enum : NSUInteger {
#pragma mark - Calls
- (void)callAction {
- (void)callAction:(id)sender {
OWSAssert([self.thread isKindOfClass:[TSContactThread class]]);
if (![self canCall]) {
@ -1129,13 +1220,7 @@ typedef enum : NSUInteger {
[self showConversationSettings];
}
- (void)didTapManageGroupButton:(id)sender
{
DDLogDebug(@"%@ Tapped options menu in navbar", self.tag);
[self showConversationSettings];
}
- (void)didTapTimerInNavbar
- (void)didTapTimerInNavbar:(id)sender
{
DDLogDebug(@"%@ Tapped timer in navbar", self.tag);
[self showConversationSettings];
@ -2316,6 +2401,14 @@ typedef enum : NSUInteger {
return @[];
}
#pragma mark - Event Handling
- (void)navigationTitleTapped:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) {
[self showConversationSettings];
}
}
#pragma mark - Logging
+ (NSString *)tag

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

@ -138,6 +138,44 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS
selector:@selector(handleDismissCallInterstitialNotification:)
name:[CallService dismissCallInterstitialNotificationName]
object:nil];
[self updateBarButtonItems];
}
- (void)updateBarButtonItems {
const CGFloat kBarButtonSize = 44;
if (YES) {
// We use UIButtons with [UIBarButtonItem initWithCustomView:...] instead of
// UIBarButtonItem in order to ensure that these buttons are spaced tightly.
// The contents of the navigation bar are cramped in this view.
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *image = [UIImage imageNamed:@"button_settings_white"];
[button setImage:image
forState:UIControlStateNormal];
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
// 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.5f);
imageEdgeInsets.top = round((kBarButtonSize - image.size.height) * 0.5f);
imageEdgeInsets.bottom = round(kBarButtonSize - (image.size.height + imageEdgeInsets.top));
button.imageEdgeInsets = imageEdgeInsets;
button.accessibilityLabel = NSLocalizedString(@"OPEN_SETTINGS_BUTTON", "Label for button which opens the settings UI");
[button addTarget:self
action:@selector(settingsButtonPressed:)
forControlEvents:UIControlEventTouchUpInside];
button.frame = CGRectMake(0, 0,
round(image.size.width + imageEdgeInsets.left + imageEdgeInsets.right),
round(image.size.height + imageEdgeInsets.top + imageEdgeInsets.bottom));
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
}
}
- (void)settingsButtonPressed:(id)sender {
[self performSegueWithIdentifier:@"ShowAppSettingsSegue" sender:sender];
}
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext

@ -250,9 +250,6 @@
/* Generic notice when message failed to send. */
"ERROR_DESCRIPTION_CLIENT_SENDING_FAILURE" = "Failed to send message.";
/* Error mesage indicating that message send is disabled due to prekey update failures */
"ERROR_DESCRIPTION_MESSAGE_SEND_DISABLED_PREKEY_UPDATE_FAILURES" = "ERROR_DESCRIPTION_MESSAGE_SEND_DISABLED_PREKEY_UPDATE_FAILURES";
/* Generic error used whenver Signal can't contact the server */
"ERROR_DESCRIPTION_NO_INTERNET" = "Signal was unable to connect to the internet. Please try from another WiFi network or use mobile data.";
@ -463,6 +460,9 @@
/* No comment provided by engineer. */
"MESSAGE_COMPOSEVIEW_TITLE" = "New Message";
/* The subtitle for the messages view title indicates that the title can be tapped to access settings for this conversation. */
"MESSAGES_VIEW_TITLE_SUBTITLE" = "Tap here for settings";
/* {{number of minutes}} embedded in strings, e.g. 'Alice updated disappearing messages expiration to {{5 minutes}}'. See other *_TIME_AMOUNT strings */
"MINUTES_TIME_AMOUNT" = "%u minutes";

Loading…
Cancel
Save