From 9f13fa1056e5f282bd02f2caa1b5f4ea98f2864d Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Wed, 3 Aug 2016 14:05:11 +0300 Subject: [PATCH 1/2] [ios] Fixed arrows direction for Arabic language. --- .../Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm | 6 ++++++ iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm | 5 +++++ iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.xib | 5 +++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/PlacePage/Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/PlacePage/Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm index 6c2c4a41a2..0b811b52ea 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/PlacePage/Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/PlacePage/Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm @@ -3,6 +3,7 @@ #import "MWMPlacePageOpeningHoursDayView.h" #import "Statistics.h" #import "UIImageView+Coloring.h" +#import "Common.h" #include "3party/opening_hours/opening_hours.hpp" #include "editor/opening_hours_ui.hpp" @@ -73,6 +74,8 @@ WeekDayView getWeekDayView() self.expandImage.hidden = !delegate.forcedButton; self.expandImage.image = [UIImage imageNamed:@"ic_arrow_gray_right"]; self.expandImage.mwm_coloring = MWMImageColoringGray; + if (isInterfaceRightToLeft()) + self.expandImage.transform = CGAffineTransformMakeScale(-1, 1); NSAssert(info, @"Schedule can not be empty"); osmoh::OpeningHours oh(info.UTF8String); if (MakeTimeTableSet(oh, timeTableSet)) @@ -132,6 +135,9 @@ WeekDayView getWeekDayView() self.expandImage.image = [UIImage imageNamed:@"ic_arrow_gray_down"]; self.expandImage.mwm_coloring = MWMImageColoringGray; + if (isInterfaceRightToLeft()) + self.expandImage.transform = CGAffineTransformMakeScale(-1, 1); + if (self.isExpanded) [self addClosedDays]; } diff --git a/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm b/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm index 4456e54988..d5d1bbfccf 100644 --- a/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm +++ b/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm @@ -1,3 +1,4 @@ +#import "Common.h" #import "MWMEditorSelectTableViewCell.h" #import "UIColor+MapsMeColor.h" #import "UIImageView+Coloring.h" @@ -8,6 +9,7 @@ @property (weak, nonatomic) IBOutlet UILabel * label; @property (weak, nonatomic) IBOutlet NSLayoutConstraint * labelLeadingOffset; @property (weak, nonatomic) IBOutlet NSLayoutConstraint * labelTrailingOffset; +@property (weak, nonatomic) IBOutlet UIImageView * grayArrow; @property (weak, nonatomic) id delegate; @@ -35,6 +37,9 @@ self.label.textColor = [UIColor blackHintText]; } self.label.preferredMaxLayoutWidth = self.width - self.labelLeadingOffset.constant - self.labelTrailingOffset.constant; + + if (isInterfaceRightToLeft()) + self.grayArrow.transform = CGAffineTransformMakeScale(-1, 1); } - (IBAction)selectAction diff --git a/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.xib b/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.xib index 07861de724..719f0ea545 100644 --- a/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.xib +++ b/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.xib @@ -1,8 +1,8 @@ - + - + @@ -77,6 +77,7 @@ + From f4cc38b12cefdbb0890fe3884438834e90e84c05 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Wed, 3 Aug 2016 14:05:25 +0300 Subject: [PATCH 2/2] Clang-format. --- .../MWMPlacePageOpeningHoursCell.mm | 2 +- .../Editor/MWMEditorSelectTableViewCell.mm | 23 ++++++++----------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/PlacePage/Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/PlacePage/Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm index 0b811b52ea..2817f85955 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/PlacePage/Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/PlacePage/Cells/OpeningHours/MWMPlacePageOpeningHoursCell.mm @@ -1,9 +1,9 @@ #import "MWMPlacePageOpeningHoursCell.h" +#import "Common.h" #import "MWMOpeningHoursCommon.h" #import "MWMPlacePageOpeningHoursDayView.h" #import "Statistics.h" #import "UIImageView+Coloring.h" -#import "Common.h" #include "3party/opening_hours/opening_hours.hpp" #include "editor/opening_hours_ui.hpp" diff --git a/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm b/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm index d5d1bbfccf..2acebac520 100644 --- a/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm +++ b/iphone/Maps/Classes/Editor/MWMEditorSelectTableViewCell.mm @@ -1,17 +1,17 @@ -#import "Common.h" #import "MWMEditorSelectTableViewCell.h" +#import "Common.h" #import "UIColor+MapsMeColor.h" #import "UIImageView+Coloring.h" @interface MWMEditorSelectTableViewCell () -@property (weak, nonatomic) IBOutlet UIImageView * icon; -@property (weak, nonatomic) IBOutlet UILabel * label; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * labelLeadingOffset; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * labelTrailingOffset; -@property (weak, nonatomic) IBOutlet UIImageView * grayArrow; +@property(weak, nonatomic) IBOutlet UIImageView * icon; +@property(weak, nonatomic) IBOutlet UILabel * label; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * labelLeadingOffset; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * labelTrailingOffset; +@property(weak, nonatomic) IBOutlet UIImageView * grayArrow; -@property (weak, nonatomic) id delegate; +@property(weak, nonatomic) id delegate; @end @@ -36,15 +36,12 @@ self.label.text = placeholder; self.label.textColor = [UIColor blackHintText]; } - self.label.preferredMaxLayoutWidth = self.width - self.labelLeadingOffset.constant - self.labelTrailingOffset.constant; + self.label.preferredMaxLayoutWidth = + self.width - self.labelLeadingOffset.constant - self.labelTrailingOffset.constant; if (isInterfaceRightToLeft()) self.grayArrow.transform = CGAffineTransformMakeScale(-1, 1); } -- (IBAction)selectAction -{ - [self.delegate cellSelect:self]; -} - +- (IBAction)selectAction { [self.delegate cellSelect:self]; } @end