forked from organicmaps/organicmaps
Merge pull request #3932 from igrechuhin/MAPSME-1048
[ios] Fixed back button orientation for Arabic language.
This commit is contained in:
commit
ed5c7c83da
7 changed files with 36 additions and 10 deletions
|
@ -7,6 +7,7 @@
|
|||
#import "MWMRouter.h"
|
||||
#import "Statistics.h"
|
||||
#import "TimeUtils.h"
|
||||
#import "UIButton+Orientation.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
#import "UIFont+MapsMeFonts.h"
|
||||
|
||||
|
@ -14,6 +15,7 @@ static CGFloat constexpr kAdditionalHeight = 20.;
|
|||
|
||||
@interface MWMRoutePreview ()<MWMRoutePointCellDelegate, MWMCircularProgressProtocol>
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UIButton * backButton;
|
||||
@property(weak, nonatomic) IBOutlet UIView * pedestrian;
|
||||
@property(weak, nonatomic) IBOutlet UIView * vehicle;
|
||||
@property(weak, nonatomic) IBOutlet UIView * bicycle;
|
||||
|
@ -53,6 +55,8 @@ static CGFloat constexpr kAdditionalHeight = 20.;
|
|||
[self.collectionView registerNib:[UINib nibWithNibName:[MWMRoutePointCell className] bundle:nil]
|
||||
forCellWithReuseIdentifier:[MWMRoutePointCell className]];
|
||||
[self setupProgresses];
|
||||
|
||||
[self.backButton matchInterfaceOrientation];
|
||||
}
|
||||
|
||||
- (void)setupProgresses
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
|
@ -275,6 +275,7 @@
|
|||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<connections>
|
||||
<outlet property="arrowImageView" destination="y8P-JL-riK" id="rzP-ce-6f0"/>
|
||||
<outlet property="backButton" destination="wpf-tw-Coz" id="9nj-K5-pOR"/>
|
||||
<outlet property="bicycle" destination="FuO-c6-y9C" id="UR2-pF-Amb"/>
|
||||
<outlet property="collectionView" destination="DrK-vI-WkO" id="IRr-R5-WIS"/>
|
||||
<outlet property="contentView" destination="WqK-Yb-PmP" id="4ph-Dm-EFr"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
|
@ -345,6 +345,7 @@
|
|||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="arriveLabel" destination="oec-Ee-6ha" id="7Ep-ck-NSQ"/>
|
||||
<outlet property="backButton" destination="a4n-5I-PN3" id="42W-5B-Z8i"/>
|
||||
<outlet property="bicycle" destination="yiM-fM-sSS" id="pMf-6J-9Gd"/>
|
||||
<outlet property="collectionView" destination="TC0-58-PO9" id="Onv-Ld-JPp"/>
|
||||
<outlet property="completeImageView" destination="pQb-pb-L88" id="FAi-yN-HNc"/>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#import "Common.h"
|
||||
#import "UIButton+Orientation.h"
|
||||
#import "UIViewController+Navigation.h"
|
||||
|
||||
namespace
|
||||
|
@ -23,6 +24,7 @@ CGFloat constexpr kButtonExtraWidth = 16.0;
|
|||
CGSize const buttonSize = {image.size.width + kButtonExtraWidth, image.size.height};
|
||||
UIButton * button = [[UIButton alloc] initWithFrame:{{}, buttonSize}];
|
||||
[button setImage:image forState:UIControlStateNormal];
|
||||
[button matchInterfaceOrientation];
|
||||
[button addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];
|
||||
return [[UIBarButtonItem alloc] initWithCustomView:button];
|
||||
}
|
||||
|
@ -34,14 +36,7 @@ CGFloat constexpr kButtonExtraWidth = 16.0;
|
|||
|
||||
- (UIBarButtonItem *)backButton
|
||||
{
|
||||
UIImage * backImg = [UIImage imageNamed:@"ic_nav_bar_back"];
|
||||
if (isInterfaceRightToLeft())
|
||||
{
|
||||
backImg = [UIImage imageWithCGImage:backImg.CGImage
|
||||
scale:backImg.scale
|
||||
orientation:UIImageOrientationUpMirrored];
|
||||
}
|
||||
return [self buttonWithImage:backImg action:@selector(backTap)];
|
||||
return [self buttonWithImage:[UIImage imageNamed:@"ic_nav_bar_back"] action:@selector(backTap)];
|
||||
}
|
||||
|
||||
- (void)showBackButton
|
||||
|
|
|
@ -187,6 +187,8 @@
|
|||
3492CC121C6DF00E0057D8E8 /* (null) in Sources */ = {isa = PBXBuildFile; };
|
||||
3492CC131C6DF00F0057D8E8 /* (null) in Sources */ = {isa = PBXBuildFile; };
|
||||
3497A93A1B5CF8A900F51E55 /* MWMNavigationDashboardManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3497A9371B5CF8A900F51E55 /* MWMNavigationDashboardManager.mm */; };
|
||||
3499C6861D51D3A600A1048A /* UIButton+Orientation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3499C6851D51D3A600A1048A /* UIButton+Orientation.mm */; };
|
||||
3499C6871D51D3A700A1048A /* UIButton+Orientation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3499C6851D51D3A600A1048A /* UIButton+Orientation.mm */; };
|
||||
349A357A1B53D4C9009677EE /* MWMCircularProgress.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349A35761B53D4C9009677EE /* MWMCircularProgress.mm */; };
|
||||
349A357B1B53D4C9009677EE /* MWMCircularProgress.xib in Resources */ = {isa = PBXBuildFile; fileRef = 349A35771B53D4C9009677EE /* MWMCircularProgress.xib */; };
|
||||
349A357C1B53D4C9009677EE /* MWMCircularProgressView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349A35791B53D4C9009677EE /* MWMCircularProgressView.mm */; };
|
||||
|
@ -1062,6 +1064,8 @@
|
|||
34921F691BFA0CDC00737D6E /* MyTargetSDKCorp.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = MyTargetSDKCorp.framework; sourceTree = "<group>"; };
|
||||
3497A9361B5CF8A900F51E55 /* MWMNavigationDashboardManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMNavigationDashboardManager.h; sourceTree = "<group>"; };
|
||||
3497A9371B5CF8A900F51E55 /* MWMNavigationDashboardManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMNavigationDashboardManager.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
3499C6841D51D3A600A1048A /* UIButton+Orientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Orientation.h"; sourceTree = "<group>"; };
|
||||
3499C6851D51D3A600A1048A /* UIButton+Orientation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "UIButton+Orientation.mm"; sourceTree = "<group>"; };
|
||||
349A35751B53D4C9009677EE /* MWMCircularProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMCircularProgress.h; sourceTree = "<group>"; };
|
||||
349A35761B53D4C9009677EE /* MWMCircularProgress.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMCircularProgress.mm; sourceTree = "<group>"; };
|
||||
349A35771B53D4C9009677EE /* MWMCircularProgress.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMCircularProgress.xib; sourceTree = "<group>"; };
|
||||
|
@ -2541,6 +2545,8 @@
|
|||
342AD7711B53D32F00E0B997 /* UIView+RuntimeAttributes.mm */,
|
||||
342AD76D1B53D30C00E0B997 /* UIButton+RuntimeAttributes.h */,
|
||||
342AD76E1B53D30C00E0B997 /* UIButton+RuntimeAttributes.mm */,
|
||||
3499C6841D51D3A600A1048A /* UIButton+Orientation.h */,
|
||||
3499C6851D51D3A600A1048A /* UIButton+Orientation.mm */,
|
||||
F62F1D931C3281F1006CF38E /* UIImageView+Coloring.h */,
|
||||
F62F1D941C3281F1006CF38E /* UIImageView+Coloring.mm */,
|
||||
9747264218323080006B7CB7 /* UIKitCategories.h */,
|
||||
|
@ -3642,6 +3648,7 @@
|
|||
34E273251C73876500463965 /* MWMMigrationView.mm in Sources */,
|
||||
347FD87B1C60B2CE002FB65E /* MWMOpeningHoursDeleteScheduleTableViewCell.mm in Sources */,
|
||||
340C20E31C3E565600111D22 /* MWMCuisineEditorViewController.mm in Sources */,
|
||||
3499C6861D51D3A600A1048A /* UIButton+Orientation.mm in Sources */,
|
||||
34B82ADE1B84A4A000180497 /* MWMSearchCommonCell.mm in Sources */,
|
||||
F66A8FA81B09F052001B9C97 /* MWMiPhoneLandscapePlacePage.mm in Sources */,
|
||||
974386DD19373EA400FD5659 /* ToastView.mm in Sources */,
|
||||
|
@ -3866,6 +3873,7 @@
|
|||
F653CE191C71F62700A453F1 /* MWMAddPlaceNavigationBar.mm in Sources */,
|
||||
6741A9C91BF340DE002C974C /* ToastView.mm in Sources */,
|
||||
6741A9CA1BF340DE002C974C /* MWMAnimator.mm in Sources */,
|
||||
3499C6871D51D3A700A1048A /* UIButton+Orientation.mm in Sources */,
|
||||
6741A9CB1BF340DE002C974C /* MWMSearchContentView.mm in Sources */,
|
||||
347FD8781C60B2CE002FB65E /* MWMOpeningHoursDaysSelectorTableViewCell.mm in Sources */,
|
||||
342EE4121C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.mm in Sources */,
|
||||
|
|
5
iphone/Maps/UIButton+Orientation.h
Normal file
5
iphone/Maps/UIButton+Orientation.h
Normal file
|
@ -0,0 +1,5 @@
|
|||
@interface UIButton (Orientation)
|
||||
|
||||
- (void)matchInterfaceOrientation;
|
||||
|
||||
@end
|
12
iphone/Maps/UIButton+Orientation.mm
Normal file
12
iphone/Maps/UIButton+Orientation.mm
Normal file
|
@ -0,0 +1,12 @@
|
|||
#import "Common.h"
|
||||
#import "UIButton+Orientation.h"
|
||||
|
||||
@implementation UIButton (Orientation)
|
||||
|
||||
- (void)matchInterfaceOrientation
|
||||
{
|
||||
if (isInterfaceRightToLeft())
|
||||
self.imageView.transform = CGAffineTransformMakeScale(-1, 1);
|
||||
}
|
||||
|
||||
@end
|
Loading…
Add table
Reference in a new issue