From da35b25e9804601b83687af108553865077aaa1b Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Mon, 11 Jan 2016 17:38:49 +0300 Subject: [PATCH] [ios] Review fixes (night mode). --- iphone/Maps/Categories/UIKitCategories.mm | 12 +++--------- .../MapViewControls/MWMMapViewControlsManager.h | 2 -- iphone/Maps/Classes/MapViewController.mm | 5 ----- iphone/Maps/UIColor+MapsMeColor.mm | 4 ++-- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/iphone/Maps/Categories/UIKitCategories.mm b/iphone/Maps/Categories/UIKitCategories.mm index fe6a7b6279..9bbd8b5601 100644 --- a/iphone/Maps/Categories/UIKitCategories.mm +++ b/iphone/Maps/Categories/UIKitCategories.mm @@ -225,9 +225,7 @@ - (void)refresh { [super refresh]; - UIColor * opposite = self.selectedBackgroundView.backgroundColor.opposite; - if (opposite) - self.selectedBackgroundView.backgroundColor = opposite; + [self.selectedBackgroundView refresh]; } @end @@ -305,11 +303,9 @@ - (void)refresh { - UIColor * oppositeBackground = self.backgroundColor.opposite; + [super refresh]; UIColor * oppositeText = self.textColor.opposite; UIColor * oppositeTint = self.tintColor.opposite; - if (oppositeBackground) - self.backgroundColor = oppositeBackground; if (oppositeText) self.textColor = oppositeText; if (oppositeTint) @@ -322,14 +318,12 @@ - (void)refresh { + [super refresh]; UIColor * oppositeText = self.textColor.opposite; - UIColor * oppositeBackground = self.backgroundColor.opposite; UILabel * placeholder = [self valueForKey:@"_placeholderLabel"]; UIColor * oppositePlaceholder = placeholder.textColor.opposite; if (oppositeText) self.textColor = oppositeText; - if (oppositeBackground) - self.backgroundColor = oppositeBackground; if (oppositePlaceholder) placeholder.textColor = oppositePlaceholder; } diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h index 5f22797af0..421a0d992d 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h @@ -19,8 +19,6 @@ - (instancetype)init __attribute__((unavailable("init is not available"))); - (instancetype)initWithParentController:(MapViewController *)controller; -- (void)onEnterForeground; - #pragma mark - Layout - (void)refreshLayout; diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 2f782138dd..f8d5ed53c8 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -392,11 +392,6 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction) return; // Notify about entering foreground (should be called on the first launch too). GetFramework().EnterForeground(); - - if (self.isViewLoaded && self.view.window) - { - [self.controlsManager onEnterForeground]; - } } - (void)viewWillAppear:(BOOL)animated diff --git a/iphone/Maps/UIColor+MapsMeColor.mm b/iphone/Maps/UIColor+MapsMeColor.mm index fbad0bb0af..7cde3157a1 100644 --- a/iphone/Maps/UIColor+MapsMeColor.mm +++ b/iphone/Maps/UIColor+MapsMeColor.mm @@ -41,10 +41,10 @@ NSDictionary * night = @"blackSecondaryText" : [UIColor colorWithWhite:1. alpha:alpha70], @"blackHintText" : [UIColor colorWithWhite:1. alpha:alpha30], @"blackDividers" : [UIColor colorWithWhite:1. alpha:alpha12], - @"white" : [UIColor colorWithRed:scaled(60) green:scaled(64) blue:scaled(68) alpha:alpha100], + @"white" : [UIColor colorWithRed:scaled(60.) green:scaled(64.) blue:scaled(68.) alpha:alpha100], @"whiteSecondaryText" : [UIColor colorWithWhite:1. alpha:alpha70], @"buttonDisabledBlueText" : [UIColor colorWithRed:scaled(255.) green:scaled(230.) blue:scaled(140.) alpha:alpha30], - @"alertBackground" : [UIColor colorWithRed:scaled(60) green:scaled(64) blue:68 alpha:alpha100] + @"alertBackground" : [UIColor colorWithRed:scaled(60.) green:scaled(64.) blue:scaled(68.) alpha:alpha100] }; NSDictionary * day =