From 0346475170cce16601b4ec290f2e170cf25d795c Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Tue, 17 Jan 2017 14:19:28 +0300 Subject: [PATCH] [MAPSME-3445] [ios] Fixed bottom menu layout direction for RightToLeft languages. --- iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm index be1face039..aca71d1004 100644 --- a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm +++ b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm @@ -253,7 +253,7 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { { MWMBottomMenuLayout * cvLayout = (MWMBottomMenuLayout *)self.buttonsCollectionView.collectionViewLayout; - cvLayout.buttonsCount = MWMBottomMenuViewCellCount; + cvLayout.buttonsCount = [self collectionView:self.additionalButtons numberOfItemsInSection:0]; [self.additionalButtons reloadData]; [(MWMBottomMenuView *)self.view refreshLayout]; } @@ -303,7 +303,10 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { [collectionView dequeueReusableCellWithReuseIdentifier:isWideMenu ? kCollectionCelllandscape : kCollectionCellPortrait forIndexPath:indexPath]; - switch (indexPath.item) + NSInteger item = indexPath.item; + if (isInterfaceRightToLeft()) + item = [self collectionView:collectionView numberOfItemsInSection:indexPath.section] - item - 1; + switch (item) { case MWMBottomMenuViewCellAddPlace: { @@ -339,7 +342,6 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { badgeCount:0 isEnabled:YES]; break; - case MWMBottomMenuViewCellCount: break; } return cell; } @@ -359,7 +361,6 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { case MWMBottomMenuViewCellDownload: [self menuActionDownloadMaps]; break; case MWMBottomMenuViewCellSettings: [self menuActionOpenSettings]; break; case MWMBottomMenuViewCellShare: [self menuActionShareLocation]; break; - case MWMBottomMenuViewCellCount: break; } }