From 58f434f68fb365c7c0e16a6cad21ac1cacf9b485 Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Wed, 3 Feb 2016 15:08:51 +0300 Subject: [PATCH] [ios] Added logging for night mode's change. --- iphone/Maps/MWMNightModeController.mm | 8 ++++++++ iphone/Maps/Statistics/StatisticsStrings.h | 1 + 2 files changed, 9 insertions(+) diff --git a/iphone/Maps/MWMNightModeController.mm b/iphone/Maps/MWMNightModeController.mm index 04a4c5a4f8..9a23d45bc7 100644 --- a/iphone/Maps/MWMNightModeController.mm +++ b/iphone/Maps/MWMNightModeController.mm @@ -1,6 +1,7 @@ #import "MapsAppDelegate.h" #import "MWMNightModeController.h" #import "SelectableCell.h" +#import "Statistics.h" #import "UIColor+MapsMeColor.h" #include "Framework.h" @@ -52,6 +53,7 @@ _selectedCell = cell; auto & f = GetFramework(); auto const style = f.GetMapStyle(); + NSString * statValue = nil; if ([cell isEqual:self.on]) { [MapsAppDelegate setAutoNightModeOff:YES]; @@ -60,6 +62,7 @@ f.SetMapStyle(MapStyleDark); [UIColor setNightMode:YES]; [self refresh]; + statValue = kStatOn; } else if ([cell isEqual:self.off]) { @@ -69,6 +72,7 @@ f.SetMapStyle(MapStyleClear); [UIColor setNightMode:NO]; [self refresh]; + statValue = kStatOff; } else if ([cell isEqual:self.autoSwitch]) { @@ -79,7 +83,11 @@ [UIColor setNightMode:NO]; f.SetMapStyle(MapStyleClear); [self refresh]; + statValue = kStatValue; } + + [[Statistics instance] logEvent:kStatNightMode + withParameters:@{kStatValue : statValue}]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath diff --git a/iphone/Maps/Statistics/StatisticsStrings.h b/iphone/Maps/Statistics/StatisticsStrings.h index ba041c78c5..20a56955ec 100644 --- a/iphone/Maps/Statistics/StatisticsStrings.h +++ b/iphone/Maps/Statistics/StatisticsStrings.h @@ -10,6 +10,7 @@ static NSString * const kStatAdd = @"Add"; static NSString * const kStatAlert = @"Alert"; static NSString * const kStatApplication = @"Application"; static NSString * const kStatApply = @"Apply"; +static NSString * const kStatAuto = @"Auto"; static NSString * const kStatBack = @"Back"; static NSString * const kStatBannerDescription = @"Banner description"; static NSString * const kStatBannerTitle = @"Banner title";