From 52574e0f2ae4bdfaadf4528bada2d75d797d59f4 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Thu, 4 Aug 2016 16:39:29 +0300 Subject: [PATCH] [ios] Fixed UITextView keyboard coloring. --- iphone/Common/RichTextVC.mm | 3 ++- .../RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm | 1 + iphone/Maps/Classes/Editor/MWMNoteCell.mm | 2 ++ .../OpeningHours/MWMOpeningHoursEditorViewController.mm | 2 ++ iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm | 1 + iphone/Maps/Classes/MWMPlacePageInfoCell.mm | 7 ++++++- 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/iphone/Common/RichTextVC.mm b/iphone/Common/RichTextVC.mm index 5a8a7a0df9..6fe4b6e08e 100644 --- a/iphone/Common/RichTextVC.mm +++ b/iphone/Common/RichTextVC.mm @@ -1,4 +1,4 @@ - +#import "UIColor+MapsMeColor.h" #import "RichTextVC.h" #import "UIFont+MapsMeFonts.h" @@ -39,6 +39,7 @@ _textView.textContainerInset = UIEdgeInsetsMake(10, 5, 10, 5); _textView.font = [UIFont regular16]; _textView.dataDetectorTypes = UIDataDetectorTypeLink; + _textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault; } return _textView; } diff --git a/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm b/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm index 1c93563407..21a4724c61 100644 --- a/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm @@ -34,6 +34,7 @@ static NSString * const kStatisticsEvent = @"Routing Disclaimer Alert"; attributes:@{NSFontAttributeName : UIFont.regular14, NSForegroundColorAttributeName : UIColor.blackSecondaryText}]; [alert.textView sizeToFit]; + alert.textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault; UIWindow * window = UIApplication.sharedApplication.keyWindow; CGFloat height; if (isIOS7) diff --git a/iphone/Maps/Classes/Editor/MWMNoteCell.mm b/iphone/Maps/Classes/Editor/MWMNoteCell.mm index d78787b72b..4fc4011bf1 100644 --- a/iphone/Maps/Classes/Editor/MWMNoteCell.mm +++ b/iphone/Maps/Classes/Editor/MWMNoteCell.mm @@ -1,3 +1,4 @@ +#import "UIColor+MapsMeColor.h" #import "MWMTextView.h" #import "MWMNoteCell.h" @@ -26,6 +27,7 @@ static void * kContext = &kContext; { self.delegate = delegate; self.textView.text = text; + self.textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault; self.textView.placeholder = placeholder; } diff --git a/iphone/Maps/Classes/Editor/OpeningHours/MWMOpeningHoursEditorViewController.mm b/iphone/Maps/Classes/Editor/OpeningHours/MWMOpeningHoursEditorViewController.mm index b8f3fd06e1..0bd9482a09 100644 --- a/iphone/Maps/Classes/Editor/OpeningHours/MWMOpeningHoursEditorViewController.mm +++ b/iphone/Maps/Classes/Editor/OpeningHours/MWMOpeningHoursEditorViewController.mm @@ -3,6 +3,7 @@ #import "MWMOpeningHoursModel.h" #import "MWMOpeningHoursSection.h" #import "MWMTextView.h" +#import "UIColor+MapsMeColor.h" extern NSDictionary * const kMWMOpeningHoursEditorTableCells = @{ @(MWMOpeningHoursEditorDaysSelectorCell) : @"MWMOpeningHoursDaysSelectorTableViewCell", @@ -72,6 +73,7 @@ extern NSDictionary * const kMWMOpeningHoursEditorTableCells = @{ - (void)configAdvancedEditor { [self.editorView setTextContainerInset:{.top = 12, .left = 10, .bottom = 12, .right = 10}]; + self.editorView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault; NSString * path = [[NSBundle mainBundle] pathForResource:@"opening_hours_how_to_edit" ofType:@"html"]; NSString * html = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil]; NSURL * baseURL = [NSURL fileURLWithPath:path]; diff --git a/iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm b/iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm index 0f1c2d9623..e8cf3e5d1d 100644 --- a/iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm +++ b/iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm @@ -57,6 +57,7 @@ void performRenderingInConcurrentQueue(TMWMVoidBlock block) { self.delegate = delegate; self.textView.width = width - 2 * kTextViewLeft; + self.textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault; BOOL const isEmpty = text.length == 0; if (isEmpty) [self configEmptyDescription]; diff --git a/iphone/Maps/Classes/MWMPlacePageInfoCell.mm b/iphone/Maps/Classes/MWMPlacePageInfoCell.mm index 93f72fe9ea..6f7d49e24e 100644 --- a/iphone/Maps/Classes/MWMPlacePageInfoCell.mm +++ b/iphone/Maps/Classes/MWMPlacePageInfoCell.mm @@ -6,6 +6,7 @@ #import "Statistics.h" #import "UIFont+MapsMeFonts.h" #import "UIImageView+Coloring.h" +#import "UIColor+MapsMeColor.h" #include "platform/settings.hpp" #include "platform/measurement_utils.hpp" @@ -29,7 +30,11 @@ { [super awakeFromNib]; if ([self.textContainer isKindOfClass:[UITextView class]]) - [(UITextView *)self.textContainer setTextContainerInset:{.top = 12}]; + { + UITextView * textView = (UITextView *)self.textContainer; + [textView setTextContainerInset:{.top = 12}]; + textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault; + } } - (void)configureWithType:(MWMPlacePageCellType)type info:(NSString *)info;