From 1d1a140d6b4a40e2e219717b3d70d9fbc192358b Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Fri, 30 Jan 2015 12:28:05 -1000 Subject: [PATCH] Addressing UI issues. - Makes sure that status bar is white on launch. - Dismisses keyboard before playing video. --- Signal/src/AppDelegate.m | 1 + .../src/view controllers/MessagesViewController.m | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 5c8f8bda1..42d32e493 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -304,6 +304,7 @@ static NSString* const kCallSegue = @"2.0_6.0_Call_Segue"; } -(void)setupAppearance { + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index 6bcab064d..15b0ace8a 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -759,7 +759,7 @@ typedef enum : NSUInteger { if ([attachment isKindOfClass:[TSAttachmentStream class]]) { TSAttachmentStream *attStream = (TSAttachmentStream*)attachment; FullImageViewController * vc = [[FullImageViewController alloc] initWithAttachment:attStream fromRect:convertedRect forInteraction:[self interactionAtIndexPath:indexPath]]; - + [vc presentFromViewController:self.navigationController]; } } else { @@ -781,6 +781,7 @@ typedef enum : NSUInteger { NSFileManager *fileManager = [NSFileManager defaultManager]; if([messageMedia isVideo]) { if ([fileManager fileExistsAtPath:[attStream.mediaURL path]]) { + [self dismissKeyBoard]; _videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:attStream.mediaURL]; [_videoPlayer prepareToPlay]; @@ -953,7 +954,7 @@ typedef enum : NSUInteger { #pragma mark Bubble User Actions - (void)handleUnsentMessageTap:(TSOutgoingMessage*)message{ - [self.inputToolbar.contentView.textView resignFirstResponder]; + [self dismissKeyBoard]; [DJWActionSheet showInView:self.parentViewController.view withTitle:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete" otherButtonTitles:@[@"Send again"] tapBlock:^(DJWActionSheet *actionSheet, NSInteger tappedButtonIndex) { if (tappedButtonIndex == actionSheet.cancelButtonIndex) { NSLog(@"User Cancelled"); @@ -983,7 +984,7 @@ typedef enum : NSUInteger { NSString *messageString = [NSString stringWithFormat:@"Do you want to accept %@'s new identity key: %@", _thread.name, newKeyFingerprint]; NSArray *actions = @[@"Accept new identity key", @"Copy new identity key to pasteboard"]; - [self.inputToolbar.contentView.textView resignFirstResponder]; + [self dismissKeyBoard]; [DJWActionSheet showInView:self.parentViewController.view withTitle:messageString cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete" otherButtonTitles:actions tapBlock:^(DJWActionSheet *actionSheet, NSInteger tappedButtonIndex) { if (tappedButtonIndex == actionSheet.cancelButtonIndex) { @@ -1406,7 +1407,7 @@ typedef enum : NSUInteger { -(void)didPressAccessoryButton:(UIButton *)sender { - [self.inputToolbar.contentView.textView resignFirstResponder]; + [self dismissKeyBoard]; UIView *presenter = self.parentViewController.view; @@ -1517,7 +1518,7 @@ typedef enum : NSUInteger { } - (IBAction)unwindGroupUpdated:(UIStoryboardSegue *)segue{ - [self.inputToolbar.contentView.textView resignFirstResponder]; + [self dismissKeyBoard]; NewGroupViewController *ngc = [segue sourceViewController]; TSGroupModel* newGroupModel = [ngc groupModel]; NSMutableArray* groupMemberIds = [[NSMutableArray alloc] initWithArray:newGroupModel.groupMemberIds]; @@ -1526,6 +1527,10 @@ typedef enum : NSUInteger { [self updateGroupModelTo:newGroupModel]; } +- (void)dismissKeyBoard { + [self.inputToolbar.contentView.textView resignFirstResponder]; +} + - (void)dealloc{ [[NSNotificationCenter defaultCenter] removeObserver:self]; }