diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h index fcc1b7f9d1..d4d89d4c08 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h @@ -6,6 +6,7 @@ #include "platform/location.hpp" @class MapViewController; +@class MWMPlacePageEntity; @interface MWMMapViewControlsManager : NSObject @@ -13,6 +14,7 @@ @property (nonatomic) BOOL zoomHidden; @property (nonatomic) MWMBottomMenuState menuState; @property (nonatomic, readonly) MWMNavigationDashboardState navigationState; +@property (nonatomic, readonly) MWMPlacePageEntity * placePageEntity; @property (nonatomic) BOOL searchHidden; - (instancetype)init __attribute__((unavailable("init is not available"))); diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index 227face609..e765262a72 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -5,6 +5,7 @@ #import "MWMBottomMenuViewController.h" #import "MWMButton.h" #import "MWMMapViewControlsManager.h" +#import "MWMPlacePageEntity.h" #import "MWMPlacePageViewManager.h" #import "MWMPlacePageViewManagerDelegate.h" #import "MWMRoutePreview.h" @@ -648,6 +649,11 @@ extern NSString * const kAlohalyticsTapEventKey; return self.navigationManager.state; } +- (MWMPlacePageEntity *)placePageEntity +{ + return self.placePageManager.entity; +} + - (BOOL)isDirectionViewShown { return self.placePageManager.isDirectionViewShown; diff --git a/iphone/Maps/Classes/MWMPlacePageViewManager.mm b/iphone/Maps/Classes/MWMPlacePageViewManager.mm index 97e719d537..eb91816251 100644 --- a/iphone/Maps/Classes/MWMPlacePageViewManager.mm +++ b/iphone/Maps/Classes/MWMPlacePageViewManager.mm @@ -1,20 +1,21 @@ #import "Common.h" #import "LocationManager.h" -#import "MapsAppDelegate.h" -#import "MWMActivityViewController.h" #import "MWMAPIBar.h" +#import "MWMActivityViewController.h" #import "MWMBasePlacePageView.h" #import "MWMDirectionView.h" #import "MWMFrameworkListener.h" -#import "MWMiPadPlacePage.h" -#import "MWMiPhoneLandscapePlacePage.h" -#import "MWMiPhonePortraitPlacePage.h" #import "MWMPlacePage.h" #import "MWMPlacePageActionBar.h" #import "MWMPlacePageEntity.h" #import "MWMPlacePageNavigationBar.h" #import "MWMPlacePageViewManager.h" #import "MWMPlacePageViewManagerDelegate.h" +#import "MWMiPadPlacePage.h" +#import "MWMiPhoneLandscapePlacePage.h" +#import "MWMiPhonePortraitPlacePage.h" +#import "MapViewController.h" +#import "MapsAppDelegate.h" #import "Statistics.h" #import "3party/Alohalytics/src/alohalytics_objc.h" @@ -282,8 +283,7 @@ typedef NS_ENUM(NSUInteger, MWMPlacePageManagerState) - (void)editPlace { - [[Statistics instance] logEvent:kStatEventName(kStatPlacePage, kStatEdit)]; - [self.ownerViewController performSegueWithIdentifier:@"Map2EditorSegue" sender:self.entity]; + [(MapViewController *)self.ownerViewController openEditor]; } - (void)addBookmark diff --git a/iphone/Maps/Classes/MWMSegue.h b/iphone/Maps/Classes/MWMSegue.h index 69798626a6..457a02da1e 100644 --- a/iphone/Maps/Classes/MWMSegue.h +++ b/iphone/Maps/Classes/MWMSegue.h @@ -1,3 +1,5 @@ @interface MWMSegue : UIStoryboardSegue ++ (void)segueFrom:(UIViewController *)source to:(UIViewController *)destination; + @end diff --git a/iphone/Maps/Classes/MWMSegue.mm b/iphone/Maps/Classes/MWMSegue.mm index d4e760a178..de7a3276c7 100644 --- a/iphone/Maps/Classes/MWMSegue.mm +++ b/iphone/Maps/Classes/MWMSegue.mm @@ -3,6 +3,11 @@ @implementation MWMSegue ++ (void)segueFrom:(UIViewController *)source to:(UIViewController *)destination +{ + [[[MWMSegue alloc] initWithIdentifier:@"" source:source destination:destination] perform]; +} + - (void)perform { UINavigationController * nc = self.sourceViewController.navigationController; diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapCountryDownloaderViewController.h b/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.h similarity index 76% rename from iphone/Maps/Classes/MapDownloader/MWMMapCountryDownloaderViewController.h rename to iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.h index eac97b9d42..128f8e87cd 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapCountryDownloaderViewController.h +++ b/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.h @@ -1,6 +1,8 @@ #import "MWMMapDownloaderTableViewCell.h" #import "MWMViewController.h" +#include "storage/index.hpp" + @interface MWMMapCountryDownloaderViewController : MWMViewController @property (weak, nonatomic) IBOutlet UILabel * allMapsLabel; @@ -12,4 +14,7 @@ - (void)configTable; - (void)configAllMapsView; +- (storage::TCountryId)GetRootCountryId; +- (void)SetRootCountryId:(storage::TCountryId)rootId; + @end diff --git a/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.mm b/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.mm new file mode 100644 index 0000000000..25aee6201b --- /dev/null +++ b/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.mm @@ -0,0 +1,465 @@ +#import "Common.h" +#import "MWMBaseMapDownloaderViewController.h" +#import "MWMMapDownloaderCountryTableViewCell.h" +#import "MWMMapDownloaderLargeCountryTableViewCell.h" +#import "MWMMapDownloaderPlaceTableViewCell.h" +#import "MWMMapDownloaderSubplaceTableViewCell.h" +#import "MWMMapDownloaderTableViewHeader.h" +#import "MWMSegue.h" +#import "UIColor+MapsMeColor.h" + +#include "Framework.h" + +namespace +{ +NSString * const kCountryCellIdentifier = @"MWMMapDownloaderCountryTableViewCell"; +NSString * const kLargeCountryCellIdentifier = @"MWMMapDownloaderLargeCountryTableViewCell"; +NSString * const kSubplaceCellIdentifier = @"MWMMapDownloaderSubplaceTableViewCell"; +NSString * const kPlaceCellIdentifier = @"MWMMapDownloaderPlaceTableViewCell"; +} // namespace + + +typedef void (^AlertActionType)(UIAlertAction *); + +@interface MWMBaseMapDownloaderViewController () + +@property (weak, nonatomic) IBOutlet UITableView * tableView; + +@property (weak, nonatomic) IBOutlet UIView * allMapsView; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * allMapsViewBottomOffset; + +@property (nonatomic) UIImage * navBarBackground; +@property (nonatomic) UIImage * navBarShadow; + +@property (nonatomic) CGFloat lastScrollOffset; + +@property (copy, nonatomic) AlertActionType downloadAction; +@property (copy, nonatomic) AlertActionType showAction; + +@property (copy, nonatomic) NSString * downloadActionTitle; +@property (copy, nonatomic) NSString * showActionTitle; +@property (copy, nonatomic) NSString * cancelActionTitle; + +@property (nonatomic) NSArray * indexes; +@property (nonatomic) NSDictionary *> * countryIds; + +@property (nonatomic, readonly) BOOL isParentRoot; + +@end + +using namespace storage; + +@implementation MWMBaseMapDownloaderViewController +{ + TCountryId m_rootId; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self configNavBar]; + [self configTable]; + [self configAllMapsView]; + [self configActions]; + [self configData]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + UINavigationBar * navBar = [UINavigationBar appearance]; + self.navBarBackground = [navBar backgroundImageForBarMetrics:UIBarMetricsDefault]; + self.navBarShadow = navBar.shadowImage; + UIColor * searchBarColor = [UIColor primary]; + [navBar setBackgroundImage:[UIImage imageWithColor:searchBarColor] + forBarMetrics:UIBarMetricsDefault]; + navBar.shadowImage = [UIImage imageWithColor:[UIColor clearColor]]; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + UINavigationBar * navBar = [UINavigationBar appearance]; + [navBar setBackgroundImage:self.navBarBackground forBarMetrics:UIBarMetricsDefault]; + navBar.shadowImage = self.navBarShadow; +} + +#pragma mark - Data + +- (void)configNavBar +{ + self.title = self.isParentRoot ? L(@"download_maps") : L(@([self GetRootCountryId].c_str())); +} + +- (void)configData +{ + auto const & s = GetFramework().Storage(); + TCountriesVec children; + s.GetChildren([self GetRootCountryId], children); + NSMutableSet * indexSet = [NSMutableSet setWithCapacity:children.size()]; + NSMutableDictionary *> * countryIds = [@{} mutableCopy]; + for (auto const & countryId : children) + { + NSString * nsCountryId = @(countryId.c_str()); + NSString * localizedName = L(nsCountryId).capitalizedString; + NSString * firstLetter = [localizedName substringToIndex:1]; + [indexSet addObject:firstLetter]; + + NSMutableArray * letterIds = [countryIds[firstLetter] mutableCopy]; + letterIds = letterIds ? letterIds : [@[] mutableCopy]; + [letterIds addObject:nsCountryId]; + countryIds[firstLetter] = [letterIds copy]; + } + auto sort = ^NSComparisonResult(NSString * s1, NSString * s2) + { + NSString * l1 = L(s1); + return [l1 compare:L(s2) options:NSCaseInsensitiveSearch range:{0, l1.length} locale:[NSLocale currentLocale]]; + }; + self.indexes = [[indexSet allObjects] sortedArrayUsingComparator:sort]; + [countryIds enumerateKeysAndObjectsUsingBlock:^(NSString * key, NSArray * obj, BOOL * stop) + { + countryIds[key] = [obj sortedArrayUsingComparator:sort]; + }]; + self.countryIds = countryIds; +} + +- (TCountryId)countryIdForIndexPath:(NSIndexPath *)indexPath +{ + NSString * firstLetter = self.indexes[indexPath.section]; + NSArray * countryIds = self.countryIds[firstLetter]; + NSString * nsCountryId = countryIds[indexPath.row]; + return nsCountryId.UTF8String; +} + +- (BOOL)isLastRowForIndexPath:(NSIndexPath *)indexPath +{ + NSString * firstLetter = self.indexes[indexPath.section]; + NSArray * countryIds = self.countryIds[firstLetter]; + BOOL const isLastSection = self.indexes.count - 1 == indexPath.section; + BOOL const isLastRow = countryIds.count - 1 == indexPath.row; + return self.isParentRoot ? isLastRow : isLastSection && isLastRow; +} + +#pragma mark - Table + +- (void)registerCellWithIdentifier:(NSString *)identifier +{ + [self.tableView registerNib:[UINib nibWithNibName:identifier bundle:nil] forCellReuseIdentifier:identifier]; +} + +- (void)configTable +{ + self.offscreenCells = [NSMutableDictionary dictionary]; + [self registerCellWithIdentifier:kPlaceCellIdentifier]; + [self registerCellWithIdentifier:kCountryCellIdentifier]; + [self registerCellWithIdentifier:kLargeCountryCellIdentifier]; + [self registerCellWithIdentifier:kSubplaceCellIdentifier]; +} + +- (NSString *)cellIdentifierForIndexPath:(NSIndexPath *)indexPath +{ + auto const & s = GetFramework().Storage(); + TCountriesVec children; + s.GetChildren([self countryIdForIndexPath:indexPath], children); + BOOL const haveChildren = !children.empty(); + if (haveChildren) + return kLargeCountryCellIdentifier; + return self.isParentRoot ? kCountryCellIdentifier : kPlaceCellIdentifier; +} + +#pragma mark - Offscreen cells + +- (MWMMapDownloaderTableViewCell *)offscreenCellForIdentifier:(NSString *)reuseIdentifier +{ + MWMMapDownloaderTableViewCell * cell = self.offscreenCells[reuseIdentifier]; + if (!cell) + { + cell = [[[NSBundle mainBundle] loadNibNamed:reuseIdentifier owner:nil options:nil] firstObject]; + self.offscreenCells[reuseIdentifier] = cell; + } + return cell; +} + +#pragma mark - UIScrollViewDelegate + +- (void)scrollViewWillEndDragging:(UIScrollView * _Nonnull)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint * _Nonnull)targetContentOffset +{ + SEL const selector = @selector(refreshAllMapsView); + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:selector object:nil]; + [self refreshAllMapsViewForOffset:targetContentOffset->y]; +} + +- (void)scrollViewDidScroll:(UIScrollView * _Nonnull)scrollView +{ + SEL const selector = @selector(refreshAllMapsView); + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:selector object:nil]; + [self performSelector:selector withObject:nil afterDelay:kDefaultAnimationDuration]; +} + +#pragma mark - All Maps Action + +- (void)configAllMapsView +{ +// TODO (igrechuhin) Add implementation + self.allMapsLabel.text = @"14 Maps (291 MB)"; + self.showAllMapsView = YES; +} + +- (void)refreshAllMapsView +{ + [self refreshAllMapsViewForOffset:self.tableView.contentOffset.y]; +} + +- (void)refreshAllMapsViewForOffset:(CGFloat)scrollOffset +{ + if (!self.showAllMapsView) + return; + BOOL const hide = (scrollOffset >= self.lastScrollOffset) && !equalScreenDimensions(scrollOffset, 0.0); + self.lastScrollOffset = scrollOffset; + if (self.allMapsView.hidden == hide) + return; + if (!hide) + self.allMapsView.hidden = hide; + [self.view layoutIfNeeded]; + self.allMapsViewBottomOffset.constant = hide ? self.allMapsView.height : 0.0; + [UIView animateWithDuration:kDefaultAnimationDuration animations:^ + { + self.allMapsView.alpha = hide ? 0.0 : 1.0; + [self.view layoutIfNeeded]; + } + completion:^(BOOL finished) + { + if (hide) + self.allMapsView.hidden = hide; + }]; +} + +- (IBAction)allMapsAction +{ + // TODO (igrechuhin) Add implementation +} + +#pragma mark - Fill cells with data + +- (void)fillCell:(MWMMapDownloaderTableViewCell * _Nonnull)cell atIndexPath:(NSIndexPath * _Nonnull)indexPath +{ + auto const & s = GetFramework().Storage(); + NodeAttrs nodeAttrs; + TCountryId countryId = [self countryIdForIndexPath:indexPath]; + s.GetNodeAttrs(countryId, nodeAttrs); + [cell setTitleText:@(nodeAttrs.m_nodeLocalName.c_str())]; + [cell setDownloadSizeText:formattedSize(nodeAttrs.m_mwmSize)]; + [cell setLastCell:[self isLastRowForIndexPath:indexPath]]; + + if ([cell isKindOfClass:[MWMMapDownloaderLargeCountryTableViewCell class]]) + { + MWMMapDownloaderLargeCountryTableViewCell * tCell = (MWMMapDownloaderLargeCountryTableViewCell *)cell; + [tCell setMapCountText:@(nodeAttrs.m_mwmCounter).stringValue]; + } + else if ([cell isKindOfClass:[MWMMapDownloaderPlaceTableViewCell class]]) + { + MWMMapDownloaderPlaceTableViewCell * tCell = (MWMMapDownloaderPlaceTableViewCell *)cell; + NSString * areaText = self.isParentRoot ? @(nodeAttrs.m_parentLocalName.c_str()) : @""; + [tCell setAreaText:areaText]; + } + else if ([cell isKindOfClass:[MWMMapDownloaderSubplaceTableViewCell class]]) + { +// TODO (igrechuhin) Add implementation +// MWMMapDownloaderSubplaceTableViewCell * tCell = (MWMMapDownloaderSubplaceTableViewCell *)cell; +// tCell.title.text = data[kCellTitle]; +// tCell.downloadSize.text = data[kCellDownloadSize]; +// tCell.area.text = data[kCellArea]; +// tCell.subPlace.text = data[kCellSubplace]; +// tCell.separator.hidden = isLastCellInSection; + } +} + +#pragma mark - UITableViewDataSource + +- (UITableViewCell * _Nonnull)tableView:(UITableView * _Nonnull)tableView cellForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath +{ + NSString * reuseIdentifier = [self cellIdentifierForIndexPath:indexPath]; + return [tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView * _Nonnull)tableView +{ + return self.indexes.count; +} + +- (NSInteger)tableView:(UITableView * _Nonnull)tableView numberOfRowsInSection:(NSInteger)section +{ + NSString * firstLetter = self.indexes[section]; + return self.countryIds[firstLetter].count; +} + +- (NSArray * _Nullable)sectionIndexTitlesForTableView:(UITableView * _Nonnull)tableView +{ + return self.isParentRoot ? self.indexes : nil; +} + +- (NSInteger)tableView:(UITableView * _Nonnull)tableView sectionForSectionIndexTitle:(NSString * _Nonnull)title atIndex:(NSInteger)index +{ + return index; +} + +#pragma mark - UITableViewDelegate + +- (UIView * _Nullable)tableView:(UITableView * _Nonnull)tableView viewForHeaderInSection:(NSInteger)section +{ + if (!self.isParentRoot) + return nil; + MWMMapDownloaderTableViewHeader * headerView = + [[[NSBundle mainBundle] loadNibNamed:@"MWMMapDownloaderTableViewHeader" + owner:nil + options:nil] firstObject]; + headerView.lastSection = (section == tableView.numberOfSections - 1); + headerView.title.text = self.indexes[section]; + return headerView; +} + +- (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForHeaderInSection:(NSInteger)section +{ + return self.isParentRoot ? [MWMMapDownloaderTableViewHeader height] : 0.0; +} + +- (void)tableView:(UITableView * _Nonnull)tableView didSelectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + NSString * identifier = [self cellIdentifierForIndexPath:indexPath]; + if ([identifier isEqualToString:kLargeCountryCellIdentifier]) + { + MWMBaseMapDownloaderViewController * vc = [self.storyboard instantiateViewControllerWithIdentifier:@"MWMBaseMapDownloaderViewController"]; + [vc SetRootCountryId:[self countryIdForIndexPath:indexPath]]; + [MWMSegue segueFrom:self to:vc]; + } + else + { +// TODO (igrechuhin) Add implementation +// NSString * title = @"Alessandria"; +// NSString * message = @"Italy, Piemont"; +// NSString * downloadActionTitle = [self.downloadActionTitle stringByAppendingString:@", 38 MB"]; +// if (isIOSVersionLessThan(8)) +// { +// UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:message +// delegate:self +// cancelButtonTitle:nil +// destructiveButtonTitle:nil +// otherButtonTitles:nil]; +// [actionSheet addButtonWithTitle:downloadActionTitle]; +// [actionSheet addButtonWithTitle:self.showActionTitle]; +// if (!IPAD) +// { +// [actionSheet addButtonWithTitle:self.cancelActionTitle]; +// actionSheet.cancelButtonIndex = actionSheet.numberOfButtons - 1; +// } +// UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath]; +// [actionSheet showFromRect:cell.frame inView:cell.superview animated:YES]; +// } +// else +// { +// UIAlertController * alertController = +// [UIAlertController alertControllerWithTitle:title +// message:message +// preferredStyle:UIAlertControllerStyleActionSheet]; +// UIAlertAction * downloadAction = [UIAlertAction actionWithTitle:downloadActionTitle +// style:UIAlertActionStyleDefault +// handler:self.downloadAction]; +// UIAlertAction * showAction = [UIAlertAction actionWithTitle:self.showActionTitle +// style:UIAlertActionStyleDefault +// handler:self.showAction]; +// UIAlertAction * cancelAction = [UIAlertAction actionWithTitle:self.cancelActionTitle +// style:UIAlertActionStyleCancel +// handler:nil]; +// [alertController addAction:downloadAction]; +// [alertController addAction:showAction]; +// [alertController addAction:cancelAction]; +// [self presentViewController:alertController animated:YES completion:nil]; +// } + } +} + +- (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath +{ + NSString * reuseIdentifier = [self cellIdentifierForIndexPath:indexPath]; + MWMMapDownloaderTableViewCell * cell = [self offscreenCellForIdentifier:reuseIdentifier]; + [self fillCell:cell atIndexPath:indexPath]; + [cell setNeedsUpdateConstraints]; + [cell updateConstraintsIfNeeded]; + cell.bounds = {{}, {CGRectGetWidth(tableView.bounds), CGRectGetHeight(cell.bounds)}}; + [cell setNeedsLayout]; + [cell layoutIfNeeded]; + CGSize const size = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; + return size.height; +} + +- (CGFloat)tableView:(UITableView * _Nonnull)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath +{ + NSString * reuseIdentifier = [self cellIdentifierForIndexPath:indexPath]; + MWMMapDownloaderTableViewCell * cell = [self offscreenCellForIdentifier:reuseIdentifier]; + return cell.estimatedHeight; +} + +- (void)tableView:(UITableView * _Nonnull)tableView willDisplayCell:(MWMMapDownloaderTableViewCell * _Nonnull)cell forRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath +{ + [self fillCell:cell atIndexPath:indexPath]; +} + +#pragma mark - UIActionSheetDelegate + +- (void)actionSheet:(UIActionSheet * _Nonnull)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex +{ + NSString * btnTitle = [actionSheet buttonTitleAtIndex:buttonIndex]; + if ([btnTitle hasPrefix:self.downloadActionTitle]) + self.downloadAction(nil); + else if ([btnTitle isEqualToString:self.showActionTitle]) + self.showAction(nil); +} + +#pragma mark - Action Sheet actions + +- (void)configActions +{ + self.downloadAction = ^(UIAlertAction * action) + { + // TODO (igrechuhin) Add implementation + }; + + self.showAction = ^(UIAlertAction * action) + { + // TODO (igrechuhin) Add implementation + }; + + self.downloadActionTitle = L(@"downloader_download_map"); + self.showActionTitle = L(@"zoom_to_country"); + self.cancelActionTitle = L(@"cancel"); +} + +#pragma mark - Managing the Status Bar + +- (UIStatusBarStyle)preferredStatusBarStyle +{ + return UIStatusBarStyleLightContent; +} + +#pragma mark - Properties + +- (void)setShowAllMapsView:(BOOL)showAllMapsView +{ + _showAllMapsView = showAllMapsView; + self.allMapsView.hidden = !showAllMapsView; +} + +- (TCountryId)GetRootCountryId +{ + return m_rootId; +} + +- (void)SetRootCountryId:(TCountryId)rootId +{ + m_rootId = rootId; + _isParentRoot = (m_rootId == GetFramework().Storage().GetRootId()); +} + + +@end diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapCountryDownloaderViewController.mm b/iphone/Maps/Classes/MapDownloader/MWMMapCountryDownloaderViewController.mm deleted file mode 100644 index 50885b1ce9..0000000000 --- a/iphone/Maps/Classes/MapDownloader/MWMMapCountryDownloaderViewController.mm +++ /dev/null @@ -1,278 +0,0 @@ -#import "Common.h" -#import "MWMMapCountryDownloaderViewController.h" -#import "UIColor+MapsMeColor.h" - -extern NSString * const kPlaceCellIdentifier = @"MWMMapDownloaderPlaceTableViewCell"; - -typedef void (^AlertActionType)(UIAlertAction *); - -@interface MWMMapCountryDownloaderViewController () - -@property (weak, nonatomic) IBOutlet UITableView * tableView; - -@property (weak, nonatomic) IBOutlet UIView * allMapsView; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * allMapsViewBottomOffset; - -@property (nonatomic) UIImage * navBarBackground; -@property (nonatomic) UIImage * navBarShadow; - -@property (nonatomic) CGFloat lastScrollOffset; - -@property (copy, nonatomic) AlertActionType downloadAction; -@property (copy, nonatomic) AlertActionType showAction; - -@property (copy, nonatomic) NSString * downloadActionTitle; -@property (copy, nonatomic) NSString * showActionTitle; -@property (copy, nonatomic) NSString * cancelActionTitle; - -@end - -@implementation MWMMapCountryDownloaderViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - [self configTable]; - [self configAllMapsView]; - [self configActions]; -} - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - UINavigationBar * navBar = [UINavigationBar appearance]; - self.navBarBackground = [navBar backgroundImageForBarMetrics:UIBarMetricsDefault]; - self.navBarShadow = navBar.shadowImage; - UIColor * searchBarColor = [UIColor primary]; - [navBar setBackgroundImage:[UIImage imageWithColor:searchBarColor] - forBarMetrics:UIBarMetricsDefault]; - navBar.shadowImage = [UIImage imageWithColor:[UIColor clearColor]]; -} - -- (void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; - UINavigationBar * navBar = [UINavigationBar appearance]; - [navBar setBackgroundImage:self.navBarBackground forBarMetrics:UIBarMetricsDefault]; - navBar.shadowImage = self.navBarShadow; -} - -#pragma mark - Table - -- (void)configTable -{ - self.offscreenCells = [NSMutableDictionary dictionary]; - [self.tableView registerNib:[UINib nibWithNibName:kPlaceCellIdentifier bundle:nil] forCellReuseIdentifier:kPlaceCellIdentifier]; -} - -- (NSString *)cellIdentifierForIndexPath:(NSIndexPath *)indexPath -{ - return kPlaceCellIdentifier; -} - -#pragma mark - Offscreen cells - -- (MWMMapDownloaderTableViewCell *)offscreenCellForIdentifier:(NSString *)reuseIdentifier -{ - MWMMapDownloaderTableViewCell * cell = self.offscreenCells[reuseIdentifier]; - if (!cell) - { - cell = [[[NSBundle mainBundle] loadNibNamed:reuseIdentifier owner:nil options:nil] firstObject]; - self.offscreenCells[reuseIdentifier] = cell; - } - return cell; -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewWillEndDragging:(UIScrollView * _Nonnull)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint * _Nonnull)targetContentOffset -{ - SEL const selector = @selector(refreshAllMapsView); - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:selector object:nil]; - [self refreshAllMapsViewForOffset:targetContentOffset->y]; -} - -- (void)scrollViewDidScroll:(UIScrollView * _Nonnull)scrollView -{ - SEL const selector = @selector(refreshAllMapsView); - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:selector object:nil]; - [self performSelector:selector withObject:nil afterDelay:kDefaultAnimationDuration]; -} - -#pragma mark - All Maps Action - -- (void)configAllMapsView -{ - self.allMapsLabel.text = @"14 Maps (291 MB)"; - self.showAllMapsView = YES; -} - -- (void)refreshAllMapsView -{ - [self refreshAllMapsViewForOffset:self.tableView.contentOffset.y]; -} - -- (void)refreshAllMapsViewForOffset:(CGFloat)scrollOffset -{ - if (!self.showAllMapsView) - return; - BOOL const hide = (scrollOffset >= self.lastScrollOffset) && !equalScreenDimensions(scrollOffset, 0.0); - self.lastScrollOffset = scrollOffset; - if (self.allMapsView.hidden == hide) - return; - if (!hide) - self.allMapsView.hidden = hide; - [self.view layoutIfNeeded]; - self.allMapsViewBottomOffset.constant = hide ? self.allMapsView.height : 0.0; - [UIView animateWithDuration:kDefaultAnimationDuration animations:^ - { - self.allMapsView.alpha = hide ? 0.0 : 1.0; - [self.view layoutIfNeeded]; - } - completion:^(BOOL finished) - { - if (hide) - self.allMapsView.hidden = hide; - }]; -} - -- (IBAction)allMapsAction -{ -} - -#pragma mark - Fill cells with data - -- (void)fillCell:(MWMMapDownloaderTableViewCell * _Nonnull)cell atIndexPath:(NSIndexPath * _Nonnull)indexPath -{ -} - -#pragma mark - UITableViewDataSource - -- (UITableViewCell * _Nonnull)tableView:(UITableView * _Nonnull)tableView cellForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath -{ - NSString * reuseIdentifier = [self cellIdentifierForIndexPath:indexPath]; - return [tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; -} - -- (NSInteger)tableView:(UITableView * _Nonnull)tableView numberOfRowsInSection:(NSInteger)section -{ - return 20; -} - -#pragma mark - UITableViewDelegate - -- (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath -{ - NSString * reuseIdentifier = [self cellIdentifierForIndexPath:indexPath]; - MWMMapDownloaderTableViewCell * cell = [self offscreenCellForIdentifier:reuseIdentifier]; - [self fillCell:cell atIndexPath:indexPath]; - [cell setNeedsUpdateConstraints]; - [cell updateConstraintsIfNeeded]; - cell.bounds = {{}, {CGRectGetWidth(tableView.bounds), CGRectGetHeight(cell.bounds)}}; - [cell setNeedsLayout]; - [cell layoutIfNeeded]; - CGSize const size = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; - return size.height; -} - -- (CGFloat)tableView:(UITableView * _Nonnull)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath -{ - NSString * reuseIdentifier = [self cellIdentifierForIndexPath:indexPath]; - MWMMapDownloaderTableViewCell * cell = [self offscreenCellForIdentifier:reuseIdentifier]; - return cell.estimatedHeight; -} - -- (void)tableView:(UITableView * _Nonnull)tableView willDisplayCell:(MWMMapDownloaderTableViewCell * _Nonnull)cell forRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath -{ - [self fillCell:cell atIndexPath:indexPath]; -} - -- (void)tableView:(UITableView * _Nonnull)tableView didSelectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath -{ - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - NSString * title = @"Alessandria"; - NSString * message = @"Italy, Piemont"; - NSString * downloadActionTitle = [self.downloadActionTitle stringByAppendingString:@", 38 MB"]; - if (isIOSVersionLessThan(8)) - { - UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:message - delegate:self - cancelButtonTitle:nil - destructiveButtonTitle:nil - otherButtonTitles:nil]; - [actionSheet addButtonWithTitle:downloadActionTitle]; - [actionSheet addButtonWithTitle:self.showActionTitle]; - if (!IPAD) - { - [actionSheet addButtonWithTitle:self.cancelActionTitle]; - actionSheet.cancelButtonIndex = actionSheet.numberOfButtons - 1; - } - UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath]; - [actionSheet showFromRect:cell.frame inView:cell.superview animated:YES]; - } - else - { - UIAlertController * alertController = - [UIAlertController alertControllerWithTitle:title - message:message - preferredStyle:UIAlertControllerStyleActionSheet]; - UIAlertAction * downloadAction = [UIAlertAction actionWithTitle:downloadActionTitle - style:UIAlertActionStyleDefault - handler:self.downloadAction]; - UIAlertAction * showAction = [UIAlertAction actionWithTitle:self.showActionTitle - style:UIAlertActionStyleDefault - handler:self.showAction]; - UIAlertAction * cancelAction = [UIAlertAction actionWithTitle:self.cancelActionTitle - style:UIAlertActionStyleCancel - handler:nil]; - [alertController addAction:downloadAction]; - [alertController addAction:showAction]; - [alertController addAction:cancelAction]; - [self presentViewController:alertController animated:YES completion:nil]; - } -} - -#pragma mark - UIActionSheetDelegate - -- (void)actionSheet:(UIActionSheet * _Nonnull)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex -{ - NSString * btnTitle = [actionSheet buttonTitleAtIndex:buttonIndex]; - if ([btnTitle hasPrefix:self.downloadActionTitle]) - self.downloadAction(nil); - else if ([btnTitle isEqualToString:self.showActionTitle]) - self.showAction(nil); -} - -#pragma mark - Action Sheet actions - -- (void)configActions -{ - self.downloadAction = ^(UIAlertAction * action) - { - }; - - self.showAction = ^(UIAlertAction * action) - { - }; - - self.downloadActionTitle = L(@"downloader_download_map"); - self.showActionTitle = L(@"zoom_to_country"); - self.cancelActionTitle = L(@"cancel"); -} - -#pragma mark - Managing the Status Bar - -- (UIStatusBarStyle)preferredStatusBarStyle -{ - return UIStatusBarStyleLightContent; -} - -#pragma mark - Properties - -- (void)setShowAllMapsView:(BOOL)showAllMapsView -{ - _showAllMapsView = showAllMapsView; - self.allMapsView.hidden = !showAllMapsView; -} - -@end diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderCountryTableViewCell.mm b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderCountryTableViewCell.mm index e0058f51f8..36ca028edf 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderCountryTableViewCell.mm +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderCountryTableViewCell.mm @@ -1,13 +1,29 @@ #import "MWMMapDownloaderCountryTableViewCell.h" +@interface MWMMapDownloaderTableViewCell () + +@property (weak, nonatomic) IBOutlet UILabel * title; +@property (weak, nonatomic) IBOutlet UILabel * downloadSize; + +@end + +@interface MWMMapDownloaderCountryTableViewCell () + +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleLeadingOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleSizeOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * downloadSizeTrailingOffset; + +@end + @implementation MWMMapDownloaderCountryTableViewCell - (void)layoutSubviews { - CGFloat const titleLeadingOffset = 60.0; - CGFloat const titleTrailingOffset = 80.0; - CGFloat const preferredMaxLayoutWidth = CGRectGetWidth(self.bounds) - titleLeadingOffset - titleTrailingOffset; - self.title.preferredMaxLayoutWidth = preferredMaxLayoutWidth; + CGFloat const preferredMaxLayoutWidth = + CGRectGetWidth(self.bounds) - self.titleLeadingOffset.constant - + self.titleSizeOffset.constant - CGRectGetWidth(self.downloadSize.bounds) - + self.downloadSizeTrailingOffset.constant; + self.title.preferredMaxLayoutWidth = nearbyint(preferredMaxLayoutWidth); [super layoutSubviews]; } diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderLargeCountryTableViewCell.h b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderLargeCountryTableViewCell.h index b1495396d7..262dd28c55 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderLargeCountryTableViewCell.h +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderLargeCountryTableViewCell.h @@ -2,6 +2,6 @@ @interface MWMMapDownloaderLargeCountryTableViewCell : MWMMapDownloaderTableViewCell -@property (weak, nonatomic) IBOutlet UILabel * mapsCount; +- (void)setMapCountText:(NSString *)text; @end diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderLargeCountryTableViewCell.mm b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderLargeCountryTableViewCell.mm index 5fbedc0d30..c36e57b96d 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderLargeCountryTableViewCell.mm +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderLargeCountryTableViewCell.mm @@ -1,17 +1,40 @@ #import "MWMMapDownloaderLargeCountryTableViewCell.h" +@interface MWMMapDownloaderTableViewCell () + +@property (weak, nonatomic) IBOutlet UILabel * title; +@property (weak, nonatomic) IBOutlet UILabel * downloadSize; + +@end + +@interface MWMMapDownloaderLargeCountryTableViewCell () + +@property (weak, nonatomic) IBOutlet UILabel * mapsCount; + +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleLeadingOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleSizeOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * downloadSizeTrailingOffset; + +@end + @implementation MWMMapDownloaderLargeCountryTableViewCell - (void)layoutSubviews { - CGFloat const titleLeadingOffset = 60.0; - CGFloat const titleTrailingOffset = 112.0; - CGFloat const preferredMaxLayoutWidth = CGRectGetWidth(self.bounds) - titleLeadingOffset - titleTrailingOffset; + CGFloat const preferredMaxLayoutWidth = + CGRectGetWidth(self.bounds) - self.titleLeadingOffset.constant - + self.titleSizeOffset.constant - CGRectGetWidth(self.downloadSize.bounds) - + self.downloadSizeTrailingOffset.constant; self.title.preferredMaxLayoutWidth = preferredMaxLayoutWidth; self.mapsCount.preferredMaxLayoutWidth = preferredMaxLayoutWidth; [super layoutSubviews]; } +- (void)setMapCountText:(NSString *)text +{ + self.mapsCount.text = text; +} + #pragma mark - Properties - (CGFloat)estimatedHeight diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderPlaceTableViewCell.h b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderPlaceTableViewCell.h index e328f87d0e..ab5dfc2e52 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderPlaceTableViewCell.h +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderPlaceTableViewCell.h @@ -2,6 +2,6 @@ @interface MWMMapDownloaderPlaceTableViewCell : MWMMapDownloaderTableViewCell -@property (weak, nonatomic) IBOutlet UILabel * area; +- (void)setAreaText:(NSString *)text; @end diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderPlaceTableViewCell.mm b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderPlaceTableViewCell.mm index 8fecbeefc5..540d2580d1 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderPlaceTableViewCell.mm +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderPlaceTableViewCell.mm @@ -1,17 +1,43 @@ #import "MWMMapDownloaderPlaceTableViewCell.h" +@interface MWMMapDownloaderTableViewCell () + +@property (weak, nonatomic) IBOutlet UILabel * title; +@property (weak, nonatomic) IBOutlet UILabel * downloadSize; + +@end + +@interface MWMMapDownloaderPlaceTableViewCell () + +@property (weak, nonatomic) IBOutlet UILabel * area; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleBottomOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleLeadingOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleSizeOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * downloadSizeTrailingOffset; + +@end + @implementation MWMMapDownloaderPlaceTableViewCell - (void)layoutSubviews { - CGFloat const titleLeadingOffset = 60.0; - CGFloat const titleTrailingOffset = 80.0; - CGFloat const preferredMaxLayoutWidth = CGRectGetWidth(self.bounds) - titleLeadingOffset - titleTrailingOffset; + CGFloat const preferredMaxLayoutWidth = + CGRectGetWidth(self.bounds) - self.titleLeadingOffset.constant - + self.titleSizeOffset.constant - CGRectGetWidth(self.downloadSize.bounds) - + self.downloadSizeTrailingOffset.constant; self.title.preferredMaxLayoutWidth = preferredMaxLayoutWidth; self.area.preferredMaxLayoutWidth = preferredMaxLayoutWidth; [super layoutSubviews]; } +- (void)setAreaText:(NSString *)text +{ + self.area.text = text; + BOOL const isAreaHidden = (text.length == 0); + self.area.hidden = isAreaHidden; + self.titleBottomOffset.priority = isAreaHidden ? UILayoutPriorityDefaultHigh : UILayoutPriorityDefaultLow; +} + #pragma mark - Properties - (CGFloat)estimatedHeight diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderSubplaceTableViewCell.mm b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderSubplaceTableViewCell.mm index 7edfa20354..f092330e94 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderSubplaceTableViewCell.mm +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderSubplaceTableViewCell.mm @@ -1,12 +1,28 @@ #import "MWMMapDownloaderSubplaceTableViewCell.h" +@interface MWMMapDownloaderTableViewCell () + +@property (weak, nonatomic) IBOutlet UILabel * title; +@property (weak, nonatomic) IBOutlet UILabel * downloadSize; + +@end + +@interface MWMMapDownloaderSubplaceTableViewCell () + +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleLeadingOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleSizeOffset; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * downloadSizeTrailingOffset; + +@end + @implementation MWMMapDownloaderSubplaceTableViewCell - (void)layoutSubviews { - CGFloat const titleLeadingOffset = 60.0; - CGFloat const titleTrailingOffset = 80.0; - CGFloat const preferredMaxLayoutWidth = CGRectGetWidth(self.bounds) - titleLeadingOffset - titleTrailingOffset; + CGFloat const preferredMaxLayoutWidth = + CGRectGetWidth(self.bounds) - self.titleLeadingOffset.constant - + self.titleSizeOffset.constant - CGRectGetWidth(self.downloadSize.bounds) - + self.downloadSizeTrailingOffset.constant; self.title.preferredMaxLayoutWidth = preferredMaxLayoutWidth; self.area.preferredMaxLayoutWidth = preferredMaxLayoutWidth; self.subPlace.preferredMaxLayoutWidth = preferredMaxLayoutWidth; diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderTableViewCell.h b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderTableViewCell.h index 8c9151df60..9d242d8626 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderTableViewCell.h +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderTableViewCell.h @@ -1,10 +1,11 @@ -@interface MWMMapDownloaderTableViewCell : UITableViewCell +#import "MWMTableViewCell.h" + +@interface MWMMapDownloaderTableViewCell : MWMTableViewCell @property (nonatomic, readonly) CGFloat estimatedHeight; -@property (weak, nonatomic) IBOutlet UIView * stateWrapper; -@property (weak, nonatomic) IBOutlet UILabel * title; -@property (weak, nonatomic) IBOutlet UILabel * downloadSize; -@property (weak, nonatomic) IBOutlet UIView * separator; +- (void)setTitleText:(NSString *)text; +- (void)setDownloadSizeText:(NSString *)text; +- (void)setLastCell:(BOOL)isLast; @end diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderTableViewCell.mm b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderTableViewCell.mm index 276fa1c778..ed2d7828cc 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderTableViewCell.mm +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderTableViewCell.mm @@ -4,6 +4,10 @@ @interface MWMMapDownloaderTableViewCell () @property (nonatomic) MWMCircularProgress * progressView; +@property (weak, nonatomic) IBOutlet UIView * stateWrapper; +@property (weak, nonatomic) IBOutlet UILabel * title; +@property (weak, nonatomic) IBOutlet UILabel * downloadSize; +@property (weak, nonatomic) IBOutlet UIView * separator; @end @@ -28,6 +32,34 @@ return 52.0; } +- (void)setTitleText:(NSString *)text +{ + self.title.text = text; +} + +- (void)setDownloadSizeText:(NSString *)text +{ + self.downloadSize.text = text; +} + +- (void)setLastCell:(BOOL)isLast +{ + self.separator.hidden = isLast; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + UIColor * color = self.separator.backgroundColor; + [super setSelected:selected animated:animated]; + self.separator.backgroundColor = color; +} + +- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{ + UIColor * color = self.separator.backgroundColor; + [super setHighlighted:highlighted animated:animated]; + self.separator.backgroundColor = color; +} + #pragma mark - MWMCircularProgressDelegate - (void)progressButtonPressed:(nonnull MWMCircularProgress *)progress diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.h b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.h index 6b59ae2bbf..5aa8ec53e8 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.h +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.h @@ -1,5 +1,5 @@ -#import "MWMMapCountryDownloaderViewController.h" +#import "MWMBaseMapDownloaderViewController.h" -@interface MWMMapDownloaderViewController : MWMMapCountryDownloaderViewController +@interface MWMMapDownloaderViewController : MWMBaseMapDownloaderViewController @end diff --git a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm index f38fe7e50e..31b6f1e3e9 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm +++ b/iphone/Maps/Classes/MapDownloader/MWMMapDownloaderViewController.mm @@ -1,28 +1,14 @@ #import "Common.h" -#import "MWMMapDownloaderCountryTableViewCell.h" -#import "MWMMapDownloaderLargeCountryTableViewCell.h" -#import "MWMMapDownloaderPlaceTableViewCell.h" -#import "MWMMapDownloaderSubplaceTableViewCell.h" -#import "MWMMapDownloaderTableViewHeader.h" #import "MWMMapDownloaderViewController.h" #import "UIColor+MapsMeColor.h" #import "UIKitCategories.h" -#include "std/vector.hpp" +@interface MWMBaseMapDownloaderViewController () -static NSString * const kCountryCellIdentifier = @"MWMMapDownloaderCountryTableViewCell"; -static NSString * const kLargeCountryCellIdentifier = @"MWMMapDownloaderLargeCountryTableViewCell"; -static NSString * const kSubplaceCellIdentifier = @"MWMMapDownloaderSubplaceTableViewCell"; -extern NSString * const kPlaceCellIdentifier; +- (NSString *)cellIdentifierForIndexPath:(NSIndexPath *)indexPath; +- (void)fillCell:(MWMMapDownloaderTableViewCell * _Nonnull)cell atIndexPath:(NSIndexPath * _Nonnull)indexPath; -static NSUInteger const sectionsCount = 2; -static NSUInteger const cellsCount = 4; -static NSString * const kCellType = @"kCellType"; -static NSString * const kCellTitle = @"kCellTitle"; -static NSString * const kCellDownloadSize = @"kCellDownloadSize"; -static NSString * const kCellMapsCount = @"kCellMapsCount"; -static NSString * const kCellArea = @"kCellArea"; -static NSString * const kCellSubplace = @"kCellSubplace"; +@end @interface MWMMapDownloaderViewController () @@ -30,8 +16,6 @@ static NSString * const kCellSubplace = @"kCellSubplace"; @property (weak, nonatomic) IBOutlet UISearchBar * searchBar; @property (weak, nonatomic) IBOutlet UITableView * tableView; -@property (nonatomic) NSMutableDictionary * dataSource; - @end @implementation MWMMapDownloaderViewController @@ -39,19 +23,7 @@ static NSString * const kCellSubplace = @"kCellSubplace"; - (void)viewDidLoad { [super viewDidLoad]; - self.title = L(@"download_maps"); self.searchBar.placeholder = L(@"search_downloaded_maps"); - - self.dataSource = [NSMutableDictionary dictionary]; - self.dataSource[[NSIndexPath indexPathForRow:0 inSection:0]] = @{kCellType : kCountryCellIdentifier, kCellTitle : @"Algeria", kCellDownloadSize : @"123 MB"}; - self.dataSource[[NSIndexPath indexPathForRow:1 inSection:0]] = @{kCellType : kPlaceCellIdentifier, kCellTitle : @"London", kCellDownloadSize : @"456 MB", kCellArea : @"UK"}; - self.dataSource[[NSIndexPath indexPathForRow:2 inSection:0]] = @{kCellType : kLargeCountryCellIdentifier, kCellTitle : @"Brazil", kCellDownloadSize : @"789 MB", kCellMapsCount : @"14 maps"}; - self.dataSource[[NSIndexPath indexPathForRow:3 inSection:0]] = @{kCellType : kSubplaceCellIdentifier, kCellTitle : @"Western Cape", kCellDownloadSize : @"1234 MB", kCellArea : @"South Africa", kCellSubplace : @"Mossel Bay"}; - - self.dataSource[[NSIndexPath indexPathForRow:0 inSection:1]] = @{kCellType : kCountryCellIdentifier, kCellTitle : @"Соединенное Королевство Великобритании и Северной Ирландии", kCellDownloadSize : @"9876 МБ"}; - self.dataSource[[NSIndexPath indexPathForRow:1 inSection:1]] = @{kCellType : kPlaceCellIdentifier, kCellTitle : @"กรุงเทพมหานคร อมรรัตนโกสินทร์ มหินทรายุธยามหาดิลก ภพนพรัตน์ ราชธานีบุรีรมย์ อุดมราชนิเวศน์ มหาสถาน อมรพิมาน อวตารสถิต สักกะทัตติยะ วิษณุกรรมประสิทธิ์", kCellDownloadSize : @"999 MB", kCellArea : @"Таиланд"}; - self.dataSource[[NSIndexPath indexPathForRow:2 inSection:1]] = @{kCellType : kLargeCountryCellIdentifier, kCellTitle : @"Muckanaghederdauhaulia", kCellDownloadSize : @"1234 MB", kCellMapsCount : @"999 maps"}; - self.dataSource[[NSIndexPath indexPathForRow:3 inSection:1]] = @{kCellType : kSubplaceCellIdentifier, kCellTitle : @"กรุงเทพมหานคร อมรรัตนโกสินทร์ มหินทรายุธยามหาดิลก ภพนพรัตน์ ราชธานีบุรีรมย์ อุดมราชนิเวศน์ มหาสถาน อมรพิมาน อวตารสถิต สักกะทัตติยะ วิษณุกรรมประสิทธิ์", kCellDownloadSize : @"999 MB", kCellArea : @"Соединенное Королевство Великобритании и Северной Ирландии", kCellSubplace : @"Venkatanarasimharajuvaripeta"}; } - (void)viewWillAppear:(BOOL)animated @@ -64,18 +36,9 @@ static NSString * const kCellSubplace = @"kCellSubplace"; #pragma mark - Table -- (void)configTable -{ - [super configTable]; - [self.tableView registerNib:[UINib nibWithNibName:kCountryCellIdentifier bundle:nil] forCellReuseIdentifier:kCountryCellIdentifier]; - [self.tableView registerNib:[UINib nibWithNibName:kLargeCountryCellIdentifier bundle:nil] forCellReuseIdentifier:kLargeCountryCellIdentifier]; - [self.tableView registerNib:[UINib nibWithNibName:kSubplaceCellIdentifier bundle:nil] forCellReuseIdentifier:kSubplaceCellIdentifier]; -} - - (NSString *)cellIdentifierForIndexPath:(NSIndexPath *)indexPath { - NSIndexPath * path = [NSIndexPath indexPathForRow:[indexPath indexAtPosition:1] inSection:[indexPath indexAtPosition:0]]; - return self.dataSource[path][kCellType]; + return [super cellIdentifierForIndexPath:indexPath]; } #pragma mark - All Maps Action @@ -83,115 +46,61 @@ static NSString * const kCellSubplace = @"kCellSubplace"; - (void)configAllMapsView { [super configAllMapsView]; + // TODO (igrechuhin) Add implementation self.allMapsLabel.text = @"5 Outdated Maps (108 MB)"; self.showAllMapsView = YES; } - (IBAction)allMapsAction { + // TODO (igrechuhin) Add implementation } #pragma mark - Fill cells with data - (void)fillCell:(MWMMapDownloaderTableViewCell * _Nonnull)cell atIndexPath:(NSIndexPath * _Nonnull)indexPath { - NSDictionary * data = self.dataSource[indexPath]; - BOOL const isLastCellInSection = indexPath.row == 3; - if ([cell isKindOfClass:[MWMMapDownloaderCountryTableViewCell class]]) - { - MWMMapDownloaderCountryTableViewCell * tCell = (MWMMapDownloaderCountryTableViewCell *)cell; - tCell.title.text = data[kCellTitle]; - tCell.downloadSize.text = data[kCellDownloadSize]; - tCell.separator.hidden = isLastCellInSection; - } - else if ([cell isKindOfClass:[MWMMapDownloaderPlaceTableViewCell class]]) - { - MWMMapDownloaderPlaceTableViewCell * tCell = (MWMMapDownloaderPlaceTableViewCell *)cell; - tCell.title.text = data[kCellTitle]; - tCell.downloadSize.text = data[kCellDownloadSize]; - tCell.area.text = data[kCellArea]; - tCell.separator.hidden = isLastCellInSection; - } - else if ([cell isKindOfClass:[MWMMapDownloaderLargeCountryTableViewCell class]]) - { - MWMMapDownloaderLargeCountryTableViewCell * tCell = (MWMMapDownloaderLargeCountryTableViewCell *)cell; - tCell.title.text = data[kCellTitle]; - tCell.downloadSize.text = data[kCellDownloadSize]; - tCell.mapsCount.text = data[kCellMapsCount]; - tCell.separator.hidden = isLastCellInSection; - } - else if ([cell isKindOfClass:[MWMMapDownloaderSubplaceTableViewCell class]]) - { - MWMMapDownloaderSubplaceTableViewCell * tCell = (MWMMapDownloaderSubplaceTableViewCell *)cell; - tCell.title.text = data[kCellTitle]; - tCell.downloadSize.text = data[kCellDownloadSize]; - tCell.area.text = data[kCellArea]; - tCell.subPlace.text = data[kCellSubplace]; - tCell.separator.hidden = isLastCellInSection; - } + [super fillCell:cell atIndexPath:indexPath]; } #pragma mark - UITableViewDataSource - (NSInteger)numberOfSectionsInTableView:(UITableView * _Nonnull)tableView { - return sectionsCount; + // TODO (igrechuhin) Add implementation + return [super numberOfSectionsInTableView:tableView]; } - (NSInteger)tableView:(UITableView * _Nonnull)tableView numberOfRowsInSection:(NSInteger)section { - return cellsCount; + // TODO (igrechuhin) Add implementation + return [super tableView:tableView numberOfRowsInSection:section]; } - (NSArray * _Nullable)sectionIndexTitlesForTableView:(UITableView * _Nonnull)tableView { -// return nil; - return @[@"A", @"Z"]; + // TODO (igrechuhin) Add implementation + return [super sectionIndexTitlesForTableView:tableView]; } - (NSInteger)tableView:(UITableView * _Nonnull)tableView sectionForSectionIndexTitle:(NSString * _Nonnull)title atIndex:(NSInteger)index { - return index; + // TODO (igrechuhin) Add implementation + return [super tableView:tableView sectionForSectionIndexTitle:title atIndex:index]; } #pragma mark - UITableViewDelegate - (UIView * _Nullable)tableView:(UITableView * _Nonnull)tableView viewForHeaderInSection:(NSInteger)section { - MWMMapDownloaderTableViewHeader * headerView = - [[[NSBundle mainBundle] loadNibNamed:@"MWMMapDownloaderTableViewHeader" - owner:nil - options:nil] firstObject]; - headerView.lastSection = (section == sectionsCount - 1); - headerView.title.text = [NSString stringWithFormat:@"Header: %@", @(section)]; - return headerView; + // TODO (igrechuhin) Add implementation + return [super tableView:tableView viewForHeaderInSection:section]; } - (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForHeaderInSection:(NSInteger)section { - return [MWMMapDownloaderTableViewHeader height]; -} - -- (void)tableView:(UITableView * _Nonnull)tableView didSelectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath -{ - NSString * identifier = [self cellIdentifierForIndexPath:indexPath]; - if ([identifier isEqualToString:kLargeCountryCellIdentifier]) - { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - [self performSegueWithIdentifier:@"MapDownloader2CountryDownloaderSegue" sender:indexPath]; - } - else - { - [super tableView:tableView didSelectRowAtIndexPath:indexPath]; - } -} - -#pragma mark - Segue - -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(NSIndexPath *)indexPath -{ - MWMMapCountryDownloaderViewController * destVC = segue.destinationViewController; - destVC.title = @"BRAZILIA"; + // TODO (igrechuhin) Add implementation + return [super tableView:tableView heightForHeaderInSection:section]; } #pragma mark - UISearchBarDelegate diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h index 976447281d..e096e2c629 100644 --- a/iphone/Maps/Classes/MapViewController.h +++ b/iphone/Maps/Classes/MapViewController.h @@ -36,6 +36,7 @@ namespace search { struct AddressInfo; } - (void)openBookmarks; - (void)openMapsDownloader; +- (void)openEditor; - (void)refreshAd; diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index aa3df36b9a..025233f207 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -2,26 +2,26 @@ #import "BookmarksVC.h" #import "Common.h" #import "EAGLView.h" -#import "MapsAppDelegate.h" -#import "MapViewController.h" -#import "MWMAlertViewController.h" #import "MWMAPIBar.h" +#import "MWMAlertViewController.h" #import "MWMAuthorizationCommon.h" #import "MWMAuthorizationLoginViewController.h" #import "MWMEditorViewController.h" +#import "MWMMapDownloaderViewController.h" #import "MWMMapViewControlsManager.h" #import "MWMPageController.h" #import "MWMPlacePageEntity.h" #import "MWMTableViewController.h" #import "MWMTextToSpeech.h" +#import "MapViewController.h" +#import "MapsAppDelegate.h" #import "RouteState.h" #import "Statistics.h" +#import "UIColor+MapsMeColor.h" #import "UIFont+MapsMeFonts.h" #import "UIViewController+Navigation.h" #import -#import "UIColor+MapsMeColor.h" - #import "3party/Alohalytics/src/alohalytics_objc.h" #include "Framework.h" @@ -63,6 +63,8 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction) namespace { NSString * const kAuthorizationSegue = @"Map2AuthorizationSegue"; +NSString * const kDownloaderSegue = @"Map2MapDownloaderSegue"; +NSString * const kEditorSegue = @"Map2EditorSegue"; } // namespace @interface NSValueWrapper : NSObject @@ -485,10 +487,25 @@ NSString * const kAuthorizationSegue = @"Map2AuthorizationSegue"; [[MWMFrameworkListener listener] addObserver:self]; } +#pragma mark - Open controllers + +- (void)openBookmarks +{ + BOOL const oneCategory = (GetFramework().GetBmCategoriesCount() == 1); + TableViewController * vc = oneCategory ? [[BookmarksVC alloc] initWithCategory:0] : [[BookmarksRootVC alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; +} + - (void)openMapsDownloader { [Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"downloader"]; - [self performSegueWithIdentifier:@"Map2MapDownloaderSegue" sender:self]; + [self performSegueWithIdentifier:kDownloaderSegue sender:self]; +} + +- (void)openEditor +{ + [[Statistics instance] logEvent:kStatEventName(kStatPlacePage, kStatEdit)]; + [self performSegueWithIdentifier:kEditorSegue sender:self.controlsManager.placePageEntity]; } #pragma mark - MWMFrameworkMyPositionObserver @@ -762,7 +779,7 @@ NSString * const kAuthorizationSegue = @"Map2AuthorizationSegue"; - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - if ([segue.identifier isEqualToString:@"Map2EditorSegue"]) + if ([segue.identifier isEqualToString:kEditorSegue]) { self.skipPlacePageDismissOnViewDisappear = YES; UINavigationController * dvc = segue.destinationViewController; @@ -775,6 +792,11 @@ NSString * const kAuthorizationSegue = @"Map2AuthorizationSegue"; MWMAuthorizationLoginViewController * authVC = (MWMAuthorizationLoginViewController *)[dvc topViewController]; authVC.isCalledFromSettings = NO; } + else if ([segue.identifier isEqualToString:kDownloaderSegue]) + { + MWMMapDownloaderViewController * dvc = segue.destinationViewController; + [dvc SetRootCountryId:GetFramework().Storage().GetRootId()]; + } } #pragma mark - Properties diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 13eda15458..4d55172bb1 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -40,7 +40,7 @@ 3411387D1C15AE73002E3B3E /* libeditor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3411387C1C15AE73002E3B3E /* libeditor.a */; }; 341138801C15B50B002E3B3E /* MWMOpeningHoursModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3411387F1C15B50B002E3B3E /* MWMOpeningHoursModel.mm */; }; 341138811C15B50B002E3B3E /* MWMOpeningHoursModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3411387F1C15B50B002E3B3E /* MWMOpeningHoursModel.mm */; }; - 341223BB1BEB58FA007227E9 /* MWMMapCountryDownloaderViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 341223BA1BEB58FA007227E9 /* MWMMapCountryDownloaderViewController.mm */; }; + 341223BB1BEB58FA007227E9 /* MWMBaseMapDownloaderViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 341223BA1BEB58FA007227E9 /* MWMBaseMapDownloaderViewController.mm */; }; 341522BF1B666A550077AA8F /* MWMAPIBarView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 341522BE1B666A550077AA8F /* MWMAPIBarView.mm */; }; 34181EB91C0ED1C30081B586 /* MWMOpeningHoursSection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34181EB81C0ED1C30081B586 /* MWMOpeningHoursSection.mm */; }; 34181EBA1C0ED1C30081B586 /* MWMOpeningHoursSection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34181EB81C0ED1C30081B586 /* MWMOpeningHoursSection.mm */; }; @@ -240,7 +240,7 @@ 34DDD5321BFDAFFE00407F2F /* MWMUpdateMapsAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3419AAA61BDFD047003DC110 /* MWMUpdateMapsAlert.mm */; }; 34DDD5331BFDB00D00407F2F /* MWMUpdateMapsAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3419AAA81BDFD0B0003DC110 /* MWMUpdateMapsAlert.xib */; }; 34DDD5341BFDB0B600407F2F /* MWMMapDownloaderViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 342AF0DF1BE24E9A0016F3AE /* MWMMapDownloaderViewController.mm */; }; - 34DDD5351BFDB0C600407F2F /* MWMMapCountryDownloaderViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 341223BA1BEB58FA007227E9 /* MWMMapCountryDownloaderViewController.mm */; }; + 34DDD5351BFDB0C600407F2F /* MWMBaseMapDownloaderViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 341223BA1BEB58FA007227E9 /* MWMBaseMapDownloaderViewController.mm */; }; 34DDD5361BFDB0CF00407F2F /* MWMMapDownloaderTableViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34D7B0521BE8E947003C2A60 /* MWMMapDownloaderTableViewCell.mm */; }; 34DDD5371BFDB0D300407F2F /* MWMMapDownloaderCountryTableViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34AF5FB31BE38863002AEAEE /* MWMMapDownloaderCountryTableViewCell.mm */; }; 34DDD5381BFDB0DA00407F2F /* MWMMapDownloaderCountryTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34212C021BE8972E00DB4B18 /* MWMMapDownloaderCountryTableViewCell.xib */; }; @@ -816,8 +816,8 @@ 3411387C1C15AE73002E3B3E /* libeditor.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libeditor.a; path = "../../../omim-xcode-build/Debug/libeditor.a"; sourceTree = ""; }; 3411387E1C15B50B002E3B3E /* MWMOpeningHoursModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMOpeningHoursModel.h; sourceTree = ""; }; 3411387F1C15B50B002E3B3E /* MWMOpeningHoursModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMOpeningHoursModel.mm; sourceTree = ""; }; - 341223B91BEB58FA007227E9 /* MWMMapCountryDownloaderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMapCountryDownloaderViewController.h; sourceTree = ""; }; - 341223BA1BEB58FA007227E9 /* MWMMapCountryDownloaderViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMMapCountryDownloaderViewController.mm; sourceTree = ""; }; + 341223B91BEB58FA007227E9 /* MWMBaseMapDownloaderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMBaseMapDownloaderViewController.h; sourceTree = ""; }; + 341223BA1BEB58FA007227E9 /* MWMBaseMapDownloaderViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMBaseMapDownloaderViewController.mm; sourceTree = ""; }; 341522BD1B666A550077AA8F /* MWMAPIBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAPIBarView.h; sourceTree = ""; }; 341522BE1B666A550077AA8F /* MWMAPIBarView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAPIBarView.mm; sourceTree = ""; }; 34181EB71C0ED1C30081B586 /* MWMOpeningHoursSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMOpeningHoursSection.h; sourceTree = ""; }; @@ -1762,8 +1762,8 @@ 342AF0DD1BE24E7C0016F3AE /* MapDownloader */ = { isa = PBXGroup; children = ( - 341223B91BEB58FA007227E9 /* MWMMapCountryDownloaderViewController.h */, - 341223BA1BEB58FA007227E9 /* MWMMapCountryDownloaderViewController.mm */, + 341223B91BEB58FA007227E9 /* MWMBaseMapDownloaderViewController.h */, + 341223BA1BEB58FA007227E9 /* MWMBaseMapDownloaderViewController.mm */, 342AF0DE1BE24E9A0016F3AE /* MWMMapDownloaderViewController.h */, 342AF0DF1BE24E9A0016F3AE /* MWMMapDownloaderViewController.mm */, 34D7B0511BE8E947003C2A60 /* MWMMapDownloaderTableViewCell.h */, @@ -3310,7 +3310,7 @@ F6ED13911B1EF96B0095C6DE /* MWMBookmarkDescriptionViewController.mm in Sources */, 349A35851B53E967009677EE /* MWMDownloadMapRequestView.mm in Sources */, F64F19991AB81A00006EAF7E /* MWMAlertViewController.mm in Sources */, - 341223BB1BEB58FA007227E9 /* MWMMapCountryDownloaderViewController.mm in Sources */, + 341223BB1BEB58FA007227E9 /* MWMBaseMapDownloaderViewController.mm in Sources */, FAFCB63613366E78001A5C59 /* WebViewController.mm in Sources */, 34C9BD091C6DBCDA000DC38D /* MWMNavigationController.mm in Sources */, 340C21111C3FFE3100111D22 /* MWMCuisineEditorTableViewCell.mm in Sources */, @@ -3501,7 +3501,7 @@ 6741A9CC1BF340DE002C974C /* MWMSearchTableViewController.mm in Sources */, 34479C7D1C60C6130065D261 /* MWMFrameworkListener.mm in Sources */, F6791B141C43DF0B007A8A6E /* MWMStartButton.mm in Sources */, - 34DDD5351BFDB0C600407F2F /* MWMMapCountryDownloaderViewController.mm in Sources */, + 34DDD5351BFDB0C600407F2F /* MWMBaseMapDownloaderViewController.mm in Sources */, 6741A9CE1BF340DE002C974C /* MWMSearchManager.mm in Sources */, 6741A9CF1BF340DE002C974C /* MWMLocationAlert.mm in Sources */, 34ABA62D1C2D57D500FE1BEC /* MWMInputPasswordValidator.mm in Sources */,