From 6722500d85af46e7698b5e335f960db230f9511e Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Mon, 16 Jan 2017 16:19:20 +0300 Subject: [PATCH] [ios] Removed fake message from viral alert. --- .../CustomAlert/MWMEditorViralAlert.mm | 42 ++---------------- .../CustomAlert/MWMEditorViralAlert.xib | 44 +++++++++++-------- 2 files changed, 30 insertions(+), 56 deletions(-) diff --git a/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.mm b/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.mm index 9ec7c3c1f2..381c52104e 100644 --- a/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.mm @@ -5,20 +5,9 @@ #import "MWMEditorViralAlert.h" #import "Statistics.h" -#include "indexer/osm_editor.hpp" - -#include "std/array.hpp" - -namespace -{ - array const kMessages {{L(@"editor_done_dialog_1"), L(@"editor_done_dialog_2")}}; -} // namespace - @interface MWMEditorViralAlert () -@property (weak, nonatomic) IBOutlet UILabel * message; -@property (weak, nonatomic) IBOutlet UIButton * shareButton; -@property (nonatomic) int indexOfMessage; +@property(weak, nonatomic) IBOutlet UIButton * shareButton; @end @@ -26,27 +15,12 @@ namespace + (nonnull instancetype)alert { - MWMEditorViralAlert * alert = [[[NSBundle mainBundle] loadNibNamed:[self className] owner:nil options:nil] firstObject]; - alert.indexOfMessage = rand() % kMessages.size(); - NSString * message = kMessages[alert.indexOfMessage]; - if (alert.indexOfMessage == 1) - { - int const ratingValue = (rand() % 1000) + 1000; - message = [NSString stringWithFormat:message, ratingValue]; - } - alert.message.text = message; - NSMutableDictionary * info = [@{kStatValue : alert.statMessage} mutableCopy]; - NSString * un = osm_auth_ios::OSMUserName(); - if (un) - info[kStatOSMUserName] = un; - - [Statistics logEvent:kStatEditorSecondTimeShareShow withParameters:info]; - return alert; + return [[[NSBundle mainBundle] loadNibNamed:[self className] owner:nil options:nil] firstObject]; } - (IBAction)shareTap { - [Statistics logEvent:kStatEditorSecondTimeShareClick withParameters:@{kStatValue : self.statMessage}]; + [Statistics logEvent:kStatEditorSecondTimeShareClick]; [self close:^{ MWMActivityViewController * shareVC = [MWMActivityViewController shareControllerForEditorViral]; [shareVC presentInParentViewController:self.alertController.ownerViewController @@ -54,14 +28,6 @@ namespace }]; } -- (IBAction)cancelTap -{ - [self close:nil]; -} - -- (NSString *)statMessage -{ - return self.indexOfMessage ? @"change" : @"rating"; -} +- (IBAction)cancelTap { [self close:nil]; } @end diff --git a/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.xib b/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.xib index d617490d1f..7e3f81e1c5 100644 --- a/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.xib +++ b/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.xib @@ -1,24 +1,27 @@ - - + + + + + - + + - + HelveticaNeue-Medium - HelveticaNeue-Medium - + - + - + - + @@ -73,8 +77,8 @@ - - + + @@ -88,7 +92,7 @@ - + @@ -105,8 +109,8 @@ - - + + @@ -148,13 +152,12 @@ - + - @@ -164,4 +167,9 @@ + + + + +