diff --git a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h index f74ba5f53e7..fc1aed9fc93 100644 --- a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h +++ b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h @@ -7,43 +7,65 @@ typedef NS_ENUM(NSUInteger, MWMZoomMode) { MWMZoomModeIn = 0, MWMZoomModeOut }; +typedef NS_ENUM(NSUInteger, MWMMyPositionMode) { + MWMMyPositionModePendingPosition, + MWMMyPositionModeNotFollowNoPosition, + MWMMyPositionModeNotFollow, + MWMMyPositionModeFollow, + MWMMyPositionModeFollowAndRotate +} NS_SWIFT_NAME(MyPositionMode); + NS_ASSUME_NONNULL_BEGIN typedef void (^SearchInDownloaderCompletions)(NSArray *results, BOOL finished); +NS_SWIFT_NAME(LocationModeListener) +@protocol MWMLocationModeListener +- (void)processMyPositionStateModeEvent:(MWMMyPositionMode)mode; +- (void)processMyPositionPendingTimeout; +@end + NS_SWIFT_NAME(FrameworkHelper) @interface MWMFrameworkHelper : NSObject -+ (void)processFirstLaunch:(BOOL)hasLocation; -+ (void)setVisibleViewport:(CGRect)rect scaleFactor:(CGFloat)scale; -+ (void)setTheme:(MWMTheme)theme; -+ (MWMDayTime)daytimeAtLocation:(nullable CLLocation *)location; -+ (void)createFramework; -+ (BOOL)canUseNetwork; -+ (BOOL)isNetworkConnected; -+ (BOOL)isWiFiConnected; -+ (MWMMarkID)invalidBookmarkId; -+ (MWMMarkGroupID)invalidCategoryId; -+ (void)zoomMap:(MWMZoomMode)mode; -+ (void)moveMap:(UIOffset)offset; -+ (void)deactivateMapSelection:(BOOL)notifyUI NS_SWIFT_NAME(deactivateMapSelection(notifyUI:)); -+ (void)switchMyPositionMode; -+ (void)stopLocationFollow; -+ (NSArray *)obtainLastSearchQueries; -+ (void)rotateMap:(double)azimuth animated:(BOOL)isAnimated; -+ (void)updatePositionArrowOffset:(BOOL)useDefault offset:(int)offsetY; -+ (void)uploadUGC:(void (^)(UIBackgroundFetchResult))completionHandler; -+ (NSString *)userAccessToken; -+ (NSString *)userAgent; -+ (int64_t)dataVersion; -+ (void)searchInDownloader:(NSString *)query ++ (MWMFrameworkHelper *)sharedHelper; +- (void)processFirstLaunch:(BOOL)hasLocation; +- (void)setVisibleViewport:(CGRect)rect scaleFactor:(CGFloat)scale; +- (void)setTheme:(MWMTheme)theme; +- (MWMDayTime)daytimeAtLocation:(nullable CLLocation *)location; +- (void)createFramework; +- (BOOL)canUseNetwork; +- (BOOL)isNetworkConnected; +- (BOOL)isWiFiConnected; +- (MWMMarkID)invalidBookmarkId; +- (MWMMarkGroupID)invalidCategoryId; +- (void)zoomMap:(MWMZoomMode)mode; +- (void)moveMap:(UIOffset)offset; +- (void)deactivateMapSelection:(BOOL)notifyUI NS_SWIFT_NAME(deactivateMapSelection(notifyUI:)); +- (void)switchMyPositionMode; +- (void)stopLocationFollow; +- (NSArray *)obtainLastSearchQueries; +- (void)rotateMap:(double)azimuth animated:(BOOL)isAnimated; +- (void)updatePositionArrowOffset:(BOOL)useDefault offset:(int)offsetY; +- (void)uploadUGC:(void (^)(UIBackgroundFetchResult))completionHandler; +- (NSString *)userAccessToken; +- (NSString *)userAgent; +- (int64_t)dataVersion; +- (void)searchInDownloader:(NSString *)query inputLocale:(NSString *)locale completion:(SearchInDownloaderCompletions)completion; -+ (BOOL)canEditMap; -+ (void)showOnMap:(MWMMarkGroupID)categoryId; -+ (void)showBookmark:(MWMMarkID)bookmarkId; -+ (void)showTrack:(MWMTrackID)trackId; -+ (void)updatePlacePageData; +- (BOOL)canEditMap; +- (void)showOnMap:(MWMMarkGroupID)categoryId; +- (void)showBookmark:(MWMMarkID)bookmarkId; +- (void)showTrack:(MWMTrackID)trackId; +- (void)updatePlacePageData; +- (void)setPlacePageSelectedCallback:(MWMVoidBlock)selected + deselectedCallback:(MWMBoolBlock)deselected + updatedCallback:(MWMVoidBlock)updated; + +- (void)addLocationModeListener:(id)listener NS_SWIFT_NAME(addLocationModeListener(_:)); +- (void)removeLocationModeListener:(id)listener NS_SWIFT_NAME(removeLocationModeListener(_:)); +- (void)setViewportCenter:(CLLocationCoordinate2D)center zoomLevel:(int)zoomLevelb; @end diff --git a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm index e1bed8b1219..2992ef97344 100644 --- a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm +++ b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm @@ -8,9 +8,53 @@ #include "platform/local_country_file_utils.hpp" #include "platform/network_policy_ios.h" +static MWMMyPositionMode mwmMyPositionMode(location::EMyPositionMode mode) { + switch (mode) { + case location::EMyPositionMode::PendingPosition: return MWMMyPositionModePendingPosition; + case location::EMyPositionMode::NotFollowNoPosition: return MWMMyPositionModeNotFollowNoPosition; + case location::EMyPositionMode::NotFollow: return MWMMyPositionModeNotFollow; + case location::EMyPositionMode::Follow: return MWMMyPositionModeFollow; + case location::EMyPositionMode::FollowAndRotate: return MWMMyPositionModeFollowAndRotate; + } +} + +@interface MWMFrameworkHelper () + +@property(strong, nonatomic) NSHashTable> *locationModeListeners; + +@end + @implementation MWMFrameworkHelper -+ (void)processFirstLaunch:(BOOL)hasLocation { ++ (MWMFrameworkHelper *)sharedHelper { + static MWMFrameworkHelper *sharedHelper; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedHelper = [[MWMFrameworkHelper alloc] init]; + }); + return sharedHelper; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _locationModeListeners = [NSHashTable weakObjectsHashTable]; + Framework &f = GetFramework(); + f.SetMyPositionModeListener([self](location::EMyPositionMode mode, bool routingActive) { + for (id listener in self.locationModeListeners) { + [listener processMyPositionStateModeEvent:mwmMyPositionMode(mode)]; + } + }); + f.SetMyPositionPendingTimeoutListener([self] { + for (id listener in self.locationModeListeners) { + [listener processMyPositionPendingTimeout]; + } + }); + } + return self; +} + +- (void)processFirstLaunch:(BOOL)hasLocation { auto &f = GetFramework(); if (!hasLocation) f.SwitchMyPositionNextMode(); @@ -18,7 +62,7 @@ + (void)processFirstLaunch:(BOOL)hasLocation { f.RunFirstLaunchAnimation(); } -+ (void)setVisibleViewport:(CGRect)rect scaleFactor:(CGFloat)scale { +- (void)setVisibleViewport:(CGRect)rect scaleFactor:(CGFloat)scale { CGFloat const x0 = rect.origin.x * scale; CGFloat const y0 = rect.origin.y * scale; CGFloat const x1 = x0 + rect.size.width * scale; @@ -26,7 +70,7 @@ + (void)setVisibleViewport:(CGRect)rect scaleFactor:(CGFloat)scale { GetFramework().SetVisibleViewport(m2::RectD(x0, y0, x1, y1)); } -+ (void)setTheme:(MWMTheme)theme { +- (void)setTheme:(MWMTheme)theme { auto &f = GetFramework(); auto const style = f.GetMapStyle(); @@ -50,7 +94,7 @@ + (void)setTheme:(MWMTheme)theme { f.SetMapStyle(newStyle); } -+ (MWMDayTime)daytimeAtLocation:(CLLocation *)location { +- (MWMDayTime)daytimeAtLocation:(CLLocation *)location { if (!location) return MWMDayTimeDay; DayTimeType dayTime = @@ -65,31 +109,31 @@ + (MWMDayTime)daytimeAtLocation:(CLLocation *)location { } } -+ (void)createFramework { +- (void)createFramework { UNUSED_VALUE(GetFramework()); } -+ (BOOL)canUseNetwork { +- (BOOL)canUseNetwork { return network_policy::CanUseNetwork(); } -+ (BOOL)isNetworkConnected { +- (BOOL)isNetworkConnected { return GetPlatform().ConnectionStatus() != Platform::EConnectionType::CONNECTION_NONE; } -+ (BOOL)isWiFiConnected { +- (BOOL)isWiFiConnected { return GetPlatform().ConnectionStatus() == Platform::EConnectionType::CONNECTION_WIFI; } -+ (MWMMarkID)invalidBookmarkId { +- (MWMMarkID)invalidBookmarkId { return kml::kInvalidMarkId; } -+ (MWMMarkGroupID)invalidCategoryId { +- (MWMMarkGroupID)invalidCategoryId { return kml::kInvalidMarkGroupId; } -+ (NSArray *)obtainLastSearchQueries { +- (NSArray *)obtainLastSearchQueries { NSMutableArray *result = [NSMutableArray array]; auto const &queries = GetFramework().GetSearchAPI().GetLastSearchQueries(); for (auto const &item : queries) { @@ -100,7 +144,7 @@ + (MWMMarkGroupID)invalidCategoryId { #pragma mark - Map Interaction -+ (void)zoomMap:(MWMZoomMode)mode { +- (void)zoomMap:(MWMZoomMode)mode { switch (mode) { case MWMZoomModeIn: GetFramework().Scale(Framework::SCALE_MAG, true); @@ -111,49 +155,49 @@ + (void)zoomMap:(MWMZoomMode)mode { } } -+ (void)moveMap:(UIOffset)offset { +- (void)moveMap:(UIOffset)offset { GetFramework().Move(offset.horizontal, offset.vertical, true); } -+ (void)deactivateMapSelection:(BOOL)notifyUI { +- (void)deactivateMapSelection:(BOOL)notifyUI { GetFramework().DeactivateMapSelection(notifyUI); } -+ (void)switchMyPositionMode { +- (void)switchMyPositionMode { GetFramework().SwitchMyPositionNextMode(); } -+ (void)stopLocationFollow { +- (void)stopLocationFollow { GetFramework().StopLocationFollow(); } -+ (void)rotateMap:(double)azimuth animated:(BOOL)isAnimated { +- (void)rotateMap:(double)azimuth animated:(BOOL)isAnimated { GetFramework().Rotate(azimuth, isAnimated); } -+ (void)updatePositionArrowOffset:(BOOL)useDefault offset:(int)offsetY { +- (void)updatePositionArrowOffset:(BOOL)useDefault offset:(int)offsetY { GetFramework().UpdateMyPositionRoutingOffset(useDefault, offsetY); } -+ (void)uploadUGC:(void (^)(UIBackgroundFetchResult))completionHandler { +- (void)uploadUGC:(void (^)(UIBackgroundFetchResult))completionHandler { GetFramework().UploadUGC([completionHandler](bool isSuccessful) { completionHandler(isSuccessful ? UIBackgroundFetchResultNewData : UIBackgroundFetchResultFailed); }); } -+ (NSString *)userAccessToken { +- (NSString *)userAccessToken { return @(GetFramework().GetUser().GetAccessToken().c_str()); } -+ (NSString *)userAgent { +- (NSString *)userAgent { return @(GetPlatform().GetAppUserAgent().Get().c_str()); } -+ (int64_t)dataVersion { +- (int64_t)dataVersion { return GetFramework().GetCurrentDataVersion(); } -+ (void)searchInDownloader:(NSString *)query +- (void)searchInDownloader:(NSString *)query inputLocale:(NSString *)locale completion:(SearchInDownloaderCompletions)completion { storage::DownloaderSearchParams searchParams; @@ -170,24 +214,47 @@ + (void)searchInDownloader:(NSString *)query GetFramework().GetSearchAPI().SearchInDownloader(searchParams); } -+ (BOOL)canEditMap { +- (BOOL)canEditMap { return GetFramework().CanEditMap(); } -+ (void)showOnMap:(MWMMarkGroupID)categoryId { +- (void)showOnMap:(MWMMarkGroupID)categoryId { GetFramework().ShowBookmarkCategory(categoryId); } -+ (void)showBookmark:(MWMMarkID)bookmarkId { +- (void)showBookmark:(MWMMarkID)bookmarkId { GetFramework().ShowBookmark(bookmarkId); } -+ (void)showTrack:(MWMTrackID)trackId { +- (void)showTrack:(MWMTrackID)trackId { GetFramework().ShowTrack(trackId); } -+ (void)updatePlacePageData { +- (void)updatePlacePageData { GetFramework().UpdatePlacePageInfoForCurrentSelection(); } +- (void)setPlacePageSelectedCallback:(MWMVoidBlock)selected + deselectedCallback:(MWMBoolBlock)deselected + updatedCallback:(MWMVoidBlock)updated { + GetFramework().SetPlacePageListeners([selected]() { selected(); }, + [deselected](bool switchFullScreen) { deselected(switchFullScreen); }, + [updated]() { updated(); }); +} + +- (void)addLocationModeListener:(id)listener { + [self.locationModeListeners addObject:listener]; +} + +- (void)removeLocationModeListener:(id)listener { + [self.locationModeListeners removeObject:listener]; +} + +- (void)setViewportCenter:(CLLocationCoordinate2D)center zoomLevel:(int)zoomLevel { + Framework &f = GetFramework(); + f.StopLocationFollow(); + f.SetViewportCenter(mercator::FromLatLon(center.latitude, center.longitude), zoomLevel, false); +} + + @end diff --git a/iphone/CoreApi/CoreApi/Metrics/MWMEye.h b/iphone/CoreApi/CoreApi/Metrics/MWMEye.h index 8e35c97e0ff..38e4b886b6e 100644 --- a/iphone/CoreApi/CoreApi/Metrics/MWMEye.h +++ b/iphone/CoreApi/CoreApi/Metrics/MWMEye.h @@ -1,23 +1,20 @@ #import -typedef NS_ENUM(NSUInteger, MWMTip) -{ - MWMTipBookmarks, - MWMTipSearch, - MWMTipDiscovery, - MWMTipSubway, - MWMTipIsolines, - MWMTipNone -}; +typedef NS_ENUM(NSUInteger, MWMTipType) { + MWMTipTypeBookmarks, + MWMTipTypeSearch, + MWMTipTypeDiscovery, + MWMTipTypeSubway, + MWMTipTypeIsolines, + MWMTipTypeNone +} NS_SWIFT_NAME(TipType); -typedef NS_ENUM(NSUInteger, MWMTipEvent) -{ +typedef NS_ENUM(NSUInteger, MWMTipEvent) { MWMTipEventAction, MWMTipEventGotIt -}; +} NS_SWIFT_NAME(TipEvent); -typedef NS_ENUM(NSUInteger, MWMEyeDiscoveryEvent) -{ +typedef NS_ENUM(NSUInteger, MWMEyeDiscoveryEvent) { MWMEyeDiscoveryEventHotels, MWMEyeDiscoveryEventAttractions, MWMEyeDiscoveryEventCafes, @@ -28,10 +25,10 @@ typedef NS_ENUM(NSUInteger, MWMEyeDiscoveryEvent) MWMEyeDiscoveryEventMoreLocals }; -@interface MWMEye : NSObject +@interface MWMEye: NSObject -+ (MWMTip)getTipType; -+ (void)tipClickedWithType:(MWMTip)type event:(MWMTipEvent)event; ++ (MWMTipType)getTipType; ++ (void)tipClickedWithType:(MWMTipType)type event:(MWMTipEvent)event; + (void)bookingFilterUsed; + (void)boomarksCatalogShown; + (void)discoveryShown; diff --git a/iphone/CoreApi/CoreApi/Metrics/MWMEye.mm b/iphone/CoreApi/CoreApi/Metrics/MWMEye.mm index 5e8124794df..4221908ac7f 100644 --- a/iphone/CoreApi/CoreApi/Metrics/MWMEye.mm +++ b/iphone/CoreApi/CoreApi/Metrics/MWMEye.mm @@ -4,44 +4,36 @@ @implementation MWMEye -+ (MWMTip)getTipType -{ ++ (MWMTipType)getTipType { auto tutorialType = GetFramework().GetTipsApi().GetTip(); - return tutorialType ? (MWMTip)*tutorialType : MWMTipNone; + return tutorialType ? (MWMTipType)*tutorialType : MWMTipTypeNone; } -+ (void)tipClickedWithType:(MWMTip)type event:(MWMTipEvent)event -{ ++ (void)tipClickedWithType:(MWMTipType)type event:(MWMTipEvent)event { eye::Eye::Event::TipClicked((eye::Tip::Type)type, (eye::Tip::Event)event); } -+ (void)bookingFilterUsed -{ ++ (void)bookingFilterUsed { eye::Eye::Event::BookingFilterUsed(); } -+ (void)boomarksCatalogShown -{ ++ (void)boomarksCatalogShown { eye::Eye::Event::BoomarksCatalogShown(); } -+ (void)discoveryShown -{ ++ (void)discoveryShown { eye::Eye::Event::DiscoveryShown(); } -+ (void)discoveryItemClickedWithEvent:(MWMEyeDiscoveryEvent)event -{ ++ (void)discoveryItemClickedWithEvent:(MWMEyeDiscoveryEvent)event { eye::Eye::Event::DiscoveryItemClicked((eye::Discovery::Event)event); } -+ (void)transitionToBookingWithPos:(CGPoint)pos -{ ++ (void)transitionToBookingWithPos:(CGPoint)pos { eye::Eye::Event::TransitionToBooking({pos.x, pos.y}); } -+ (void)promoAfterBookingShownWithCityId:(NSString *)cityId -{ ++ (void)promoAfterBookingShownWithCityId:(NSString *)cityId { eye::Eye::Event::PromoAfterBookingShown(cityId.UTF8String); } diff --git a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm index ffe9c2d57cc..a424113fa0d 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm @@ -242,7 +242,7 @@ - (void)loadCatalogPromoWithCompletion:(MWMVoidBlock)completion { api->GetPoiGallery(m_mercator, locale, m_rawTypes, - [MWMFrameworkHelper isWiFiConnected], + [[MWMFrameworkHelper sharedHelper] isWiFiConnected], UTM::SightseeingsPlacepageGallery, resultHandler, errorHandler); diff --git a/iphone/CoreApi/CoreApi/Traffic/MWMMapOverlayManager.h b/iphone/CoreApi/CoreApi/Traffic/MWMMapOverlayManager.h index b124e924092..68177a7d298 100644 --- a/iphone/CoreApi/CoreApi/Traffic/MWMMapOverlayManager.h +++ b/iphone/CoreApi/CoreApi/Traffic/MWMMapOverlayManager.h @@ -22,7 +22,7 @@ typedef NS_ENUM(NSUInteger, MWMMapOverlayIsolinesState) { MWMMapOverlayIsolinesStateEnabled, MWMMapOverlayIsolinesStateExpiredData, MWMMapOverlayIsolinesStateNoData, -} NS_SWIFT_NAME(MapOverlayTransitState); +} NS_SWIFT_NAME(MapOverlayIsolinesState); typedef NS_ENUM(NSUInteger, MWMMapOverlayGuidesState) { MWMMapOverlayGuidesStateDisabled, diff --git a/iphone/Maps/Bookmarks/BookmarksCoordinator.swift b/iphone/Maps/Bookmarks/BookmarksCoordinator.swift index aedab8c274a..c8bbb6bde16 100644 --- a/iphone/Maps/Bookmarks/BookmarksCoordinator.swift +++ b/iphone/Maps/Bookmarks/BookmarksCoordinator.swift @@ -8,7 +8,7 @@ import UIKit } private weak var navigationController: UINavigationController? - private weak var controlsManager: MWMMapViewControlsManager? + weak var mapControlsViewController: MapControlsViewController? private weak var navigationManager: MWMNavigationDashboardManager? private var bookmarksControllers: [UIViewController]? private var state: BookmarksState = .closed { @@ -18,10 +18,8 @@ import UIKit } @objc init(navigationController: UINavigationController, - controlsManager: MWMMapViewControlsManager, navigationManager: MWMNavigationDashboardManager) { self.navigationController = navigationController - self.controlsManager = controlsManager self.navigationManager = navigationManager } @@ -57,13 +55,13 @@ import UIKit animations: { navigationController.setViewControllers(controllers, animated: false) }, completion: nil) - FrameworkHelper.deactivateMapSelection(notifyUI: true) + FrameworkHelper.shared().deactivateMapSelection(notifyUI: true) self.bookmarksControllers = nil - controlsManager?.hideGuidesNavigationBar() + mapControlsViewController?.hideGuidesNavigationBar() case .closed: navigationController.popToRootViewController(animated: true) bookmarksControllers = nil - controlsManager?.hideGuidesNavigationBar() + mapControlsViewController?.hideGuidesNavigationBar() case let .hidden(categoryId): UIView.transition(with: self.navigationController!.view, duration: kDefaultAnimationDuration, @@ -73,7 +71,7 @@ import UIKit }, completion: nil) let isNavigation = navigationManager?.state != .hidden if isNavigation == false { - controlsManager?.showGuidesNavigationBar(categoryId) + mapControlsViewController?.showGuidesNavigationBar(categoryId) } } } diff --git a/iphone/Maps/Bookmarks/BookmarksList/BookmarksListInteractor.swift b/iphone/Maps/Bookmarks/BookmarksList/BookmarksListInteractor.swift index 99620da7475..578ad696711 100644 --- a/iphone/Maps/Bookmarks/BookmarksList/BookmarksListInteractor.swift +++ b/iphone/Maps/Bookmarks/BookmarksList/BookmarksListInteractor.swift @@ -89,15 +89,15 @@ extension BookmarksListInteractor: IBookmarksListInteractor { } func viewOnMap() { - FrameworkHelper.show(onMap: markGroupId) + FrameworkHelper.shared().show(onMap: markGroupId) } func viewBookmarkOnMap(_ bookmarkId: MWMMarkID) { - FrameworkHelper.showBookmark(bookmarkId) + FrameworkHelper.shared().showBookmark(bookmarkId) } func viewTrackOnMap(_ trackId: MWMTrackID) { - FrameworkHelper.showTrack(trackId) + FrameworkHelper.shared().showTrack(trackId) } func setGroup(_ groupId: MWMMarkGroupID, visible: Bool) { diff --git a/iphone/Maps/Bookmarks/Catalog/CatalogWebViewController.swift b/iphone/Maps/Bookmarks/Catalog/CatalogWebViewController.swift index b4dd085a983..4d26c3082ce 100644 --- a/iphone/Maps/Bookmarks/Catalog/CatalogWebViewController.swift +++ b/iphone/Maps/Bookmarks/Catalog/CatalogWebViewController.swift @@ -65,7 +65,7 @@ final class CatalogWebViewController: WebViewController { super.init(url: catalogUrl, title: L("guides_catalogue_title"))! noInternetView = CatalogConnectionErrorView(frame: .zero, actionCallback: { [weak self] in guard let self = self else { return } - if !FrameworkHelper.isNetworkConnected() { + if !FrameworkHelper.shared().isNetworkConnected() { self.noInternetView.isHidden = false return } @@ -110,7 +110,7 @@ final class CatalogWebViewController: WebViewController { progressBgView.widthAnchor.constraint(equalToConstant: 48).isActive = true progressBgView.heightAnchor.constraint(equalToConstant: 48).isActive = true - let connected = FrameworkHelper.isNetworkConnected() + let connected = FrameworkHelper.shared().isNetworkConnected() if !connected { Statistics.logEvent("Bookmarks_Downloaded_Catalogue_error", withParameters: [kStatError: "no_internet"]) @@ -219,7 +219,7 @@ final class CatalogWebViewController: WebViewController { private func showOnMap(_ serverId: String) { let groupId = BookmarksManager.shared().getGroupId(serverId) - FrameworkHelper.show(onMap: groupId) + FrameworkHelper.shared().show(onMap: groupId) navigationController?.popToRootViewController(animated: true) } diff --git a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift index 29beb1a040a..3506b11fcb2 100644 --- a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift +++ b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift @@ -295,7 +295,7 @@ final class BookmarksSharingViewController: MWMTableViewController { } private func performAfterValidation(anchor: UIView, action: @escaping MWMVoidBlock) { - if FrameworkHelper.isNetworkConnected() { + if FrameworkHelper.shared().isNetworkConnected() { signup(anchor: anchor, source: .exportBookmarks, onComplete: {[weak self] result in if result == .succes { action() diff --git a/iphone/Maps/Bridging-Header.h b/iphone/Maps/Bridging-Header.h index 95bf81782cb..a1c9ecd9e56 100644 --- a/iphone/Maps/Bridging-Header.h +++ b/iphone/Maps/Bridging-Header.h @@ -43,7 +43,6 @@ #import "MWMGeoTrackerCore.h" #import "MWMKeyboard.h" #import "MWMLocationManager.h" -#import "MWMLocationModeListener.h" #import "MWMMapDownloaderButtonTableViewCell.h" #import "MWMMapDownloaderCellHeader.h" #import "MWMMapDownloaderLargeCountryTableViewCell.h" @@ -79,7 +78,6 @@ #import "MWMTextToSpeech.h" #import "MWMTextToSpeechObserver.h" #import "MWMTextView.h" -#import "MWMTrafficButtonViewController.h" #import "MWMViewController.h" #import "MapViewController.h" #import "MapsAppDelegate.h" diff --git a/iphone/Maps/Classes/CarPlay/CarPlayService.swift b/iphone/Maps/Classes/CarPlay/CarPlayService.swift index 6ec49827ca8..7c0230c85d1 100644 --- a/iphone/Maps/Classes/CarPlay/CarPlayService.swift +++ b/iphone/Maps/Classes/CarPlay/CarPlayService.swift @@ -11,7 +11,7 @@ final class CarPlayService: NSObject { private var window: CPWindow? private var interfaceController: CPInterfaceController? private var sessionConfiguration: CPSessionConfiguration? - var currentPositionMode: MWMMyPositionMode = .pendingPosition + var currentPositionMode: MyPositionMode = .pendingPosition var isSpeedCamActivated: Bool { set { router?.updateSpeedCameraMode(newValue ? .always: .never) @@ -54,7 +54,7 @@ final class CarPlayService: NSObject { router.restoreTripPreviewOnCarplay(beforeRootTemplateDidAppear: true) } ThemeManager.invalidate() - FrameworkHelper.updatePositionArrowOffset(false, offset: 5) + FrameworkHelper.shared().updatePositionArrowOffset(false, offset: 5) } @objc func destroy() { @@ -62,7 +62,7 @@ final class CarPlayService: NSObject { carplayVC.removeMapView() } MapViewController.shared()?.disableCarPlayRepresentation() - MapViewController.shared()?.remove(self) + FrameworkHelper.shared().removeLocationModeListener(self) router?.removeListener(self) router?.unsubscribeFromEvents() router?.setupInitialSpeedCameraMode() @@ -78,7 +78,7 @@ final class CarPlayService: NSObject { sessionConfiguration = nil interfaceController = nil ThemeManager.invalidate() - FrameworkHelper.updatePositionArrowOffset(true, offset: 0) + FrameworkHelper.shared().updatePositionArrowOffset(true, offset: 0) } @objc func interfaceStyle() -> UIUserInterfaceStyle { @@ -98,15 +98,15 @@ final class CarPlayService: NSObject { currentPositionMode = mapVC.currentPositionMode mapVC.enableCarPlayRepresentation() carplayVC.addMapView(mapVC.mapView, mapButtonSafeAreaLayoutGuide: window.mapButtonSafeAreaLayoutGuide) - mapVC.add(self) } + FrameworkHelper.shared().addLocationModeListener(self) } private func applyBaseRootTemplate() { let mapTemplate = MapTemplateBuilder.buildBaseTemplate(positionMode: currentPositionMode) mapTemplate.mapDelegate = self interfaceController?.setRootTemplate(mapTemplate, animated: true) - FrameworkHelper.rotateMap(0.0, animated: false) + FrameworkHelper.shared().rotateMap(0.0, animated: false) } private func applyNavigationRootTemplate(trip: CPTrip, routeInfo: RouteInfo) { @@ -177,7 +177,7 @@ final class CarPlayService: NSObject { MapTemplateBuilder.setupRecenterButton(mapTemplate: mapTemplate) } updateVisibleViewPortState(.default) - FrameworkHelper.rotateMap(0.0, animated: true) + FrameworkHelper.shared().rotateMap(0.0, animated: true) } func updateMapTemplateUIToTripFinished(_ trip: CPTrip) { @@ -313,7 +313,7 @@ extension CarPlayService: CPMapTemplateDelegate { public func mapTemplateDidShowPanningInterface(_ mapTemplate: CPMapTemplate) { isUserPanMap = false MapTemplateBuilder.configurePanUI(mapTemplate: mapTemplate) - FrameworkHelper.stopLocationFollow() + FrameworkHelper.shared().stopLocationFollow() } public func mapTemplateDidDismissPanningInterface(_ mapTemplate: CPMapTemplate) { @@ -323,7 +323,7 @@ extension CarPlayService: CPMapTemplateDelegate { } else { MapTemplateBuilder.configureBaseUI(mapTemplate: mapTemplate) } - FrameworkHelper.switchMyPositionMode() + FrameworkHelper.shared().switchMyPositionMode() } func mapTemplate(_ mapTemplate: CPMapTemplate, panEndedWith direction: CPMapTemplate.PanDirection) { @@ -333,7 +333,7 @@ extension CarPlayService: CPMapTemplateDelegate { if direction.contains(.down) { offset.vertical += offsetStep } if direction.contains(.left) { offset.horizontal += offsetStep } if direction.contains(.right) { offset.horizontal -= offsetStep } - FrameworkHelper.moveMap(offset) + FrameworkHelper.shared().moveMap(offset) isUserPanMap = true } @@ -344,7 +344,7 @@ extension CarPlayService: CPMapTemplateDelegate { if direction.contains(.down) { offset.vertical += offsetStep } if direction.contains(.left) { offset.horizontal += offsetStep } if direction.contains(.right) { offset.horizontal -= offsetStep } - FrameworkHelper.moveMap(offset) + FrameworkHelper.shared().moveMap(offset) isUserPanMap = true } @@ -544,7 +544,7 @@ extension CarPlayService: CarPlayRouterListener { // MARK: - LocationModeListener implementation @available(iOS 12.0, *) extension CarPlayService: LocationModeListener { - func processMyPositionStateModeEvent(_ mode: MWMMyPositionMode) { + func processMyPositionStateModeEvent(_ mode: MyPositionMode) { currentPositionMode = mode guard let rootMapTemplate = rootMapTemplate, let info = rootMapTemplate.userInfo as? MapInfo, @@ -726,7 +726,7 @@ extension CarPlayService { self.interfaceController?.dismissTemplate(animated: true) }) let noAction = CPAlertAction(title: L("cancel"), style: .cancel, handler: { [unowned self] _ in - FrameworkHelper.rotateMap(0.0, animated: false) + FrameworkHelper.shared().rotateMap(0.0, animated: false) self.router?.completeRouteAndRemovePoints() self.interfaceController?.dismissTemplate(animated: true) }) diff --git a/iphone/Maps/Classes/CarPlay/Template Builders/ListTemplateBuilder.swift b/iphone/Maps/Classes/CarPlay/Template Builders/ListTemplateBuilder.swift index 12f2f4add19..e9238b8ba6e 100644 --- a/iphone/Maps/Classes/CarPlay/Template Builders/ListTemplateBuilder.swift +++ b/iphone/Maps/Classes/CarPlay/Template Builders/ListTemplateBuilder.swift @@ -63,7 +63,7 @@ final class ListTemplateBuilder { } private class func obtainHistory(template: CPListTemplate) { - let searchQueries = FrameworkHelper.obtainLastSearchQueries() + let searchQueries = FrameworkHelper.shared().obtainLastSearchQueries() let items = searchQueries.map({ (text) -> CPListItem in let item = CPListItem(text: text, detailText: nil, image: UIImage(named: "ic_carplay_recent")) item.userInfo = ListItemInfo(type: CPConstants.ListItemType.history, diff --git a/iphone/Maps/Classes/CarPlay/Template Builders/MapTemplateBuilder.swift b/iphone/Maps/Classes/CarPlay/Template Builders/MapTemplateBuilder.swift index a5c1591ad1f..75f42dd608a 100644 --- a/iphone/Maps/Classes/CarPlay/Template Builders/MapTemplateBuilder.swift +++ b/iphone/Maps/Classes/CarPlay/Template Builders/MapTemplateBuilder.swift @@ -18,7 +18,7 @@ final class MapTemplateBuilder { case endRoute } // MARK: - CPMapTemplate builders - class func buildBaseTemplate(positionMode: MWMMyPositionMode) -> CPMapTemplate { + class func buildBaseTemplate(positionMode: MyPositionMode) -> CPMapTemplate { let mapTemplate = CPMapTemplate() mapTemplate.hidesButtonsWithNavigationBar = false configureBaseUI(mapTemplate: mapTemplate) @@ -61,12 +61,12 @@ final class MapTemplateBuilder { mapTemplate.showPanningInterface(animated: true) } let zoomInButton = buildMapButton(type: .zoomIn) { _ in - FrameworkHelper.zoomMap(.in) + FrameworkHelper.shared().zoomMap(.in) Alohalytics.logEvent(kStatCarplayZoom, with: [kStatIsZoomIn : true, kStatIsPanActivated: false]) } let zoomOutButton = buildMapButton(type: .zoomOut) { _ in - FrameworkHelper.zoomMap(.out) + FrameworkHelper.shared().zoomMap(.out) Alohalytics.logEvent(kStatCarplayZoom, with: [kStatIsZoomIn : false, kStatIsPanActivated: false]) } @@ -82,12 +82,12 @@ final class MapTemplateBuilder { class func configurePanUI(mapTemplate: CPMapTemplate) { let zoomInButton = buildMapButton(type: .zoomIn) { _ in - FrameworkHelper.zoomMap(.in) + FrameworkHelper.shared().zoomMap(.in) Alohalytics.logEvent(kStatCarplayZoom, with: [kStatIsZoomIn : true, kStatIsPanActivated: true]) } let zoomOutButton = buildMapButton(type: .zoomOut) { _ in - FrameworkHelper.zoomMap(.out) + FrameworkHelper.shared().zoomMap(.out) Alohalytics.logEvent(kStatCarplayZoom, with: [kStatIsZoomIn : false, kStatIsPanActivated: true]) } @@ -127,7 +127,7 @@ final class MapTemplateBuilder { class func setupRecenterButton(mapTemplate: CPMapTemplate) { let recenterButton = buildBarButton(type: .recenter) { _ in - FrameworkHelper.switchMyPositionMode() + FrameworkHelper.shared().switchMyPositionMode() Alohalytics.logEvent(kStatCarplayRecenter) } mapTemplate.leadingNavigationBarButtons = [recenterButton] diff --git a/iphone/Maps/Classes/CircleView.h b/iphone/Maps/Classes/CircleView.h deleted file mode 100644 index 2a5ec225356..00000000000 --- a/iphone/Maps/Classes/CircleView.h +++ /dev/null @@ -1,18 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface CircleView : UIView - -- (id)initWithFrame:(CGRect)frame andColor:(UIColor *)color; -- (id)initWithFrame:(CGRect)frame andColor:(UIColor *)color andImageName:(nullable NSString *)imageName; - -+ (UIImage *)createCircleImageWithFrameSize:(CGFloat)frameSize andDiameter:(CGFloat)diameter andColor:(UIColor *)color; -+ (UIImage *)createCircleImageWithDiameter:(CGFloat)diameter andColor:(UIColor *)color; -+ (UIImage *)createCircleImageWithDiameter:(CGFloat)diameter - andColor:(UIColor *)color - andImageName:(NSString *)imageName; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iphone/Maps/Classes/CircleView.m b/iphone/Maps/Classes/CircleView.m deleted file mode 100644 index aef5247bbb4..00000000000 --- a/iphone/Maps/Classes/CircleView.m +++ /dev/null @@ -1,80 +0,0 @@ -#import -#import "CircleView.h" -#import - -@interface CircleView() - -@property(nonatomic) UIColor *circleColor; -@property(nonatomic) UIImage *image; - -@end - -@implementation CircleView - -- (id)initWithFrame:(CGRect)frame andColor:(UIColor *)color { - return [self initWithFrame:frame andColor:color andImageName:nil]; -} - -- (id)initWithFrame:(CGRect)frame andColor:(UIColor *)color andImageName:(nullable NSString *)imageName { - self = [super initWithFrame:frame]; - if (self) - { - _circleColor = color; - if (imageName) - _image = [UIImage imageNamed:imageName]; - self.opaque = NO; - } - return self; -} - -- (void)drawRect:(CGRect)rect { - CGContextRef ctx = UIGraphicsGetCurrentContext(); - CGContextAddEllipseInRect(ctx, rect); - CGContextSetFillColor(ctx, CGColorGetComponents(self.circleColor.CGColor)); - CGContextFillPath(ctx); - - if (self.image) - [self.image drawInRect:CGRectMake(3, 3, rect.size.width - 6, rect.size.height - 6)]; -} - -+ (UIImage *)createCircleImageWithFrameSize:(CGFloat)frameSize - andDiameter:(CGFloat)diameter - andColor:(UIColor *)color - andImageName:(nullable NSString *)imageName { - UIView *circleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frameSize, frameSize)]; - circleView.backgroundColor = UIColor.clearColor; - CircleView *circle = [[self alloc] initWithFrame:CGRectMake(0.5, 0.5, diameter - 1, diameter - 1) - andColor:color - andImageName:imageName]; - circle.center = circleView.center; - [circleView addSubview:circle]; - return [self imageWithView:circleView]; -} - -+ (UIImage *)createCircleImageWithFrameSize:(CGFloat)frameSize - andDiameter:(CGFloat)diameter - andColor:(UIColor *)color { - return [self createCircleImageWithFrameSize:frameSize andDiameter:diameter andColor:color andImageName:nil]; -} - -+ (UIImage *)createCircleImageWithDiameter:(CGFloat)diameter andColor:(UIColor *)color { - return [self createCircleImageWithFrameSize:diameter andDiameter:diameter andColor:color andImageName:nil]; -} - -+ (UIImage *)createCircleImageWithDiameter:(CGFloat)diameter - andColor:(UIColor *)color - andImageName:(NSString *)imageName { - return [self createCircleImageWithFrameSize:diameter andDiameter:diameter andColor:color andImageName:imageName]; -} - -+ (UIImage *)imageWithView:(UIView *)view { - UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:view.bounds.size]; - - UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext *rendererContext) { - [view.layer renderInContext:rendererContext.CGContext]; - }]; - - return image; -} - -@end diff --git a/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.mm b/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.mm index d26ec571c93..fe46457d104 100644 --- a/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/MWMEditorViralAlert.mm @@ -21,8 +21,8 @@ - (IBAction)shareTap { [Statistics logEvent:kStatEditorSecondTimeShareClick]; [self close:^{ MWMActivityViewController* shareVC = [MWMActivityViewController shareControllerForEditorViral]; - [shareVC presentInParentViewController:self.alertController.ownerViewController - anchorView:[BottomTabBarViewController controller].view]; +// [shareVC presentInParentViewController:self.alertController.ownerViewController +// anchorView:[BottomTabBarViewController controller].view]; }]; } diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMMapViewControlsCommon.h b/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMMapViewControlsCommon.h index 7f53f253fc9..ee8d247974f 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMMapViewControlsCommon.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMMapViewControlsCommon.h @@ -1,10 +1,7 @@ static NSTimeInterval const kMenuViewHideFramesCount = 4.0; -static inline NSTimeInterval framesDuration(NSTimeInterval const framesCount) -{ - static NSTimeInterval const kFPS = 30.0; - static NSTimeInterval const kFrameDuration = 1.0 / kFPS; - return kFrameDuration * framesCount; +static inline NSTimeInterval framesDuration(NSTimeInterval const framesCount) { + return framesCount / 30; } static CGFloat const kViewControlsOffsetToBounds = 6; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarView.swift b/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarView.swift deleted file mode 100644 index 2deec4cccde..00000000000 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarView.swift +++ /dev/null @@ -1,9 +0,0 @@ -class GuidesNavigationBarView: UIView { - override var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections { - return .top - } - - override var trafficButtonAreaAffectDirections: MWMAvailableAreaAffectDirections { - return .top - } -} diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.swift b/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.swift index 568bbd6c9c8..521849cfe77 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.swift +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.swift @@ -1,12 +1,11 @@ class GuidesNavigationBarViewController: UIViewController { - private var availableArea = CGRect.zero private var mapViewController = MapViewController.shared() private var category: BookmarkGroup @IBOutlet var navigationBar: UINavigationBar! @IBOutlet var navigationBarItem: UINavigationItem! - @objc init(categoryId: MWMMarkGroupID) { + init(categoryId: MWMMarkGroupID) { category = BookmarksManager.shared().category(withId: categoryId) super.init(nibName: nil, bundle: nil) } @@ -31,35 +30,6 @@ class GuidesNavigationBarViewController: UIViewController { style: .plain, target: self, action: #selector(onCancelPessed)) - refreshLayout(false) - } - - @objc func configLayout() { - guard let superview = view.superview else { - fatalError() - } - - NSLayoutConstraint.activate([ - view.topAnchor.constraint(equalTo: superview.topAnchor), - view.leftAnchor.constraint(equalTo: superview.leftAnchor), - view.rightAnchor.constraint(equalTo: superview.rightAnchor) - ]) - } - - func refreshLayout(_ animated: Bool = true) { - DispatchQueue.main.async { - let availableArea = self.availableArea - self.view.alpha = min(1, availableArea.height / self.view.height) - } - } - - class func updateAvailableArea(_ frame: CGRect) { - guard let controller = MWMMapViewControlsManager.manager()?.guidesNavigationBar, - !controller.availableArea.equalTo(frame) else { - return - } - controller.availableArea = frame - controller.refreshLayout() } @objc func onBackPressed(_ sender: Any) { diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.xib index 372c9d18330..c57954b415e 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.xib @@ -1,10 +1,11 @@ - + - + + @@ -16,12 +17,12 @@ - + - + @@ -62,6 +63,7 @@ + @@ -74,7 +76,6 @@ - @@ -90,4 +91,9 @@ + + + + + diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h index 61e747ac38e..ad5f1f888d6 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h @@ -5,33 +5,22 @@ @class MapViewController; @class BottomTabBarViewController; -@class GuidesNavigationBarViewController; @protocol MWMFeatureHolder; @interface MWMMapViewControlsManager : NSObject + (MWMMapViewControlsManager *)manager NS_SWIFT_NAME(manager()); -@property(nonatomic) BOOL hidden; -@property(nonatomic) BOOL zoomHidden; -@property(nonatomic) BOOL sideButtonsHidden; -@property(nonatomic) BOOL trafficButtonHidden; @property(nonatomic, readonly) BOOL guidesNavigationBarHidden; @property(nonatomic) MWMBottomMenuState menuState; @property(nonatomic) MWMBottomMenuState menuRestoreState; @property(nonatomic) BOOL isDirectionViewHidden; -@property(nonatomic) BottomTabBarViewController *tabBarController; -@property(nonatomic) GuidesNavigationBarViewController *guidesNavigationBar; - (instancetype)init __attribute__((unavailable("init is not available"))); - (instancetype)initWithParentController:(MapViewController *)controller; - (UIStatusBarStyle)preferredStatusBarStyle; -#pragma mark GuidesNavigationBar -- (void)showGuidesNavigationBar:(MWMMarkGroupID)categoryId; -- (void)hideGuidesNavigationBar; - #pragma mark - Layout - (UIView *)anchorView; @@ -62,6 +51,6 @@ - (id)featureHolder; -- (void)showAdditionalViewsIfNeeded; +//- (void)showAdditionalViewsIfNeeded; @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index b1ec9ea6337..8b3ea0b02d6 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -7,7 +7,6 @@ #import "MWMPlacePageProtocol.h" #import "MWMSearchManager.h" #import "MWMSideButtons.h" -#import "MWMTrafficButtonViewController.h" #import "MapViewController.h" #import "MapsAppDelegate.h" #import "SwiftBridge.h" @@ -26,14 +25,9 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue"; } // namespace -@interface MWMMapViewControlsManager () +@interface MWMMapViewControlsManager () -@property(nonatomic) MWMSideButtons *sideButtons; -@property(nonatomic) MWMTrafficButtonViewController *trafficButton; @property(nonatomic) UIButton *promoButton; -@property(nonatomic) UIViewController *menuController; @property(nonatomic) id placePageManager; @property(nonatomic) MWMNavigationDashboardManager *navigationManager; @property(nonatomic) MWMSearchManager *searchManager; @@ -41,8 +35,6 @@ @interface MWMMapViewControlsManager () )coordinator { - [self.trafficButton viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - [self.tabBarController viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - [self.guidesNavigationBar viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; [self.searchManager viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; } @@ -111,7 +98,6 @@ - (void)viewWillTransitionToSize:(CGSize)size - (void)showPlacePageReview { [[MWMNetworkPolicy sharedPolicy] callOnlineApi:^(BOOL) { - self.trafficButtonHidden = YES; [self.placePageManager showReview]; }]; } @@ -136,50 +122,12 @@ - (void)hideSearch { self.searchManager.state = MWMSearchManagerStateHidden; } -#pragma mark - BottomMenuDelegate - +//#pragma mark - BottomMenuDelegate +// - (void)actionDownloadMaps:(MWMMapDownloaderMode)mode { [self.ownerController openMapsDownloader:mode]; } -- (void)didFinishAddingPlace { - self.trafficButtonHidden = NO; - self.menuState = MWMBottomMenuStateInactive; -} - -- (void)addPlace { - GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kEditorAddDiscovered); - [self addPlace:NO hasPoint:NO point:m2::PointD()]; -} - -- (void)addPlace:(BOOL)isBusiness hasPoint:(BOOL)hasPoint point:(m2::PointD const &)point { - MapViewController *ownerController = self.ownerController; - [ownerController dismissPlacePage]; - - self.searchManager.state = MWMSearchManagerStateHidden; - self.menuState = MWMBottomMenuStateHidden; - self.trafficButtonHidden = YES; - - [MWMAddPlaceNavigationBar showInSuperview:ownerController.view - isBusiness:isBusiness - applyPosition:hasPoint - position:point - doneBlock:^{ - auto &f = GetFramework(); - - if (IsPointCoveredByDownloadedMaps(f.GetViewportCenter(), f.GetStorage(), f.GetCountryInfoGetter())) - [ownerController performSegueWithIdentifier:kMapToCategorySelectorSegue sender:nil]; - else - [ownerController.alertController presentIncorrectFeauturePositionAlert]; - - [self didFinishAddingPlace]; - } - cancelBlock:^{ - [self didFinishAddingPlace]; - }]; - [ownerController setNeedsStatusBarAppearanceUpdate]; -} - #pragma mark - MWMNavigationDashboardManager - (void)setDisableStandbyOnRouteFollowing:(BOOL)disableStandbyOnRouteFollowing { @@ -197,9 +145,9 @@ - (void)setDisableStandbyOnRouteFollowing:(BOOL)disableStandbyOnRouteFollowing { - (void)onSearchManagerStateChanged { auto state = [MWMSearchManager manager].state; if (!IPAD && state == MWMSearchManagerStateHidden) { - self.hidden = NO; +// self.hidden = NO; } else if (state != MWMSearchManagerStateHidden) { - [self hideGuidesNavigationBar]; + // [self hideGuidesNavigationBar]; } } @@ -229,21 +177,21 @@ - (void)onRouteReady:(BOOL)hasWarnings { } - (void)onRouteStart { - self.hidden = NO; - self.sideButtons.zoomHidden = self.zoomHidden; - self.sideButtonsHidden = NO; +// self.hidden = NO; +// self.sideButtons.zoomHidden = self.zoomHidden; +// self.sideButtonsHidden = NO; self.disableStandbyOnRouteFollowing = YES; - self.trafficButtonHidden = YES; +// self.trafficButtonHidden = YES; [self.navigationManager onRouteStart]; self.promoButton.hidden = YES; } - (void)onRouteStop { self.searchManager.state = MWMSearchManagerStateHidden; - self.sideButtons.zoomHidden = self.zoomHidden; +// self.sideButtons.zoomHidden = self.zoomHidden; [self.navigationManager onRouteStop]; self.disableStandbyOnRouteFollowing = NO; - self.trafficButtonHidden = NO; +// self.trafficButtonHidden = NO; self.promoButton.hidden = _promoDiscoveryCampaign.hasBeenActivated; } @@ -258,29 +206,6 @@ - (UIButton *)promoButton { return _promoButton; } -- (MWMSideButtons *)sideButtons { - if (!_sideButtons) - _sideButtons = [[MWMSideButtons alloc] initWithParentView:self.ownerController.controlsView]; - return _sideButtons; -} - -- (MWMTrafficButtonViewController *)trafficButton { - if (!_trafficButton) - _trafficButton = [[MWMTrafficButtonViewController alloc] init]; - return _trafficButton; -} - -- (BottomTabBarViewController *)tabBarController { - if (!_tabBarController) { - _tabBarController = [BottomTabBarBuilder buildWithMapViewController:_ownerController controlsManager:self]; - [self.ownerController addChildViewController:_tabBarController]; - UIView *tabBarViewSuperView = self.ownerController.controlsView; - [tabBarViewSuperView addSubview:_tabBarController.view]; - } - - return _tabBarController; -} - - (id)placePageManager { if (!_placePageManager) _placePageManager = [[MWMPlacePageManager alloc] init]; @@ -303,91 +228,8 @@ - (MWMSearchManager *)searchManager { @synthesize menuState = _menuState; -- (void)setHidden:(BOOL)hidden { - if (_hidden == hidden) - return; - _hidden = hidden; - self.sideButtonsHidden = _sideButtonsHidden; - self.trafficButtonHidden = _trafficButtonHidden; - self.menuState = _menuState; -} - -- (void)setZoomHidden:(BOOL)zoomHidden { - _zoomHidden = zoomHidden; - self.sideButtons.zoomHidden = zoomHidden; -} - -- (void)setSideButtonsHidden:(BOOL)sideButtonsHidden { - _sideButtonsHidden = sideButtonsHidden; - self.sideButtons.hidden = self.hidden || sideButtonsHidden; -} - -- (void)setTrafficButtonHidden:(BOOL)trafficButtonHidden { - BOOL const isNavigation = self.navigationManager.state == MWMNavigationDashboardStateNavigation; - _trafficButtonHidden = isNavigation || trafficButtonHidden; - self.trafficButton.hidden = self.hidden || _trafficButtonHidden; -} - -- (void)showGuidesNavigationBar:(MWMMarkGroupID)categoryId { - if (!_guidesNavigationBar) { - MapViewController *parentViewController = self.ownerController; - _guidesNavigationBar = [[GuidesNavigationBarViewController alloc] initWithCategoryId:categoryId]; - [parentViewController addChildViewController:_guidesNavigationBar]; - [parentViewController.controlsView addSubview:_guidesNavigationBar.view]; - [_guidesNavigationBar configLayout]; - _guidesNavigationBarHidden = YES; - self.menuState = MWMBottomMenuStateHidden; - } -} - -- (void)hideGuidesNavigationBar { - if (_guidesNavigationBar) { - [_guidesNavigationBar removeFromParentViewController]; - [_guidesNavigationBar.view removeFromSuperview]; - _guidesNavigationBar = nil; - _guidesNavigationBarHidden = NO; - self.menuState = _menuRestoreState; - } -} - - (void)setMenuState:(MWMBottomMenuState)menuState { _menuState = menuState; - switch (_menuState) { - case MWMBottomMenuStateActive: - _tabBarController.isHidden = NO; - if (_menuController == nil) { - _menuController = [BottomMenuBuilder buildMenuWithMapViewController:_ownerController - controlsManager:self - delegate:self]; - [_ownerController presentViewController:_menuController animated:YES completion:nil]; - } - break; - case MWMBottomMenuStateLayers: - _tabBarController.isHidden = NO; - if (_menuController == nil) { - _menuController = [BottomMenuBuilder buildLayersWithMapViewController:_ownerController - controlsManager:self - delegate:self]; - [_ownerController presentViewController:_menuController animated:YES completion:nil]; - } - break; - case MWMBottomMenuStateInactive: - _tabBarController.isHidden = NO; - if (_menuController != nil) { - [_menuController dismissViewControllerAnimated:YES completion:nil]; - _menuController = nil; - } - break; - case MWMBottomMenuStateHidden: - _tabBarController.isHidden = YES; - if (_menuController != nil) { - [_menuController dismissViewControllerAnimated:YES completion:nil]; - _menuController = nil; - } - break; - default: - break; - } } #pragma mark - MWMFeatureHolder @@ -396,168 +238,4 @@ - (void)setMenuState:(MWMBottomMenuState)menuState { return self.placePageManager; } -- (MWMTutorialViewController *)tutorialWithType:(MWMTip)tutorialType { - MWMTutorialViewController *tutorial; - switch (tutorialType) { - case MWMTipSearch: - tutorial = [MWMTutorialViewController tutorial:MWMTutorialTypeSearch - target:self.tabBarController.searchButton - delegate:self]; - break; - case MWMTipDiscovery: - tutorial = [MWMTutorialViewController tutorial:MWMTutorialTypeDiscovery - target:self.tabBarController.discoveryButton - delegate:self]; - break; - case MWMTipBookmarks: - tutorial = [MWMTutorialViewController tutorial:MWMTutorialTypeBookmarks - target:self.tabBarController.bookmarksButton - delegate:self]; - break; - case MWMTipSubway: - tutorial = [MWMTutorialViewController tutorial:MWMTutorialTypeSubway - target:(UIControl *)self.trafficButton.view - delegate:self]; - break; - case MWMTipIsolines: - tutorial = [MWMTutorialViewController tutorial:MWMTutorialTypeIsolines - target:(UIControl *)self.trafficButton.view - delegate:self]; - break; - case MWMTipNone: - tutorial = nil; - break; - } - - return tutorial; -} - -- (void)showAdditionalViewsIfNeeded { - auto ownerController = self.ownerController; - - if ([MWMRouter isRoutingActive] || [MWMRouter hasSavedRoute]) - return; - - if (self.searchManager.state != MWMSearchManagerStateHidden) - return; - - if (self.menuState != MWMBottomMenuStateInactive) - return; - - if (ownerController.navigationController.viewControllers.count > 1) - return; - - if (DeepLinkHandler.shared.isLaunchedByDeeplink) - return; - - if ([self showPromoBookingIfNeeded]) - return; - - [self showTutorialIfNeeded]; -} - -- (BOOL)showPromoBookingIfNeeded { - PromoAfterBookingCampaign *afterBookingCampaign = [ABTestManager manager].promoAfterBookingCampaign; - PromoAfterBookingData *afterBookingData = afterBookingCampaign.afterBookingData; - if (!afterBookingData.enabled) - return NO; - - MWMVoidBlock ok = ^{ - auto urlString = afterBookingData.promoUrl; - auto url = [NSURL URLWithString:urlString]; - [MapViewController.sharedController openCatalogAbsoluteUrl:url animated:YES utm:MWMUTMBookingPromo]; - - [self.ownerController dismissViewControllerAnimated:YES completion:nil]; - }; - MWMVoidBlock cancel = ^{ - [self.ownerController dismissViewControllerAnimated:YES completion:nil]; - }; - NSString *cityImageUrl = afterBookingData.pictureUrl; - PromoAfterBookingViewController *alert; - alert = [[PromoAfterBookingViewController alloc] initWithCityImageUrl:cityImageUrl okClosure:ok cancelClosure:cancel]; - [self.ownerController presentViewController:alert animated:YES completion:nil]; - [MWMEye promoAfterBookingShownWithCityId:afterBookingData.promoId]; - return YES; -} - -- (BOOL)showTutorialIfNeeded { - if (self.tutorialViewContoller != nil) - return YES; - - auto ownerController = self.ownerController; - - if ([self.placePageManager isPPShown] || ownerController.downloadDialog.superview != nil) { - return NO; - } - - self.tutorialType = [MWMEye getTipType]; - self.tutorialViewContoller = [self tutorialWithType:self.tutorialType]; - if (!self.tutorialViewContoller) - return NO; - - [self logTutorialEvent:kStatTipsTricksShow additionalOptions:nil]; - self.hidden = NO; - [ownerController addChildViewController:self.tutorialViewContoller]; - self.tutorialViewContoller.view.frame = ownerController.view.bounds; - self.tutorialViewContoller.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [ownerController.controlsView addSubview:self.tutorialViewContoller.view]; - [self.tutorialViewContoller didMoveToParentViewController:ownerController]; - - return YES; -} - -- (void)didPressCancel:(MWMTutorialViewController *)viewController { - [self logTutorialEvent:kStatTipsTricksClose additionalOptions:@{kStatOption: kStatGotIt}]; - [MWMEye tipClickedWithType:self.tutorialType event:MWMTipEventGotIt]; - [self fadeOutTutorial:viewController]; -} - -- (void)didPressTarget:(MWMTutorialViewController *)viewController { - [self logTutorialEvent:kStatTipsTricksClick additionalOptions:nil]; - [MWMEye tipClickedWithType:self.tutorialType event:MWMTipEventAction]; - [self fadeOutTutorial:viewController]; -} - -- (void)didPressOnScreen:(MWMTutorialViewController *)viewController { - [self logTutorialEvent:kStatTipsTricksClose additionalOptions:@{kStatOption: kStatOffscreen}]; -} - -- (void)fadeOutTutorial:(MWMTutorialViewController *)viewController { - [viewController fadeOutWithCompletion:^{ - [viewController willMoveToParentViewController:nil]; - [viewController.view removeFromSuperview]; - [viewController removeFromParentViewController]; - }]; - self.tutorialViewContoller = nil; -} - -- (void)logTutorialEvent:(NSString *)eventName additionalOptions:(NSDictionary *)options { - MWMTip type = self.tutorialType; - NSNumber *statTutorialType; - switch (type) { - case MWMTipSearch: - statTutorialType = @1; - break; - case MWMTipDiscovery: - statTutorialType = @2; - break; - case MWMTipBookmarks: - statTutorialType = @0; - break; - case MWMTipSubway: - statTutorialType = @3; - break; - case MWMTipIsolines: - statTutorialType = @4; - break; - case MWMTipNone: - return; - } - NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:statTutorialType forKey:kStatType]; - if (options != nil) { - [params addEntriesFromDictionary:options]; - } - [Statistics logEvent:eventName withParameters:params]; -} - @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/SideButtons/MWMSideButtons.h b/iphone/Maps/Classes/CustomViews/MapViewControls/SideButtons/MWMSideButtons.h index adc10907c8d..af800895156 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/SideButtons/MWMSideButtons.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/SideButtons/MWMSideButtons.h @@ -1,4 +1,3 @@ -#import "MWMMyPositionMode.h" @interface MWMSideButtons : NSObject diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.h b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.h deleted file mode 100644 index f17ca3efc08..00000000000 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.h +++ /dev/null @@ -1,11 +0,0 @@ -#import "MWMViewController.h" - -@interface MWMTrafficButtonViewController : MWMViewController - -+ (MWMTrafficButtonViewController *)controller; - -@property(nonatomic) BOOL hidden; - -+ (void)updateAvailableArea:(CGRect)frame; - -@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm deleted file mode 100644 index e2a1d1a3066..00000000000 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm +++ /dev/null @@ -1,234 +0,0 @@ -#import "MWMTrafficButtonViewController.h" - -#import - -#import "MWMAlertViewController.h" -#import "MWMButton.h" -#import "MWMMapViewControlsCommon.h" -#import "MWMMapViewControlsManager.h" -#import "MapViewController.h" -#import "SwiftBridge.h" -#import "base/assert.hpp" - -namespace { -CGFloat const kTopOffset = 6; - -NSArray *imagesWithName(NSString *name) { - NSUInteger const imagesCount = 3; - NSMutableArray *images = [NSMutableArray arrayWithCapacity:imagesCount]; - NSString *mode = [UIColor isNightMode] ? @"dark" : @"light"; - for (NSUInteger i = 1; i <= imagesCount; i += 1) { - NSString *imageName = [NSString stringWithFormat:@"%@_%@_%@", name, mode, @(i).stringValue]; - [images addObject:static_cast([UIImage imageNamed:imageName])]; - } - return [images copy]; -} -} // namespace - -@interface MWMMapViewControlsManager () - -@property(nonatomic) MWMTrafficButtonViewController *trafficButton; - -@end - -@interface MWMTrafficButtonViewController () - -@property(nonatomic) NSLayoutConstraint *topOffset; -@property(nonatomic) NSLayoutConstraint *leftOffset; -@property(nonatomic) CGRect availableArea; - -@end - -@implementation MWMTrafficButtonViewController - -+ (MWMTrafficButtonViewController *)controller { - return [MWMMapViewControlsManager manager].trafficButton; -} - -- (instancetype)init { - self = [super init]; - if (self) { - MapViewController *ovc = [MapViewController sharedController]; - [ovc addChildViewController:self]; - [ovc.controlsView addSubview:self.view]; - [self configLayout]; - [self applyTheme]; - [StyleManager.shared addListener:self]; - [MWMMapOverlayManager addObserver:self]; - } - return self; -} - -- (void)dealloc { - [StyleManager.shared removeListener:self]; -} - -- (void)configLayout { - UIView *sv = self.view; - UIView *ov = sv.superview; - - self.topOffset = [sv.topAnchor constraintEqualToAnchor:ov.topAnchor constant:kTopOffset]; - self.topOffset.active = YES; - self.leftOffset = [sv.leadingAnchor constraintEqualToAnchor:ov.leadingAnchor constant:kViewControlsOffsetToBounds]; - self.leftOffset.active = YES; -} - -- (void)setHidden:(BOOL)hidden { - _hidden = hidden; - [self refreshLayout]; -} - -- (void)refreshLayout { - dispatch_async(dispatch_get_main_queue(), ^{ - auto const availableArea = self.availableArea; - auto const leftOffset = self.hidden ? -self.view.width : availableArea.origin.x + kViewControlsOffsetToBounds; - [self.view.superview animateConstraintsWithAnimations:^{ - self.topOffset.constant = availableArea.origin.y + kTopOffset; - self.leftOffset.constant = leftOffset; - self.view.alpha = self.hidden ? 0 : 1; - }]; - }); -} - -- (void)handleTrafficState:(MWMMapOverlayTrafficState)state { - MWMButton *btn = (MWMButton *)self.view; - UIImageView *iv = btn.imageView; - switch (state) { - case MWMMapOverlayTrafficStateDisabled: - CHECK(false, ("Incorrect traffic manager state.")); - break; - case MWMMapOverlayTrafficStateEnabled: - btn.imageName = @"btn_traffic_on"; - break; - case MWMMapOverlayTrafficStateWaitingData: - iv.animationImages = imagesWithName(@"btn_traffic_update"); - iv.animationDuration = 0.8; - [iv startAnimating]; - break; - case MWMMapOverlayTrafficStateOutdated: - btn.imageName = @"btn_traffic_outdated"; - break; - case MWMMapOverlayTrafficStateNoData: - btn.imageName = @"btn_traffic_on"; - [[MWMToast toastWithText:L(@"traffic_data_unavailable")] show]; - break; - case MWMMapOverlayTrafficStateNetworkError: - [MWMMapOverlayManager setTrafficEnabled:NO]; - [[MWMAlertViewController activeAlertController] presentNoConnectionAlert]; - break; - case MWMMapOverlayTrafficStateExpiredData: - btn.imageName = @"btn_traffic_outdated"; - [[MWMToast toastWithText:L(@"traffic_update_maps_text")] show]; - break; - case MWMMapOverlayTrafficStateExpiredApp: - btn.imageName = @"btn_traffic_outdated"; - [[MWMToast toastWithText:L(@"traffic_update_app_message")] show]; - break; - } -} - -- (void)handleGuidesState:(MWMMapOverlayGuidesState)state { - switch (state) { - case MWMMapOverlayGuidesStateDisabled: - case MWMMapOverlayGuidesStateEnabled: - break; - case MWMMapOverlayGuidesStateHasData: - performOnce(^{ - [[MWMToast toastWithText:L(@"routes_layer_is_on_toast")] showWithAlignment:MWMToastAlignmentTop]; - }, @"routes_layer_is_on_toast"); - break; - case MWMMapOverlayGuidesStateNetworkError: - [[MWMToast toastWithText:L(@"connection_error_toast_guides")] show]; - break; - case MWMMapOverlayGuidesStateFatalNetworkError: - [MWMMapOverlayManager setGuidesEnabled:NO]; - [[MWMAlertViewController activeAlertController] presentNoConnectionAlert]; - break; - case MWMMapOverlayGuidesStateNoData: - [[MWMToast toastWithText:L(@"no_routes_in_the_area_toast")] show]; - break; - } -} - -- (void)handleIsolinesState:(MWMMapOverlayIsolinesState)state { - switch (state) { - case MWMMapOverlayIsolinesStateDisabled: - break; - case MWMMapOverlayIsolinesStateEnabled: - if (![MWMMapOverlayManager isolinesVisible]) { - [[MWMToast toastWithText:L(@"isolines_toast_zooms_1_10")] show]; - [Statistics logEvent:kStatMapToastShow withParameters:@{kStatType: kStatIsolines}]; - } - break; - case MWMMapOverlayIsolinesStateExpiredData: - [MWMAlertViewController.activeAlertController presentInfoAlert:L(@"isolines_activation_error_dialog")]; - [MWMMapOverlayManager setIsoLinesEnabled:NO]; - break; - case MWMMapOverlayIsolinesStateNoData: - [MWMAlertViewController.activeAlertController presentInfoAlert:L(@"isolines_location_error_dialog")]; - [MWMMapOverlayManager setIsoLinesEnabled:NO]; - break; - } -} - -- (void)applyTheme { - MWMButton *btn = static_cast(self.view); - UIImageView *iv = btn.imageView; - - // Traffic state machine: https://confluence.mail.ru/pages/viewpage.action?pageId=103680959 - [iv stopAnimating]; - if ([MWMMapOverlayManager trafficEnabled]) { - [self handleTrafficState:[MWMMapOverlayManager trafficState]]; - } else if ([MWMMapOverlayManager transitEnabled]) { - btn.imageName = @"btn_subway_on"; - if ([MWMMapOverlayManager transitState] == MWMMapOverlayTransitStateNoData) - [[MWMToast toastWithText:L(@"subway_data_unavailable")] show]; - } else if ([MWMMapOverlayManager isoLinesEnabled]) { - btn.imageName = @"btn_isoMap_on"; - [self handleIsolinesState:[MWMMapOverlayManager isolinesState]]; - } else if ([MWMMapOverlayManager guidesEnabled]) { - btn.imageName = @"btn_layers_off"; - [self handleGuidesState:[MWMMapOverlayManager guidesState]]; - } else { - btn.imageName = @"btn_layers"; - } -} - -- (IBAction)buttonTouchUpInside { - if ([MWMMapOverlayManager trafficEnabled]) { - [MWMMapOverlayManager setTrafficEnabled:NO]; - } else if ([MWMMapOverlayManager transitEnabled]) { - [MWMMapOverlayManager setTransitEnabled:NO]; - } else if ([MWMMapOverlayManager isoLinesEnabled]) { - [MWMMapOverlayManager setIsoLinesEnabled:NO]; - } else if ([MWMMapOverlayManager guidesEnabled]) { - [MWMMapOverlayManager setGuidesEnabled:NO]; - } else { - MWMMapViewControlsManager.manager.menuState = MWMBottomMenuStateLayers; - } -} - -+ (void)updateAvailableArea:(CGRect)frame { - auto controller = [self controller]; - if (CGRectEqualToRect(controller.availableArea, frame)) - return; - controller.availableArea = frame; - [controller refreshLayout]; -} - -#pragma mark - MWMMapOverlayManagerObserver - -- (void)onTrafficStateUpdated { - [self applyTheme]; -} -- (void)onTransitStateUpdated { - [self applyTheme]; -} -- (void)onIsoLinesStateUpdated { - [self applyTheme]; -} -- (void)onGuidesStateUpdated { - [self applyTheme]; -} - -@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/TrafficButtonViewController.swift b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/TrafficButtonViewController.swift new file mode 100644 index 00000000000..9400a342f07 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/TrafficButtonViewController.swift @@ -0,0 +1,165 @@ +final class TrafficButtonViewController: MWMViewController { + private enum Const { + static let lightAnimationImages = [UIImage(named: "btn_traffic_update_light_1")!, + UIImage(named: "btn_traffic_update_light_2")!, + UIImage(named: "btn_traffic_update_light_3")!] + static let darkAnimationImages = [UIImage(named: "btn_traffic_update_dark_1")!, + UIImage(named: "btn_traffic_update_dark_2")!, + UIImage(named: "btn_traffic_update_dark_3")!] + } + + typealias ShowMenuClosure = () -> Void + let showMenuHandler: ShowMenuClosure + + init(showMenuHandler: @escaping ShowMenuClosure) { + self.showMenuHandler = showMenuHandler + + super.init(nibName: nil, bundle: nil) + + MapOverlayManager.add(self) + StyleManager.shared.addListener(self) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + deinit { + MapOverlayManager.remove(self) + StyleManager.shared.removeListener(self) + } + + override func viewDidLoad() { + super.viewDidLoad() + + applyTheme() + } + + @IBAction func onTrafficButton(_ sender: UIButton) { + if MapOverlayManager.trafficEnabled() { + MapOverlayManager.setTrafficEnabled(false) + } else if MapOverlayManager.transitEnabled() { + MapOverlayManager.setTransitEnabled(false) + } else if MapOverlayManager.isoLinesEnabled() { + MapOverlayManager.setIsoLinesEnabled(false) + } else if MapOverlayManager.guidesEnabled() { + MapOverlayManager.setGuidesEnabled(false) + } else { + showMenuHandler() + } + } + + private func handleTrafficState(_ state: MapOverlayTrafficState) { + let btn = self.view as! MWMButton + + switch state { + case .disabled: + fatalError("Incorrect traffic manager state.") + case .enabled: + btn.imageName = "btn_traffic_on"; + case .waitingData: + let iv = btn.imageView + iv?.animationImages = UIColor.isNightMode() ? Const.darkAnimationImages : Const.lightAnimationImages + iv?.animationDuration = 0.8 + iv?.startAnimating() + case .outdated: + btn.imageName = "btn_traffic_outdated"; + case .noData: + btn.imageName = "btn_traffic_on"; + Toast.toast(withText: "traffic_data_unavailable").show() + case .networkError: + MapOverlayManager.setTrafficEnabled(false) + MWMAlertViewController.activeAlert().presentNoConnectionAlert() + case .expiredData: + btn.imageName = "btn_traffic_outdated"; + Toast.toast(withText: "traffic_update_maps_text").show() + case .expiredApp: + btn.imageName = "btn_traffic_outdated"; + Toast.toast(withText: "traffic_update_app_message").show() + @unknown default: + fatalError() + } + } + + private func handleIsolinesState(_ state: MapOverlayIsolinesState) { + switch state { + case .disabled: + break + case .enabled: + if !MapOverlayManager.isolinesVisible() { + Toast.toast(withText: "isolines_toast_zooms_1_10").show() + Statistics.logEvent(kStatMapToastShow, withParameters: [kStatType: kStatIsolines]) + } + case .expiredData: + MWMAlertViewController.activeAlert().presentInfoAlert("isolines_activation_error_dialog") + MapOverlayManager.setIsoLinesEnabled(false) + case .noData: + MWMAlertViewController.activeAlert().presentInfoAlert("isolines_location_error_dialog") + MapOverlayManager.setIsoLinesEnabled(false) + @unknown default: + fatalError() + } + } + + private func hanldeGuidesState(_ state: MapOverlayGuidesState) { + switch state { + case .disabled, .enabled: + break + case .hasData: + performOnce({ + Toast.toast(withText: "routes_layer_is_on_toast").show(withAlignment: .top) + }, "routes_layer_is_on_toast") + case .networkError: + Toast.toast(withText: "connection_error_toast_guides").show() + case .fatalNetworkError: + MapOverlayManager.setGuidesEnabled(false) + MWMAlertViewController.activeAlert().presentNoConnectionAlert() + case .noData: + Toast.toast(withText: "no_routes_in_the_area_toast").show() + @unknown default: + fatalError() + } + } +} + +extension TrafficButtonViewController: MapOverlayManagerObserver { + func onTrafficStateUpdated() { + applyTheme() + } + + func onGuidesStateUpdated() { + applyTheme() + } + + func onTransitStateUpdated() { + applyTheme() + } + + func onIsoLinesStateUpdated() { + applyTheme() + } +} + +extension TrafficButtonViewController: ThemeListener { + override func applyTheme() { + let btn = self.view as! MWMButton + btn.imageView?.stopAnimating() + + if MapOverlayManager.trafficEnabled() { + handleTrafficState(MapOverlayManager.trafficState()) + } else if MapOverlayManager.transitEnabled() { + btn.imageName = "btn_subway_on"; + if MapOverlayManager.transitState() == .noData { + Toast.toast(withText: "subway_data_unavailable").show() + } + } else if MapOverlayManager.isoLinesEnabled() { + btn.imageName = "btn_isoMap_on"; + handleIsolinesState(MapOverlayManager.isolinesState()) + } else if MapOverlayManager.guidesEnabled() { + btn.imageName = "btn_layers_off"; + hanldeGuidesState(MapOverlayManager.guidesState()) + } else { + btn.imageName = "btn_layers"; + } + } +} diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/TrafficButtonViewController.xib similarity index 82% rename from iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.xib rename to iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/TrafficButtonViewController.xib index 044bc865887..b7b64749fd5 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/TrafficButtonViewController.xib @@ -1,16 +1,14 @@ - - - - + + - + - + @@ -18,15 +16,15 @@ diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm index 0d152ac531a..dab4d06817a 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm @@ -1,7 +1,6 @@ #import "MWMNavigationInfoView.h" #import "CLLocation+Mercator.h" #import "MWMButton.h" -#import "MWMLocationHelpers.h" #import "MWMLocationManager.h" #import "MWMLocationObserver.h" #import "MWMMapViewControlsCommon.h" diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib index 22e9cf29597..4bf7466fdb4 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib @@ -1,7 +1,9 @@ - + + - + + @@ -30,7 +32,7 @@ - + @@ -54,8 +56,8 @@ - + @@ -385,7 +388,6 @@ - diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationAddPointToastView.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationAddPointToastView.swift index 00e5c98d716..0c596d22d20 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationAddPointToastView.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationAddPointToastView.swift @@ -21,6 +21,4 @@ final class NavigationAddPointToastView: UIView { } override var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { return .bottom } - - override var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections { return .bottom } } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.swift index dd78d9dc51a..d1693c380cd 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.swift @@ -279,10 +279,6 @@ final class NavigationControlView: SolidTouchView, MWMTextToSpeechObserver, MapO onTTSStatusUpdated() } - override var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections { - return .bottom - } - override var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: .bottom, iPad: []) } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationStreetNameView.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationStreetNameView.swift deleted file mode 100644 index 86e3df7d503..00000000000 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationStreetNameView.swift +++ /dev/null @@ -1,13 +0,0 @@ -final class NavigationStreetNameView: SolidTouchView { - override var visibleAreaAffectDirections: MWMAvailableAreaAffectDirections { - return alternative(iPhone: [], iPad: .top) - } - - override var placePageAreaAffectDirections: MWMAvailableAreaAffectDirections { - return alternative(iPhone: [], iPad: .top) - } - - override var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections { - return .top - } -} diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationTurnsView.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationTurnsView.swift deleted file mode 100644 index 086140448ff..00000000000 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationTurnsView.swift +++ /dev/null @@ -1,3 +0,0 @@ -final class NavigationTurnsView: UIView { - override var placePageAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: [], iPad: .left) } -} diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPadRoutePreview.m b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPadRoutePreview.m index cb2ff5d2b8e..5214c859c53 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPadRoutePreview.m +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPadRoutePreview.m @@ -52,13 +52,6 @@ - (MWMAvailableAreaAffectDirections)visibleAreaAffectDirections return MWMAvailableAreaAffectDirectionsLeft; } -#pragma mark - AvailableArea / PlacePageArea - -- (MWMAvailableAreaAffectDirections)placePageAreaAffectDirections -{ - return MWMAvailableAreaAffectDirectionsLeft; -} - #pragma mark - AvailableArea / WidgetsArea - (MWMAvailableAreaAffectDirections)widgetsAreaAffectDirections @@ -66,25 +59,4 @@ - (MWMAvailableAreaAffectDirections)widgetsAreaAffectDirections return MWMAvailableAreaAffectDirectionsLeft; } -#pragma mark - AvailableArea / SideButtonsArea - -- (MWMAvailableAreaAffectDirections)sideButtonsAreaAffectDirections -{ - return MWMAvailableAreaAffectDirectionsLeft; -} - -#pragma mark - AvailableArea / TrafficButtonArea - -- (MWMAvailableAreaAffectDirections)trafficButtonAreaAffectDirections -{ - return MWMAvailableAreaAffectDirectionsLeft; -} - -#pragma mark - AvailableArea / NavigationInfoArea - -- (MWMAvailableAreaAffectDirections)navigationInfoAreaAffectDirections -{ - return MWMAvailableAreaAffectDirectionsLeft; -} - @end diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPhoneRoutePreview.m b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPhoneRoutePreview.m index c773e1cbe72..40bdf452da4 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPhoneRoutePreview.m +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPhoneRoutePreview.m @@ -54,18 +54,4 @@ - (MWMAvailableAreaAffectDirections)visibleAreaAffectDirections return MWMAvailableAreaAffectDirectionsTop; } -#pragma mark - AvailableArea / SideButtonsArea - -- (MWMAvailableAreaAffectDirections)sideButtonsAreaAffectDirections -{ - return MWMAvailableAreaAffectDirectionsTop; -} - -#pragma mark - AvailableArea / TrafficButtonArea - -- (MWMAvailableAreaAffectDirections)trafficButtonAreaAffectDirections -{ - return MWMAvailableAreaAffectDirectionsTop; -} - @end diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus/BaseRoutePreviewStatus.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus/BaseRoutePreviewStatus.swift index 207c751182d..7c3bf889f42 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus/BaseRoutePreviewStatus.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus/BaseRoutePreviewStatus.swift @@ -195,14 +195,6 @@ final class BaseRoutePreviewStatus: SolidTouchView { arriveLabel?.text = String(coreFormat: L("routing_arrive"), arguments: [info.arrival]) } - override var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections { - return .bottom - } - - override var visibleAreaAffectDirections: MWMAvailableAreaAffectDirections { - return .bottom - } - override var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { return .bottom } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus/TransportRoutePreviewStatus.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus/TransportRoutePreviewStatus.swift index ca84a6a045e..ed8441a9aae 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus/TransportRoutePreviewStatus.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewStatus/TransportRoutePreviewStatus.swift @@ -91,14 +91,6 @@ final class TransportRoutePreviewStatus: SolidTouchView { updateHeight() } - override var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections { - return .bottom - } - - override var visibleAreaAffectDirections: MWMAvailableAreaAffectDirections { - return .bottom - } - override var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { return .bottom } diff --git a/iphone/Maps/Classes/MapControlsViewControls/MapControlsBuilder.swift b/iphone/Maps/Classes/MapControlsViewControls/MapControlsBuilder.swift new file mode 100644 index 00000000000..934c279fb07 --- /dev/null +++ b/iphone/Maps/Classes/MapControlsViewControls/MapControlsBuilder.swift @@ -0,0 +1,14 @@ +import Foundation + +@objc final class MapControlsBuilder: NSObject { + @objc static func build(bookmarksCoordinator: BookmarksCoordinator?) -> MapControlsViewController { + let mapViewController = MapViewController.shared()! + let viewController = mapViewController.storyboard!.instantiateViewController(ofType: MapControlsViewController.self) + bookmarksCoordinator?.mapControlsViewController = viewController + let interactor = MapControlsInteractor() + let router = MapControlsRouter(mapViewController, bookmarksCoordinator: bookmarksCoordinator) + let presenter = MapControlsPresenter(view: viewController, interactor: interactor, router: router) + viewController.presenter = presenter + return viewController + } +} diff --git a/iphone/Maps/Classes/MapControlsViewControls/MapControlsInteractor.swift b/iphone/Maps/Classes/MapControlsViewControls/MapControlsInteractor.swift new file mode 100644 index 00000000000..daa163a6942 --- /dev/null +++ b/iphone/Maps/Classes/MapControlsViewControls/MapControlsInteractor.swift @@ -0,0 +1,45 @@ +final class MapControlsInteractor { + private var locationModeCallback: MyPositionModeChangedClosure? + + init() { + FrameworkHelper.shared().addLocationModeListener(self) + } + + deinit { + FrameworkHelper.shared().removeLocationModeListener(self) + } +} + +extension MapControlsInteractor: LocationModeListener { + func processMyPositionStateModeEvent(_ mode: MyPositionMode) { + locationModeCallback?(mode) + } + + func processMyPositionPendingTimeout() {} +} + +extension MapControlsInteractor: IMapControlsInteractor { + func setPlacePageSelectedCallback(_ selected: @escaping MapObjectSelectedClosure, + deselectedCallback: @escaping MapObjectDeselectedClosure, + updatedCallback: @escaping MapObjectUpdatedClosure) { + FrameworkHelper.shared().setPlacePageSelectedCallback(selected, + deselectedCallback: deselectedCallback, + updatedCallback: updatedCallback) + } + + func setMyPositionModeCallback(_ callback: @escaping MyPositionModeChangedClosure) { + locationModeCallback = callback + } + + func zoomIn() { + FrameworkHelper.shared().zoomMap(.in) + } + + func zoomOut() { + FrameworkHelper.shared().zoomMap(.out) + } + + func switchMyPositionMode() { + FrameworkHelper.shared().switchMyPositionMode() + } +} diff --git a/iphone/Maps/Classes/MapControlsViewControls/MapControlsInterfaces.swift b/iphone/Maps/Classes/MapControlsViewControls/MapControlsInterfaces.swift new file mode 100644 index 00000000000..34687a1ec61 --- /dev/null +++ b/iphone/Maps/Classes/MapControlsViewControls/MapControlsInterfaces.swift @@ -0,0 +1,61 @@ +protocol IMapControlsView: AnyObject { + func showMenu(_ mode: MapControlsMenuMode) + func showPlacePage() + func hidePlacePage() + func updatePlacePage() + func setSideButtonsVisible(_ visible: Bool) + func setLayersButtonVisible(_ visible: Bool) + func showTutorialType(_ tutorialType: TipType) + func hideTutorial() + func showAfterBoooking(_ data: PromoAfterBookingData) + func setLocationButtonMode(_ mode: MyPositionMode) +} + +protocol IMapControlsPresenter { + func viewDidLoad() + func zoomIn() + func zoomOut() + func switchMyPosition() + func search() + func route() + func discovery() + func bookmarks() + func menu() + func layers() + func hideMenu() + func showAdditionalViews() + func onTutorialTarget() + func onTutorialCancel() + func onTutorialScreenTap() + func onAfterBooking() +} + +typealias MapObjectSelectedClosure = () -> Void +typealias MapObjectDeselectedClosure = (Bool) -> Void +typealias MapObjectUpdatedClosure = () -> Void +typealias MyPositionModeChangedClosure = (MyPositionMode) -> Void + +protocol IMapControlsInteractor { + func setPlacePageSelectedCallback(_ selected: @escaping MapObjectSelectedClosure, + deselectedCallback: @escaping MapObjectDeselectedClosure, + updatedCallback: @escaping MapObjectUpdatedClosure) + func setMyPositionModeCallback(_ callback: @escaping MyPositionModeChangedClosure) + func zoomIn() + func zoomOut() + func switchMyPositionMode() +} + +protocol IMapControlsRouter { + func search() + func discovery() + func bookmarks() + func openCatalogUrl(_ url: URL) +} + +enum MapControlsMenuMode { + case full + case layers + case inactive + case hidden +} + diff --git a/iphone/Maps/Classes/MapControlsViewControls/MapControlsPresenter.swift b/iphone/Maps/Classes/MapControlsViewControls/MapControlsPresenter.swift new file mode 100644 index 00000000000..e811abe302c --- /dev/null +++ b/iphone/Maps/Classes/MapControlsViewControls/MapControlsPresenter.swift @@ -0,0 +1,190 @@ +final class MapControlsPresenter { + private unowned let view: IMapControlsView + private let interactor: IMapControlsInteractor + private let router: IMapControlsRouter + + private var menuMode: MapControlsMenuMode = .inactive + private var previousMenuMode: MapControlsMenuMode = .inactive + private var tipType: TipType = .none + private var afterBookingData: PromoAfterBookingData? + + private var isPoint2PointSelected = false + + private var allButtonsVisible: Bool = true { + didSet { + layersButtonVisible = allButtonsVisible + sideButtonsVisible = allButtonsVisible + } + } + + private var sideButtonsVisible: Bool = true { + didSet { + view.setSideButtonsVisible(sideButtonsVisible) + } + } + + private var layersButtonVisible: Bool = true { + didSet { + view.setLayersButtonVisible(layersButtonVisible) + } + } + + init(view: IMapControlsView, interactor: IMapControlsInteractor, router: IMapControlsRouter) { + self.view = view + self.interactor = interactor + self.router = router + } + + private func logTutorialEvent(_ eventName: String, options: [String: Any]) { + let params = [kStatType: tipType.rawValue] + Statistics.logEvent(eventName, withParameters: params.reduce(into: options, { $0[$1.0] = $1.1 })) + } +} + +extension MapControlsPresenter: IMapControlsPresenter { + func viewDidLoad() { + interactor.setPlacePageSelectedCallback { [weak self] in + guard let self = self else { return } + self.view.hidePlacePage() + NetworkPolicy.shared().callOnlineApi { _ in + self.view.showPlacePage() + if self.allButtonsVisible { + self.layersButtonVisible = false + } + } + } deselectedCallback: { [weak self] switchFullScreen in + guard let self = self else { return } + self.view.hidePlacePage() + if self.allButtonsVisible { + self.layersButtonVisible = true + } + + let isSearchResult = MWMSearchManager.manager().state == .result + let isNavigationDashboardHidden = MWMNavigationDashboardManager.shared().state == .hidden + if isSearchResult { + if isNavigationDashboardHidden { + MWMSearchManager.manager().state = .mapSearch + } else { + MWMSearchManager.manager().state = .hidden + } + } + + if DeepLinkHandler.shared.isLaunchedByDeeplink || !switchFullScreen { + return + } + + let isSearchHidden = MWMSearchManager.manager().state == .hidden + if isSearchHidden && isNavigationDashboardHidden { + self.allButtonsVisible = !self.allButtonsVisible + } + } updatedCallback: {} + + interactor.setMyPositionModeCallback { [weak self] in self?.view.setLocationButtonMode($0) } + } + + func zoomIn() { + interactor.zoomIn() + } + + func zoomOut() { + interactor.zoomOut() + } + + func switchMyPosition() { + interactor.switchMyPositionMode() + } + + func search() { + router.search() + } + + func route() { + isPoint2PointSelected.toggle() + MWMRouter.enableAutoAddLastLocation(false) + if (isPoint2PointSelected) { + MWMMapViewControlsManager.manager().onRoutePrepare() + } else { + MWMRouter.stopRouting() + } + } + + func discovery() { + router.discovery() + } + + func bookmarks() { + router.bookmarks() + } + + func menu() { + if menuMode == .inactive { + menuMode = .full + view.showMenu(.full) + } else { + menuMode = .inactive + view.showMenu(.inactive) + } + } + + func layers() { + menuMode = .layers + view.showMenu(.layers) + } + + func hideMenu() { + menuMode = previousMenuMode + view.showMenu(menuMode) + } + + func showAdditionalViews() { + if MWMRouter.isRoutingActive() || MWMRouter.hasSavedRoute() { + return + } + + if MWMSearchManager.manager().state != .hidden { + return + } + + if menuMode != .inactive { + return + } + + if DeepLinkHandler.shared.isLaunchedByDeeplink { + return + } + + afterBookingData = ABTestManager.manager().promoAfterBookingCampaign.afterBookingData + if afterBookingData!.enabled { + view.showAfterBoooking(afterBookingData!) + MWMEye.promoAfterBookingShown(withCityId: afterBookingData!.promoId) + return + } + + tipType = MWMEye.getTipType() + if tipType != .none { + allButtonsVisible = true + view.showTutorialType(tipType) + } + } + + func onTutorialTarget() { + logTutorialEvent(kStatTipsTricksClick, options: [:]) + MWMEye.tipClicked(with: tipType, event: .action) + view.hideTutorial() + } + + func onTutorialCancel() { + logTutorialEvent(kStatTipsTricksClose, options: [kStatOption: kStatGotIt]) + MWMEye.tipClicked(with: tipType, event: .gotIt) + view.hideTutorial() + } + + func onTutorialScreenTap() { + logTutorialEvent(kStatTipsTricksClose, options: [kStatOption: kStatOffscreen]) + } + + func onAfterBooking() { + guard let afterBookingData = afterBookingData, let url = URL(string: afterBookingData.promoUrl) else { return } + router.openCatalogUrl(url) + } +} diff --git a/iphone/Maps/Classes/MapControlsViewControls/MapControlsRouter.swift b/iphone/Maps/Classes/MapControlsViewControls/MapControlsRouter.swift new file mode 100644 index 00000000000..09460f2f373 --- /dev/null +++ b/iphone/Maps/Classes/MapControlsViewControls/MapControlsRouter.swift @@ -0,0 +1,35 @@ +final class MapControlsRouter { + private let mapViewController: MapViewController + private weak var coordinator: BookmarksCoordinator? + private weak var searchManager = MWMSearchManager.manager() + + init(_ mapViewController: MapViewController, bookmarksCoordinator: BookmarksCoordinator?) { + self.mapViewController = mapViewController + self.coordinator = bookmarksCoordinator + } +} + +extension MapControlsRouter: IMapControlsRouter { + func search() { + if searchManager?.state == .hidden { + searchManager?.state = .default + } else { + searchManager?.state = .hidden + } + } + + func discovery() { + NetworkPolicy.shared().callOnlineApi { [weak self] canUseNetwork in + let vc = MWMDiscoveryController.instance(withConnection: canUseNetwork) + self?.mapViewController.navigationController?.pushViewController(vc!, animated: true) + } + } + + func bookmarks() { + coordinator?.open() + } + + func openCatalogUrl(_ url: URL) { + mapViewController.openCatalogAbsoluteUrl(url, animated: true, utm: .bookingPromo) + } +} diff --git a/iphone/Maps/Classes/MapControlsViewControls/MapControlsViewController.swift b/iphone/Maps/Classes/MapControlsViewControls/MapControlsViewController.swift new file mode 100644 index 00000000000..b9cc5d2305e --- /dev/null +++ b/iphone/Maps/Classes/MapControlsViewControls/MapControlsViewController.swift @@ -0,0 +1,391 @@ +protocol MapOverlayViewProtocol { + var bottomView: UIView { get } +} + +final class MapControlsViewController: UIViewController { + var presenter: IMapControlsPresenter! + + @IBOutlet var mapButtonsView: TouchTransparentView! + @IBOutlet var placePageContainerView: TouchTransparentView! + @IBOutlet var guidesGalleryContainerView: TouchTransparentView! + @IBOutlet var guidesVisibleConstraint: NSLayoutConstraint! + @IBOutlet var guidesHiddenConstraint: NSLayoutConstraint! + @IBOutlet var mapButtonsBottomConstraint: NSLayoutConstraint! + @IBOutlet var tabBarContainerView: UIView! + @IBOutlet var layersButtonContainerView: UIView! + @IBOutlet var layersButtonVisibleConstraint: NSLayoutConstraint! + @IBOutlet var layersButtonHiddenConstraint: NSLayoutConstraint! + @IBOutlet var sideButtonsContainerView: UIView! + @IBOutlet var sideButtonsVisibleConstraint: NSLayoutConstraint! + @IBOutlet var sideButtonsHiddenConstraint: NSLayoutConstraint! + @IBOutlet var locationButton: UIButton! + + private var placePageViewController: PlacePageViewController? + private var guidesGalleryViewController: GuidesGalleryViewController? + private var guidesNavigationBar: GuidesNavigationBarViewController? + private var menuViewController: UIViewController? + private var tutorialViewController: TutorialViewController? + + private lazy var tabBarViewController: BottomTabBarViewController = { + let contoller = BottomTabBarViewController() + contoller.delegate = self + return contoller + }() + + private lazy var trafficButtonViewController: TrafficButtonViewController = { + TrafficButtonViewController { [weak self] in + self?.presenter.layers() + } + }() + + override func viewDidLoad() { + super.viewDidLoad() + + tabBarContainerView.addSubview(tabBarViewController.view) + addChild(tabBarViewController) + tabBarViewController.didMove(toParent: self) + + layersButtonContainerView.addSubview(trafficButtonViewController.view) + trafficButtonViewController.view.alignToSuperview() + addChild(trafficButtonViewController) + trafficButtonViewController.didMove(toParent: self) + + presenter.viewDidLoad() + } + + @objc func showAdditionalViews() { + presenter.showAdditionalViews() + } + + private func showRegularPlacePage() { + placePageViewController = PlacePageBuilder.build() + placePageContainerView.isHidden = false + placePageContainerView.addSubview(placePageViewController!.view) + placePageViewController!.view.alignToSuperview() + addChild(placePageViewController!) + placePageViewController?.didMove(toParent: self) + bindBottomView(placePageViewController!) + } + + private func showGuidesGallery() { + guidesGalleryViewController = GuidesGalleryBuilder.build() + guidesGalleryContainerView.isHidden = false + guidesGalleryContainerView.addSubview(guidesGalleryViewController!.view) + guidesGalleryViewController!.view.alignToSuperview() + addChild(guidesGalleryViewController!) + guidesGalleryViewController!.didMove(toParent: self) + + guidesVisibleConstraint.priority = .defaultLow + guidesHiddenConstraint.priority = .defaultHigh + guidesGalleryContainerView.alpha = 0 + bindBottomView(guidesGalleryViewController!) + view.layoutIfNeeded() + UIView.animate(withDuration: kDefaultAnimationDuration) { [weak self] in + self?.guidesVisibleConstraint.priority = .defaultHigh + self?.guidesHiddenConstraint.priority = .defaultLow + self?.guidesGalleryContainerView.alpha = 1 + self?.view.layoutIfNeeded() + } + } + + private func hideGuidesGallery() { + guard let guidesGalleryViewController = guidesGalleryViewController else { return } + view.layoutIfNeeded() + UIView.animate(withDuration: kDefaultAnimationDuration) { [weak self] in + self?.guidesVisibleConstraint.priority = .defaultLow + self?.guidesHiddenConstraint.priority = .defaultHigh + self?.guidesGalleryContainerView.alpha = 0 + self?.view.layoutIfNeeded() + } completion: { [weak self] _ in + guidesGalleryViewController.view.removeFromSuperview() + guidesGalleryViewController.willMove(toParent: nil) + guidesGalleryViewController.removeFromParent() + self?.guidesGalleryViewController = nil + self?.guidesGalleryContainerView.isHidden = true + self?.guidesVisibleConstraint.constant = 48 + } + } + + func showGuidesNavigationBar(_ groupId: MWMMarkGroupID) { + guidesNavigationBar = GuidesNavigationBarViewController(categoryId: groupId) + view.addSubview(guidesNavigationBar!.view) + addChild(guidesNavigationBar!) + guidesNavigationBar!.didMove(toParent: self) +// guidesNavigationBar!.configLayout() + NSLayoutConstraint.activate([ + guidesNavigationBar!.view.topAnchor.constraint(equalTo: view.topAnchor), + guidesNavigationBar!.view.leftAnchor.constraint(equalTo: view.leftAnchor), + guidesNavigationBar!.view.rightAnchor.constraint(equalTo: view.rightAnchor) + ]) + +// self.menuState = MWMBottomMenuStateHidden; + } + + func hideGuidesNavigationBar() { + guard let guidesNavigationBar = guidesNavigationBar else { return } + guidesNavigationBar.view.removeFromSuperview() + guidesNavigationBar.willMove(toParent: nil) + guidesNavigationBar.removeFromParent() + self.guidesNavigationBar = nil + +// _guidesNavigationBarHidden = NO; +// self.menuState = _menuRestoreState; + + } + + private func bindBottomView(_ overlay: MapOverlayViewProtocol) { + let constraint = mapButtonsView.bottomAnchor.constraint(equalTo: overlay.bottomView.topAnchor) + constraint.priority = .defaultHigh + constraint.isActive = true + } + + @IBAction func onZoomIn(_ sender: UIButton) { + presenter.zoomIn() + } + + @IBAction func onZoomOut(_ sender: UIButton) { + presenter.zoomOut() + } + + @IBAction func onLocation(_ sender: UIButton) { + presenter.switchMyPosition() + } + + @IBAction func onGuidesGalleryPan(_ sender: UIPanGestureRecognizer) { + let originalConstraint: CGFloat = 48 + switch sender.state { + case .possible, .began: + break + case .changed: + let dy = sender.translation(in: guidesGalleryContainerView).y + sender.setTranslation(.zero, in: guidesGalleryContainerView) + let constant = min(guidesVisibleConstraint.constant - dy, originalConstraint) + guidesVisibleConstraint.constant = constant + guidesGalleryContainerView.alpha = (constant + guidesGalleryContainerView.frame.height) / (guidesGalleryContainerView.frame.height + originalConstraint) + case .ended, .cancelled, .failed: + let velocity = sender.velocity(in: guidesGalleryContainerView).y + if velocity < 0 || (velocity == 0 && guidesGalleryContainerView.alpha > 0.8) { + view.layoutIfNeeded() + UIView.animate(withDuration: kDefaultAnimationDuration) { [weak self] in + self?.guidesVisibleConstraint.constant = originalConstraint + self?.guidesGalleryContainerView.alpha = 1 + self?.view.layoutIfNeeded() + } + } else { + FrameworkHelper.shared().deactivateMapSelection(notifyUI: true) + } + @unknown default: + fatalError() + } + } +} + +extension MapControlsViewController: IMapControlsView { + func showMenu(_ mode: MapControlsMenuMode) { + switch mode { + case .full: + guard menuViewController == nil else { fatalError() } + menuViewController = BottomMenuBuilder.buildMenu(mapViewController: MapViewController.shared(), delegate: self) + present(menuViewController!, animated: true) + case .layers: + guard menuViewController == nil else { fatalError() } + menuViewController = BottomMenuBuilder.buildLayers(mapViewController: MapViewController.shared(), delegate: self) + present(menuViewController!, animated: true) + case .inactive: + guard menuViewController != nil else { fatalError() } + dismiss(animated: true) + menuViewController = nil + case .hidden: + guard menuViewController != nil else { fatalError() } + dismiss(animated: true) + menuViewController = nil + } + } + + func showPlacePage() { + guard PlacePageData.hasData else { return } + + if PlacePageData.isGuide { + showGuidesGallery() + } else { + showRegularPlacePage() + } + } + + func hidePlacePage() { + guard let placePageViewController = placePageViewController else { + hideGuidesGallery() + return + } + placePageViewController.view.removeFromSuperview() + placePageViewController.willMove(toParent: nil) + placePageViewController.removeFromParent() + self.placePageViewController = nil + placePageContainerView.isHidden = true + } + + func updatePlacePage() { + + } + + func setSideButtonsVisible(_ visible: Bool) { + view.layoutIfNeeded() + UIView.animate(withDuration: kDefaultAnimationDuration) { [weak self] in + guard let self = self else { return } + if visible { + self.sideButtonsContainerView.alpha = 1 + self.sideButtonsVisibleConstraint.priority = .defaultHigh + self.sideButtonsHiddenConstraint.priority = .defaultLow + } else { + self.sideButtonsContainerView.alpha = 0 + self.sideButtonsVisibleConstraint.priority = .defaultLow + self.sideButtonsHiddenConstraint.priority = .defaultHigh + } + self.view.layoutIfNeeded() + } + } + + func setLayersButtonVisible(_ visible: Bool) { + view.layoutIfNeeded() + UIView.animate(withDuration: kDefaultAnimationDuration) { [weak self] in + guard let self = self else { return } + if visible { + self.layersButtonContainerView.alpha = 1 + self.layersButtonVisibleConstraint.priority = .defaultHigh + self.layersButtonHiddenConstraint.priority = .defaultLow + } else { + self.layersButtonContainerView.alpha = 0 + self.layersButtonVisibleConstraint.priority = .defaultLow + self.layersButtonHiddenConstraint.priority = .defaultHigh + } + self.view.layoutIfNeeded() + } + } + + func showTutorialType(_ tutorialType: TipType) { + switch tutorialType { + case .bookmarks: + tutorialViewController = TutorialViewController.tutorial(.bookmarks, + target: tabBarViewController.bookmarksButton, + delegate: self) + case .search: + tutorialViewController = TutorialViewController.tutorial(.search, + target: tabBarViewController.searchButton, + delegate: self) + + case .discovery: + tutorialViewController = TutorialViewController.tutorial(.discovery, + target: tabBarViewController.discoveryButton, + delegate: self) + + case .subway: + tutorialViewController = TutorialViewController.tutorial(.subway, + target: trafficButtonViewController.view as! UIControl, + delegate: self) + + case .isolines: + tutorialViewController = TutorialViewController.tutorial(.isolines, + target: trafficButtonViewController.view as! UIControl, + delegate: self) + + case .none: + tutorialViewController = nil + @unknown default: + fatalError() + } + + guard let tutorialViewController = tutorialViewController else { return } + + addChild(tutorialViewController) + view.addSubview(tutorialViewController.view) + tutorialViewController.view.alignToSuperview() + tutorialViewController.didMove(toParent: self) + } + + func hideTutorial() { + guard let tutorialViewController = tutorialViewController else { return } + tutorialViewController.fadeOut { + tutorialViewController.view.removeFromSuperview() + tutorialViewController.willMove(toParent: nil) + tutorialViewController.removeFromParent() + self.tutorialViewController = nil + } + } + + func showAfterBoooking(_ data: PromoAfterBookingData) { + let alert = PromoAfterBookingViewController(cityImageUrl: data.pictureUrl) { [weak self] in + self?.dismiss(animated: true) + self?.presenter.onAfterBooking() + } cancelClosure: { [weak self] in + self?.dismiss(animated: true) + } + present(alert, animated: true) + } + + func setLocationButtonMode(_ mode: MyPositionMode) { + locationButton.imageView?.stopRotation() + switch mode { + case .pendingPosition: + locationButton.setStyleAndApply("ButtonPending") + locationButton.imageView?.startRotation() + case .notFollow, .notFollowNoPosition: + locationButton.setStyleAndApply("ButtonGetPosition") + case .follow: + locationButton.setStyleAndApply("ButtonFollow") + case .followAndRotate: + locationButton.setStyleAndApply("ButtonFollowAndRotate") + @unknown default: + fatalError() + } + } +} + +extension MapControlsViewController: BottomTabBarViewControllerDelegate { + func search() { + presenter.search() + } + + func route() { + presenter.route() + } + + func discovery() { + presenter.discovery() + } + + func bookmarks() { + presenter.bookmarks() + } + + func menu() { + presenter.menu() + } +} + +extension MapControlsViewController: BottomMenuDelegate { + func addPlace() { + + } + + func didFinishAddingPlace() { + + } + + func didFinish() { + presenter.hideMenu() + } +} + +extension MapControlsViewController: TutorialViewControllerDelegate { + func didPressTarget(_ viewController: TutorialViewController) { + presenter.onTutorialTarget() + } + + func didPressCancel(_ viewController: TutorialViewController) { + presenter.onTutorialCancel() + } + + func didPressOnScreen(_ viewController: TutorialViewController) { + presenter.onTutorialScreenTap() + } +} diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h index ce6621a60fb..296a34188d5 100644 --- a/iphone/Maps/Classes/MapViewController.h +++ b/iphone/Maps/Classes/MapViewController.h @@ -1,6 +1,5 @@ #import "MWMMapDownloaderMode.h" #import "MWMViewController.h" -#import "MWMMyPositionMode.h" #import @@ -9,14 +8,10 @@ @class EAGLView; @class MWMMapDownloadDialog; @class BookmarksCoordinator; -@protocol MWMLocationModeListener; @interface MapViewController : MWMViewController + (MapViewController *)sharedController; -- (void)addListener:(id)listener; -- (void)removeListener:(id)listener; - // called when app is terminated by system - (void)onTerminate; - (void)onGetFocus:(BOOL)isOnFocus; @@ -38,9 +33,6 @@ - (void)openDrivingOptions; - (void)showRemoveAds; -- (void)setPlacePageTopBound:(CGFloat)bound duration:(double)duration; - -+ (void)setViewport:(double)lat lon:(double)lon zoomLevel:(int)zoomlevel; - (void)initialize; - (void)enableCarPlayRepresentation; diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index d692bcef85e..aae6489d95b 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -7,8 +7,6 @@ #import "MWMEditorViewController.h" #import "MWMFrameworkListener.h" #import "MWMFrameworkObservers.h" -#import "MWMLocationHelpers.h" -#import "MWMLocationModeListener.h" #import "MWMMapDownloadDialog.h" #import "MWMMapViewControlsManager.h" #import "MWMNetworkPolicy+UI.h" @@ -33,8 +31,6 @@ extern NSString *const kMap2FBLoginSegue = @"Map2FBLogin"; extern NSString *const kMap2GoogleLoginSegue = @"Map2GoogleLogin"; -typedef NS_ENUM(NSUInteger, UserTouchesAction) { UserTouchesActionNone, UserTouchesActionDrag, UserTouchesActionScale }; - namespace { NSString *const kDownloaderSegue = @"Map2MapDownloaderSegue"; NSString *const kEditorSegue = @"Map2EditorSegue"; @@ -71,32 +67,23 @@ - (BOOL)isEqual:(id)anObject { @interface MapViewController () + MWMBookmarksObserver, + MWMLocationModeListener> @property(nonatomic, readwrite) MWMMapViewControlsManager *controlsManager; @property(nonatomic) BOOL disableStandbyOnLocationStateMode; -@property(nonatomic) UserTouchesAction userTouchesAction; - @property(nonatomic, readwrite) MWMMapDownloadDialog *downloadDialog; @property(nonatomic) BOOL skipForceTouch; -@property(strong, nonatomic) IBOutlet NSLayoutConstraint *visibleAreaBottom; -@property(strong, nonatomic) IBOutlet NSLayoutConstraint *visibleAreaKeyboard; -@property(strong, nonatomic) IBOutlet NSLayoutConstraint *placePageAreaKeyboard; -@property(strong, nonatomic) IBOutlet NSLayoutConstraint *sideButtonsAreaBottom; -@property(strong, nonatomic) IBOutlet NSLayoutConstraint *sideButtonsAreaKeyboard; -@property(strong, nonatomic) IBOutlet NSLayoutConstraint *guidesNavigationBarAreaBottom; @property(strong, nonatomic) IBOutlet NSLayoutConstraint *guidesVisibleConstraint;; @property(strong, nonatomic) IBOutlet NSLayoutConstraint *guidesHiddenConstraint; @property(strong, nonatomic) IBOutlet UIImageView *carplayPlaceholderLogo; -@property(strong, nonatomic) BookmarksCoordinator * bookmarksCoordinator; - -@property(strong, nonatomic) NSHashTable> *listeners; +@property(strong, nonatomic) BookmarksCoordinator *bookmarksCoordinator; +@property(strong, nonatomic) MapControlsViewController *mapControlsViewController; @property(nonatomic) BOOL needDeferFocusNotification; @property(nonatomic) BOOL deferredFocusValue; @@ -116,137 +103,10 @@ + (MapViewController *)sharedController { #pragma mark - Map Navigation -- (void)showRegularPlacePage { - self.placePageVC = [PlacePageBuilder build]; - self.placePageContainer.hidden = NO; - [self.placePageContainer addSubview:self.placePageVC.view]; - [self.view bringSubviewToFront:self.placePageContainer]; - [NSLayoutConstraint activateConstraints:@[ - [self.placePageVC.view.topAnchor constraintEqualToAnchor:self.placePageContainer.safeAreaLayoutGuide.topAnchor], - [self.placePageVC.view.leftAnchor constraintEqualToAnchor:self.placePageContainer.leftAnchor], - [self.placePageVC.view.bottomAnchor constraintEqualToAnchor:self.placePageContainer.bottomAnchor], - [self.placePageVC.view.rightAnchor constraintEqualToAnchor:self.placePageContainer.rightAnchor] - ]]; - self.placePageVC.view.translatesAutoresizingMaskIntoConstraints = NO; - [self addChildViewController:self.placePageVC]; - [self.placePageVC didMoveToParentViewController:self]; -} - -- (void)showGuidesGallery { - self.guidesGalleryVC = [MWMGuidesGalleryBuilder build]; - self.guidesCollectionContainer.hidden = NO; - [self.guidesCollectionContainer addSubview:self.guidesGalleryVC.view]; - [NSLayoutConstraint activateConstraints:@[ - [self.guidesGalleryVC.view.topAnchor constraintEqualToAnchor:self.guidesCollectionContainer.topAnchor], - [self.guidesGalleryVC.view.leftAnchor constraintEqualToAnchor:self.guidesCollectionContainer.leftAnchor], - [self.guidesGalleryVC.view.bottomAnchor constraintEqualToAnchor:self.guidesCollectionContainer.bottomAnchor], - [self.guidesGalleryVC.view.rightAnchor constraintEqualToAnchor:self.guidesCollectionContainer.rightAnchor] - ]]; - self.guidesGalleryVC.view.translatesAutoresizingMaskIntoConstraints = NO; - [self addChildViewController:self.guidesGalleryVC]; - [self.guidesGalleryVC didMoveToParentViewController:self]; - self.guidesVisibleConstraint.priority = UILayoutPriorityDefaultLow; - self.guidesHiddenConstraint.priority = UILayoutPriorityDefaultHigh; - self.guidesCollectionContainer.alpha = 0; - [self.view layoutIfNeeded]; - [UIView animateWithDuration:kDefaultAnimationDuration animations:^{ - self.guidesVisibleConstraint.priority = UILayoutPriorityDefaultHigh; - self.guidesHiddenConstraint.priority = UILayoutPriorityDefaultLow; - [self.view layoutIfNeeded]; - self.guidesCollectionContainer.alpha = 1; - }]; - [self setPlacePageTopBound:self.view.height - self.guidesCollectionContainer.minY duration:kDefaultAnimationDuration]; -} - -- (void)showPlacePage { - if (!PlacePageData.hasData) { - return; - } - - self.controlsManager.trafficButtonHidden = YES; - if (PlacePageData.isGuide) { - [self showGuidesGallery]; - } else { - [self showRegularPlacePage]; - } -} - - (void)dismissPlacePage { GetFramework().DeactivateMapSelection(true); } -- (void)hideRegularPlacePage { - [self.placePageVC.view removeFromSuperview]; - [self.placePageVC willMoveToParentViewController:nil]; - [self.placePageVC removeFromParentViewController]; - self.placePageVC = nil; - self.placePageContainer.hidden = YES; - [self setPlacePageTopBound:0 duration:0]; -} - -- (void)hideGuidesGallery { - [self.view layoutIfNeeded]; - [UIView animateWithDuration:kDefaultAnimationDuration animations:^{ - self.guidesVisibleConstraint.priority = UILayoutPriorityDefaultLow; - self.guidesHiddenConstraint.priority = UILayoutPriorityDefaultHigh; - [self.view layoutIfNeeded]; - self.guidesCollectionContainer.alpha = 0; - } completion:^(BOOL finished) { - [self.guidesGalleryVC.view removeFromSuperview]; - [self.guidesGalleryVC willMoveToParentViewController:nil]; - [self.guidesGalleryVC removeFromParentViewController]; - self.guidesGalleryVC = nil; - self.guidesCollectionContainer.hidden = YES; - self.guidesVisibleConstraint.constant = 48; - }]; - [self setPlacePageTopBound:0 duration:kDefaultAnimationDuration]; -} - -- (void)hidePlacePage { - if (self.placePageVC != nil) { - [self hideRegularPlacePage]; - } else if (self.guidesGalleryVC != nil) { - [self hideGuidesGallery]; - } - self.controlsManager.trafficButtonHidden = NO; -} - -- (void)onMapObjectDeselected:(bool)switchFullScreenMode { - [self hidePlacePage]; - - BOOL const isSearchResult = [MWMSearchManager manager].state == MWMSearchManagerStateResult; - BOOL const isNavigationDashboardHidden = [MWMNavigationDashboardManager sharedManager].state == MWMNavigationDashboardStateHidden; - if (isSearchResult) { - if (isNavigationDashboardHidden) { - [MWMSearchManager manager].state = MWMSearchManagerStateMapSearch; - } else { - [MWMSearchManager manager].state = MWMSearchManagerStateHidden; - } - } - - if (!switchFullScreenMode) - return; - - if (DeepLinkHandler.shared.isLaunchedByDeeplink) - return; - - BOOL const isSearchHidden = [MWMSearchManager manager].state == MWMSearchManagerStateHidden; - if (isSearchHidden && isNavigationDashboardHidden) { - self.controlsManager.hidden = !self.controlsManager.hidden; - } -} - -- (void)onMapObjectSelected { - [self hidePlacePage]; - [[MWMNetworkPolicy sharedPolicy] callOnlineApi:^(BOOL) { - [self showPlacePage]; - }]; -} - -- (void)onMapObjectUpdated { - // [self.controlsManager updatePlacePage]; -} - - (IBAction)onGudesGalleryPan:(UIPanGestureRecognizer *)sender { CGFloat originalConstant = 48; UIView *galleryView = self.guidesCollectionContainer; @@ -417,7 +277,19 @@ - (void)viewDidLoad { [MWMRouter restoreRouteIfNeeded]; self.view.clipsToBounds = YES; - [MWMKeyboard addObserver:self]; + + self.mapControlsViewController = [MapControlsBuilder buildWithBookmarksCoordinator:self.bookmarksCoordinator]; + self.mapControlsViewController.view.translatesAutoresizingMaskIntoConstraints = NO; + [self.view addSubview:self.mapControlsViewController.view]; + [NSLayoutConstraint activateConstraints:@[ + [self.mapControlsViewController.view.topAnchor constraintEqualToAnchor:self.view.topAnchor], + [self.mapControlsViewController.view.leftAnchor constraintEqualToAnchor:self.view.leftAnchor], + [self.mapControlsViewController.view.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor], + [self.mapControlsViewController.view.rightAnchor constraintEqualToAnchor:self.view.rightAnchor] + ]]; + [self addChildViewController:self.mapControlsViewController]; + [self.mapControlsViewController didMoveToParentViewController:self]; + self.welcomePageController = [MWMWelcomePageController controllerWithParent:self]; [self processMyPositionStateModeEvent:[MWMLocationManager isLocationProhibited] ? MWMMyPositionModeNotFollowNoPosition : MWMMyPositionModePendingPosition]; @@ -435,8 +307,9 @@ - (void)viewDidLoad { } - (void)didBecomeActive { - if (!self.welcomePageController) - [self.controlsManager showAdditionalViewsIfNeeded]; + if (!self.welcomePageController && self.navigationController.viewControllers.count == 1) { + [self.mapControlsViewController showAdditionalViews]; + } } - (void)viewDidLayoutSubviews { @@ -515,22 +388,8 @@ - (id)initWithCoder:(NSCoder *)coder { } - (void)initialize { - self.listeners = [NSHashTable> weakObjectsHashTable]; - Framework &f = GetFramework(); - // TODO: Review and improve this code. - f.SetPlacePageListeners([self]() { [self onMapObjectSelected]; }, - [self](bool switchFullScreen) { [self onMapObjectDeselected:switchFullScreen]; }, - [self]() { [self onMapObjectUpdated]; }); - // TODO: Review and improve this code. - f.SetMyPositionModeListener([self](location::EMyPositionMode mode, bool routingActive) { - // TODO: Two global listeners are subscribed to the same event from the core. - // Probably it's better to subscribe only wnen needed and usubscribe in other cases. - // May be better solution would be multiobservers support in the C++ core. - [self processMyPositionStateModeEvent:location_helpers::mwmMyPositionMode(mode)]; - }); - f.SetMyPositionPendingTimeoutListener([self] { [self processMyPositionPendingTimeout]; }); - - self.userTouchesAction = UserTouchesActionNone; + [[MWMFrameworkHelper sharedHelper] addLocationModeListener:self]; + [[MWMBookmarksManager sharedManager] addObserver:self]; [[MWMBookmarksManager sharedManager] loadBookmarks]; [MWMFrameworkListener addObserver:self]; @@ -540,14 +399,7 @@ - (void)initialize { - (void)dealloc { [[MWMBookmarksManager sharedManager] removeObserver:self]; [MWMFrameworkListener removeObserver:self]; -} - -- (void)addListener:(id)listener { - [self.listeners addObject:listener]; -} - -- (void)removeListener:(id)listener { - [self.listeners removeObject:listener]; + [[MWMFrameworkHelper sharedHelper] removeLocationModeListener:self]; } #pragma mark - Open controllers @@ -674,14 +526,11 @@ - (void)showRemoveAds { [self.navigationController presentViewController:removeAds animated:YES completion:nil]; } +#pragma mark - MWMLocationModeListener + - (void)processMyPositionStateModeEvent:(MWMMyPositionMode)mode { self.currentPositionMode = mode; [MWMLocationManager setMyPositionMode:mode]; - [[MWMSideButtons buttons] processMyPositionStateModeEvent:mode]; - NSArray> *objects = self.listeners.allObjects; - for (id object in objects) { - [object processMyPositionStateModeEvent:mode]; - } self.disableStandbyOnLocationStateMode = NO; switch (mode) { case MWMMyPositionModeNotFollowNoPosition: @@ -705,10 +554,6 @@ - (void)processMyPositionStateModeEvent:(MWMMyPositionMode)mode { - (void)processMyPositionPendingTimeout { [MWMLocationManager stop]; - NSArray> *objects = self.listeners.allObjects; - for (id object in objects) { - [object processMyPositionPendingTimeout]; - } BOOL const isMapVisible = (self.navigationController.visibleViewController == self); if (isMapVisible && ![MWMLocationManager isLocationProhibited]) { if (self.welcomePageController) { @@ -841,19 +686,6 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { } } -#pragma mark - MWMKeyboard - -- (void)onKeyboardWillAnimate { - [self.view setNeedsLayout]; -} -- (void)onKeyboardAnimation { - auto const kbHeight = [MWMKeyboard keyboardHeight]; - self.sideButtonsAreaKeyboard.constant = kbHeight; - if (IPAD) { - self.visibleAreaKeyboard.constant = kbHeight; - self.placePageAreaKeyboard.constant = kbHeight; - } -} #pragma mark - Properties - (MWMMapViewControlsManager *)controlsManager { @@ -873,28 +705,9 @@ - (MWMMapDownloadDialog *)downloadDialog { return _downloadDialog; } -- (void)setPlacePageTopBound:(CGFloat)bound duration:(double)duration { - self.visibleAreaBottom.constant = bound; - self.sideButtonsAreaBottom.constant = bound; - self.guidesNavigationBarAreaBottom.constant = bound; - [UIView animateWithDuration:duration delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{ - [self.view layoutIfNeeded]; - } completion:nil]; -} - -+ (void)setViewport:(double)lat lon:(double)lon zoomLevel:(int)zoomLevel { - Framework &f = GetFramework(); - - f.StopLocationFollow(); - - auto const center = mercator::FromLatLon(lat, lon); - f.SetViewportCenter(center, zoomLevel, false); -} - - (BookmarksCoordinator *)bookmarksCoordinator { if (!_bookmarksCoordinator) _bookmarksCoordinator = [[BookmarksCoordinator alloc] initWithNavigationController:self.navigationController - controlsManager:self.controlsManager navigationManager:[MWMNavigationDashboardManager sharedManager]]; return _bookmarksCoordinator; } @@ -910,7 +723,7 @@ - (void)disableCarPlayRepresentation { [[self.mapView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor] setActive:YES]; [[self.mapView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor] setActive:YES]; self.controlsView.hidden = NO; - [MWMFrameworkHelper setVisibleViewport:self.view.bounds scaleFactor:self.view.contentScaleFactor]; + [[MWMFrameworkHelper sharedHelper] setVisibleViewport:self.view.bounds scaleFactor:self.view.contentScaleFactor]; } - (void)enableCarPlayRepresentation { diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index e6fa170c57d..21be2c90b12 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -222,7 +222,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.notificationManager.delegate = self; [UNUserNotificationCenter currentNotificationCenter].delegate = self.notificationManager; - if ([MWMFrameworkHelper isWiFiConnected]) { + if ([[MWMFrameworkHelper sharedHelper] isWiFiConnected]) { [[InAppPurchase bookmarksSubscriptionManager] validateWithCompletion:^(MWMValidationResult result, BOOL isTrial) { if (result == MWMValidationResultNotValid) { [[InAppPurchase bookmarksSubscriptionManager] setSubscriptionActive:NO isTrial:NO]; @@ -545,7 +545,7 @@ - (void)showMap { - (void)updateApplicationIconBadgeNumber { auto const number = [self badgeNumber]; UIApplication.sharedApplication.applicationIconBadgeNumber = number; - BottomTabBarViewController.controller.isApplicationBadgeHidden = number == 0; +// BottomTabBarViewController.controller.isApplicationBadgeHidden = number == 0; } - (NSUInteger)badgeNumber { diff --git a/iphone/Maps/Common/WebViewController.m b/iphone/Maps/Common/WebViewController.m index 56617e0bc23..cf229f58dfe 100644 --- a/iphone/Maps/Common/WebViewController.m +++ b/iphone/Maps/Common/WebViewController.m @@ -83,7 +83,7 @@ - (void)viewDidLoad { [self.webView.trailingAnchor constraintEqualToAnchor:trailingAnchor].active = YES; self.webView.allowsLinkPreview = NO; - [self.webView setCustomUserAgent:[MWMFrameworkHelper userAgent]]; + [self.webView setCustomUserAgent:[[MWMFrameworkHelper sharedHelper] userAgent]]; [self performURLRequest]; } @@ -102,7 +102,8 @@ - (void)performURLRequest { } if (self.shouldAddAccessToken) { - NSString *authHeader = [NSString stringWithFormat:@"Bearer %@", [MWMFrameworkHelper userAccessToken]]; + NSString *authHeader = [NSString stringWithFormat:@"Bearer %@", + [[MWMFrameworkHelper sharedHelper] userAccessToken]]; [request setValue:authHeader forHTTPHeaderField:@"Authorization"]; } if ([UIColor isNightMode]) { diff --git a/iphone/Maps/Core/BackgroundFetchScheduler/BackgroundFetchTask/BackgroundFetchTask.swift b/iphone/Maps/Core/BackgroundFetchScheduler/BackgroundFetchTask/BackgroundFetchTask.swift index 85c3732e5e5..2920e4c20e0 100644 --- a/iphone/Maps/Core/BackgroundFetchScheduler/BackgroundFetchTask/BackgroundFetchTask.swift +++ b/iphone/Maps/Core/BackgroundFetchScheduler/BackgroundFetchTask/BackgroundFetchTask.swift @@ -53,7 +53,7 @@ final class BackgroundUGCUpload: BackgroundFetchTask { override var frameworkType: BackgroundFetchTaskFrameworkType { return .full } override fileprivate func fire() { - FrameworkHelper.uploadUGC(self.finish) + FrameworkHelper.shared().uploadUGC(self.finish) } override var description: String { diff --git a/iphone/Maps/Core/BackgroundFetchScheduler/BackgroundFetchTaskFrameworkType.swift b/iphone/Maps/Core/BackgroundFetchScheduler/BackgroundFetchTaskFrameworkType.swift index 89df4f558f0..1a2a6af1358 100644 --- a/iphone/Maps/Core/BackgroundFetchScheduler/BackgroundFetchTaskFrameworkType.swift +++ b/iphone/Maps/Core/BackgroundFetchScheduler/BackgroundFetchTaskFrameworkType.swift @@ -5,7 +5,7 @@ func create() { switch self { case .none: return - case .full: FrameworkHelper.createFramework() + case .full: FrameworkHelper.shared().createFramework() } } } diff --git a/iphone/Maps/Core/DeepLink/Strategies/DeepLinkSearchStrategy.swift b/iphone/Maps/Core/DeepLink/Strategies/DeepLinkSearchStrategy.swift index 5139ec78bca..b679029ad48 100644 --- a/iphone/Maps/Core/DeepLink/Strategies/DeepLinkSearchStrategy.swift +++ b/iphone/Maps/Core/DeepLink/Strategies/DeepLinkSearchStrategy.swift @@ -12,7 +12,8 @@ class DeepLinkSearchStrategy: IDeepLinkHandlerStrategy{ // Set viewport only when cll parameter was provided in url. if (data.centerLat != 0.0 && data.centerLon != 0.0) { - MapViewController.setViewport(data.centerLat, lon: data.centerLon, zoomLevel: kSearchInViewportZoom) + FrameworkHelper.shared().setViewportCenter(CLLocationCoordinate2DMake(data.centerLat, data.centerLon), + zoomLevel: kSearchInViewportZoom) // We need to update viewport for search api manually because of drape engine // will not notify subscribers when search view is shown. diff --git a/iphone/Maps/Core/Framework/ProxyObjects/Location/MWMLocationModeListener.h b/iphone/Maps/Core/Framework/ProxyObjects/Location/MWMLocationModeListener.h deleted file mode 100644 index 9cfc9949a87..00000000000 --- a/iphone/Maps/Core/Framework/ProxyObjects/Location/MWMLocationModeListener.h +++ /dev/null @@ -1,11 +0,0 @@ -#import "MWMMyPositionMode.h" -NS_ASSUME_NONNULL_BEGIN - -NS_SWIFT_NAME(LocationModeListener) -@protocol MWMLocationModeListener -- (void)processMyPositionStateModeEvent:(MWMMyPositionMode)mode; -- (void)processMyPositionPendingTimeout; -@end - -NS_ASSUME_NONNULL_END - diff --git a/iphone/Maps/Core/Location/MWMLocationHelpers.h b/iphone/Maps/Core/Location/MWMLocationHelpers.h index ddeed6557ed..0f42f7faa6b 100644 --- a/iphone/Maps/Core/Location/MWMLocationHelpers.h +++ b/iphone/Maps/Core/Location/MWMLocationHelpers.h @@ -1,8 +1,4 @@ -#import "MWMMyPositionMode.h" - -#include "platform/localization.hpp" #include "platform/location.hpp" -#include "platform/measurement_utils.hpp" #include "platform/settings.hpp" #include "geometry/mercator.hpp" @@ -10,14 +6,6 @@ namespace location_helpers { -static inline NSString * formattedDistance(double const & meters) { - if (meters < 0.) - return nil; - - auto const localizedUnits = platform::GetLocalizedDistanceUnits(); - return @(measurement_utils::FormatDistanceWithLocalization(meters, localizedUnits.m_high, localizedUnits.m_low).c_str()); -} - static inline BOOL isMyPositionPendingOrNoPosition() { location::EMyPositionMode mode; @@ -27,23 +15,9 @@ static inline BOOL isMyPositionPendingOrNoPosition() mode == location::EMyPositionMode::NotFollowNoPosition; } -static inline ms::LatLon ToLatLon(m2::PointD const & p) { return mercator::ToLatLon(p); } - static inline m2::PointD ToMercator(CLLocationCoordinate2D const & l) { return mercator::FromLatLon(l.latitude, l.longitude); } -static inline m2::PointD ToMercator(ms::LatLon const & l) { return mercator::FromLatLon(l); } -static inline MWMMyPositionMode mwmMyPositionMode(location::EMyPositionMode mode) -{ - switch (mode) - { - case location::EMyPositionMode::PendingPosition: return MWMMyPositionModePendingPosition; - case location::EMyPositionMode::NotFollowNoPosition: return MWMMyPositionModeNotFollowNoPosition; - case location::EMyPositionMode::NotFollow: return MWMMyPositionModeNotFollow; - case location::EMyPositionMode::Follow: return MWMMyPositionModeFollow; - case location::EMyPositionMode::FollowAndRotate: return MWMMyPositionModeFollowAndRotate; - } -} } // namespace MWMLocationHelpers diff --git a/iphone/Maps/Core/Location/MWMLocationManager.h b/iphone/Maps/Core/Location/MWMLocationManager.h index f5e3f7c366d..063b8c0dabc 100644 --- a/iphone/Maps/Core/Location/MWMLocationManager.h +++ b/iphone/Maps/Core/Location/MWMLocationManager.h @@ -1,4 +1,3 @@ -#import "MWMMyPositionMode.h" #import "MWMLocationObserver.h" NS_ASSUME_NONNULL_BEGIN diff --git a/iphone/Maps/Core/Location/MWMLocationPredictor.h b/iphone/Maps/Core/Location/MWMLocationPredictor.h index 18c90346631..006e10994a9 100644 --- a/iphone/Maps/Core/Location/MWMLocationPredictor.h +++ b/iphone/Maps/Core/Location/MWMLocationPredictor.h @@ -1,8 +1,4 @@ -#import "MWMMyPositionMode.h" - -#include "platform/location.hpp" - -using TPredictionBlock = void (^)(CLLocation *); +typedef void (^TPredictionBlock)(CLLocation *); @interface MWMLocationPredictor : NSObject diff --git a/iphone/Maps/Core/Location/MWMMyPositionMode.h b/iphone/Maps/Core/Location/MWMMyPositionMode.h deleted file mode 100644 index 64e8fbbca14..00000000000 --- a/iphone/Maps/Core/Location/MWMMyPositionMode.h +++ /dev/null @@ -1,7 +0,0 @@ -typedef NS_ENUM(NSUInteger, MWMMyPositionMode) { - MWMMyPositionModePendingPosition, - MWMMyPositionModeNotFollowNoPosition, - MWMMyPositionModeNotFollow, - MWMMyPositionModeFollow, - MWMMyPositionModeFollowAndRotate -}; diff --git a/iphone/Maps/Core/Location/location_util.h b/iphone/Maps/Core/Location/location_util.h index 9b9ef9b59ec..0e432ff421b 100644 --- a/iphone/Maps/Core/Location/location_util.h +++ b/iphone/Maps/Core/Location/location_util.h @@ -1,4 +1,5 @@ #pragma once +#include "platform/location.hpp" namespace location_util { diff --git a/iphone/Maps/Core/Settings/MWMSettings.mm b/iphone/Maps/Core/Settings/MWMSettings.mm index df4c6aa38d5..25c3fb19461 100644 --- a/iphone/Maps/Core/Settings/MWMSettings.mm +++ b/iphone/Maps/Core/Settings/MWMSettings.mm @@ -1,6 +1,5 @@ #import "MWMSettings.h" #import "MWMCoreUnits.h" -#import "MWMMapViewControlsManager.h" #import "SwiftBridge.h" #import "Flurry.h" @@ -72,7 +71,6 @@ + (BOOL)zoomButtonsEnabled + (void)setZoomButtonsEnabled:(BOOL)zoomButtonsEnabled { settings::Set(kZoomButtonsEnabledKey, static_cast(zoomButtonsEnabled)); - [MWMMapViewControlsManager manager].zoomHidden = !zoomButtonsEnabled; } + (BOOL)compassCalibrationEnabled diff --git a/iphone/Maps/Core/Theme/Core/ThemeManager.swift b/iphone/Maps/Core/Theme/Core/ThemeManager.swift index dea85946b8a..b8da36e6be4 100644 --- a/iphone/Maps/Core/Theme/Core/ThemeManager.swift +++ b/iphone/Maps/Core/Theme/Core/ThemeManager.swift @@ -33,7 +33,7 @@ final class ThemeManager: NSObject { return isDarkModeEnabled ? .vehicleNight : .vehicleDay } else { guard isVehicleRouting else { return .day } - switch FrameworkHelper.daytime(at: LocationManager.lastLocation()) { + switch FrameworkHelper.shared().daytime(at: LocationManager.lastLocation()) { case .day: return .vehicleDay case .night: return .vehicleNight @unknown default: @@ -59,7 +59,7 @@ final class ThemeManager: NSObject { }(actualTheme) - FrameworkHelper.setTheme(actualTheme) + FrameworkHelper.shared().setTheme(actualTheme) if nightMode != newNightMode || StyleManager.shared.hasTheme() == false{ UIColor.setNightMode(newNightMode) if newNightMode { diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index fe0d1efbd70..181472d4207 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -87,7 +87,6 @@ 343E75981E5B1EE20041226A /* MWMCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 343E75961E5B1EE20041226A /* MWMCollectionViewController.m */; }; 3444DFCD1F1760B900E73099 /* WidgetsArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */; }; 3444DFD21F17620C00E73099 /* MWMMapWidgetsHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */; }; - 3444DFDE1F18A5AF00E73099 /* SideButtonsArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFDC1F18A5AF00E73099 /* SideButtonsArea.swift */; }; 344532381F6FFE6A0059FBCC /* UGCRating.swift in Sources */ = {isa = PBXBuildFile; fileRef = 344532361F6FFE6A0059FBCC /* UGCRating.swift */; }; 3445324E1F714FD70059FBCC /* UGCAddReviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3445324B1F714FD70059FBCC /* UGCAddReviewController.swift */; }; 344532511F714FD70059FBCC /* UGCAddReviewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3445324C1F714FD70059FBCC /* UGCAddReviewController.xib */; }; @@ -113,8 +112,7 @@ 345E8F4F1F83984500A826CC /* GoogleSignInDependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C81F82362900E86251 /* GoogleSignInDependencies.framework */; }; 3462258F1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */; }; 346225921DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = 346225901DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib */; }; - 3463BA671DE81DB90082417F /* MWMTrafficButtonViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3463BA641DE81DB90082417F /* MWMTrafficButtonViewController.mm */; }; - 3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3463BA651DE81DB90082417F /* MWMTrafficButtonViewController.xib */; }; + 3463BA691DE81DB90082417F /* TrafficButtonViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3463BA651DE81DB90082417F /* TrafficButtonViewController.xib */; }; 3467CEB2202C6EEE00D3C670 /* BMCNotificationsHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3467CEB1202C6EEE00D3C670 /* BMCNotificationsHeader.swift */; }; 3467CEB6202C6FA900D3C670 /* BMCNotificationsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3467CEB4202C6FA900D3C670 /* BMCNotificationsCell.swift */; }; 3467CEB7202C6FA900D3C670 /* BMCNotificationsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3467CEB5202C6FA900D3C670 /* BMCNotificationsCell.xib */; }; @@ -169,7 +167,6 @@ 34AB66081FC5AA320078E451 /* MWMNavigationDashboardManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34AB65C61FC5AA320078E451 /* MWMNavigationDashboardManager.mm */; }; 34AB660B1FC5AA320078E451 /* MWMNavigationDashboardEntity.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34AB65CB1FC5AA320078E451 /* MWMNavigationDashboardEntity.mm */; }; 34AB660E1FC5AA320078E451 /* NavigationControlView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34AB65CD1FC5AA320078E451 /* NavigationControlView.xib */; }; - 34AB66111FC5AA320078E451 /* NavigationTurnsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AB65CE1FC5AA320078E451 /* NavigationTurnsView.swift */; }; 34AB66141FC5AA320078E451 /* MWMNavigationInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34AB65D01FC5AA320078E451 /* MWMNavigationInfoView.xib */; }; 34AB66171FC5AA320078E451 /* MWMiPhoneRoutePreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AB65D21FC5AA320078E451 /* MWMiPhoneRoutePreview.m */; }; 34AB661A1FC5AA330078E451 /* MWMTaxiCollectionLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AB65D31FC5AA320078E451 /* MWMTaxiCollectionLayout.m */; }; @@ -209,7 +206,6 @@ 34AB66831FC5AA330078E451 /* NavigationAddPointToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AB66001FC5AA320078E451 /* NavigationAddPointToastView.swift */; }; 34AB66861FC5AA330078E451 /* MWMNavigationInfoView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34AB66011FC5AA320078E451 /* MWMNavigationInfoView.mm */; }; 34AB66891FC5AA330078E451 /* NavigationControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AB66021FC5AA320078E451 /* NavigationControlView.swift */; }; - 34AB668C1FC5AA330078E451 /* NavigationStreetNameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AB66031FC5AA320078E451 /* NavigationStreetNameView.swift */; }; 34ABA6171C2D185C00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA6151C2D185B00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm */; }; 34ABA6211C2D517500FE1BEC /* MWMInputValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA61F1C2D517500FE1BEC /* MWMInputValidator.m */; }; 34ABA6251C2D551900FE1BEC /* MWMInputValidatorFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA6231C2D551900FE1BEC /* MWMInputValidatorFactory.m */; }; @@ -261,9 +257,7 @@ 34D3B04B1E389D05004100F9 /* MWMNoteCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34D3B0161E389D05004100F9 /* MWMNoteCell.xib */; }; 34D3B04F1E38A20C004100F9 /* Bundle+Init.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34D3B04D1E38A20C004100F9 /* Bundle+Init.swift */; }; 34E6F2DB1F459C05008E14F9 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E6F2DA1F459C05008E14F9 /* GLKit.framework */; }; - 34E776101F14B165003040B3 /* VisibleArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E7760E1F14B165003040B3 /* VisibleArea.swift */; }; 34E776141F14B17F003040B3 /* AvailableArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E776121F14B17F003040B3 /* AvailableArea.swift */; }; - 34E7761F1F14DB48003040B3 /* PlacePageArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E7761D1F14DB48003040B3 /* PlacePageArea.swift */; }; 34E776331F15FAC2003040B3 /* MWMPlacePageManagerHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34E776311F15FAC2003040B3 /* MWMPlacePageManagerHelper.mm */; }; 34EF94291C05A6F30050B714 /* MWMSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = F607C18D1C047FDC00B53A87 /* MWMSegue.m */; }; 34F4072C1E9E1AFF00E57AC0 /* Banner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F4071D1E9E1AFF00E57AC0 /* Banner.swift */; }; @@ -278,7 +272,6 @@ 34F73F9F1E082FF800AC1FD6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 34F73F611E082FF800AC1FD6 /* Localizable.strings */; }; 34F73FA31E08300E00AC1FD6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34F73FA11E08300E00AC1FD6 /* Images.xcassets */; }; 34F742321E0834F400AC1FD6 /* UIViewController+Navigation.m in Sources */ = {isa = PBXBuildFile; fileRef = 34F742301E0834F400AC1FD6 /* UIViewController+Navigation.m */; }; - 34FE5A6F1F18F30F00BCA729 /* TrafficButtonArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34FE5A6D1F18F30F00BCA729 /* TrafficButtonArea.swift */; }; 39CDE69123E1B6C8007CDA58 /* libge0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 39CDE69023E1B6C8007CDA58 /* libge0.a */; }; 3D0D2F7623D858BF00945C8D /* IsolinesTutorialBlur.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D0D2F7523D858BF00945C8D /* IsolinesTutorialBlur.xib */; }; 3D15ACEE2155117000F725D5 /* MWMObjectsCategorySelectorDataSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D15ACED2155117000F725D5 /* MWMObjectsCategorySelectorDataSource.mm */; }; @@ -354,6 +347,11 @@ 474AC76C2139E4F2002F9BF9 /* RemoveAdsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474AC76A2139E4F2002F9BF9 /* RemoveAdsViewController.swift */; }; 474AC76D2139E4F2002F9BF9 /* RemoveAdsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 474AC76B2139E4F2002F9BF9 /* RemoveAdsViewController.xib */; }; 474C9F5A213FF75800369009 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 474C9F59213FF75800369009 /* StoreKit.framework */; }; + 4753645B254CFFAA00E92D13 /* MapControlsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4753645A254CFFAA00E92D13 /* MapControlsBuilder.swift */; }; + 4753645D254CFFBE00E92D13 /* MapControlsInterfaces.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4753645C254CFFBE00E92D13 /* MapControlsInterfaces.swift */; }; + 4753645F254CFFE400E92D13 /* MapControlsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4753645E254CFFE400E92D13 /* MapControlsPresenter.swift */; }; + 47536461254CFFFF00E92D13 /* MapControlsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47536460254CFFFF00E92D13 /* MapControlsInteractor.swift */; }; + 47536463254D04BD00E92D13 /* MapControlsRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47536462254D04BD00E92D13 /* MapControlsRouter.swift */; }; 4757D6212535BB6E0062364F /* BookmarksListInterfaces.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4757D6202535BB6E0062364F /* BookmarksListInterfaces.swift */; }; 475EC36D244EDE66003BC295 /* GuidesGalleryPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 475EC36C244EDE66003BC295 /* GuidesGalleryPresenter.swift */; }; 475EC36F244EF7A9003BC295 /* GuidesGalleryBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 475EC36E244EF7A9003BC295 /* GuidesGalleryBuilder.swift */; }; @@ -403,6 +401,7 @@ 47B9065321C7FA400079C85E /* MWMImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 47B9064A21C7FA3C0079C85E /* MWMImageCache.m */; }; 47B9065421C7FA400079C85E /* UIImageView+WebImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 47B9064F21C7FA3E0079C85E /* UIImageView+WebImage.m */; }; 47B9065521C7FA400079C85E /* NSString+MD5.m in Sources */ = {isa = PBXBuildFile; fileRef = 47B9065021C7FA3F0079C85E /* NSString+MD5.m */; }; + 47BCC18E2540F08D009413A1 /* MapControlsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47BCC18D2540F08D009413A1 /* MapControlsViewController.swift */; }; 47C7F9732191E15A00C2760C /* InAppBilling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47C7F9722191E15A00C2760C /* InAppBilling.swift */; }; 47C7F97521930F5300C2760C /* IInAppBilling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47C7F97421930F5300C2760C /* IInAppBilling.swift */; }; 47C8789022DF525A00A772DA /* SubscriptionSuccessViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47C8788E22DF525A00A772DA /* SubscriptionSuccessViewController.swift */; }; @@ -448,6 +447,7 @@ 47E6CB0B2178BA3600EA102B /* SearchBannerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E6CB092178BA3600EA102B /* SearchBannerCell.swift */; }; 47E6CB0C2178BA3600EA102B /* SearchBannerCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 47E6CB0A2178BA3600EA102B /* SearchBannerCell.xib */; }; 47E8163323B17734008FD836 /* MWMStorage+UI.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E8163223B17734008FD836 /* MWMStorage+UI.m */; }; + 47E850E92553E63F00B890E1 /* TrafficButtonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E850E82553E63F00B890E1 /* TrafficButtonViewController.swift */; }; 47EF05B321504D8F00EAC269 /* RemoveAdsPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EF05B221504D8F00EAC269 /* RemoveAdsPresentationController.swift */; }; 47EF73FC247050E100D32AB8 /* GuidesGalleryRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EF73FB247050E100D32AB8 /* GuidesGalleryRouter.swift */; }; 47EF73FE247056A600D32AB8 /* GuidesGalleryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EF73FD247056A600D32AB8 /* GuidesGalleryCell.swift */; }; @@ -523,7 +523,6 @@ 6741AA1C1BF340DE002C974C /* MWMRoutingDisclaimerAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = F63774E91B59376F00BCF54D /* MWMRoutingDisclaimerAlert.m */; }; 6741AA1D1BF340DE002C974C /* MWMDownloadTransitMapAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F64F19971AB81A00006EAF7E /* MWMDownloadTransitMapAlert.mm */; }; 6741AA281BF340DE002C974C /* MWMAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F64F19861AB81A00006EAF7E /* MWMAlert.mm */; }; - 6741AA2B1BF340DE002C974C /* CircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = ED48BBB917C2B1E2003E7E92 /* CircleView.m */; }; 6741AA361BF340DE002C974C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34570A3A1B13222600E6D4FD /* libz.dylib */; settings = {ATTRIBUTES = (Required, ); }; }; 6741AABD1BF356BA002C974C /* libagg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6741AAA21BF356B9002C974C /* libagg.a */; }; 6741AABE1BF356BA002C974C /* libalohalitics.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6741AAA31BF356B9002C974C /* libalohalitics.a */; }; @@ -564,7 +563,6 @@ 99012851244732DB00C72B10 /* BottomTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9901284B244732DB00C72B10 /* BottomTabBarViewController.swift */; }; 99012852244732DB00C72B10 /* BottomTabBarBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9901284C244732DB00C72B10 /* BottomTabBarBuilder.swift */; }; 99012853244732DB00C72B10 /* BottomTabBarInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9901284D244732DB00C72B10 /* BottomTabBarInteractor.swift */; }; - 990128562449A82500C72B10 /* BottomTabBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 990128552449A82400C72B10 /* BottomTabBarView.swift */; }; 990F33B624BC915200D0F426 /* SearchActionBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 990F33B524BC915200D0F426 /* SearchActionBarView.swift */; }; 9917D17D2396793A00A7E06E /* PaidRoutesSubscriptionCampaign.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9917D17C2396793A00A7E06E /* PaidRoutesSubscriptionCampaign.swift */; }; 9917D17F2397B1D600A7E06E /* IPadModalPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9917D17E2397B1D600A7E06E /* IPadModalPresentationController.swift */; }; @@ -651,8 +649,6 @@ 99514BBA23E82B450085D3A7 /* ElevationProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99514BB423E82B450085D3A7 /* ElevationProfileViewController.swift */; }; 99514BBB23E82B450085D3A7 /* ElevationProfileBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99514BB523E82B450085D3A7 /* ElevationProfileBuilder.swift */; }; 99536113235DB86C008B218F /* InsetsLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99536112235DB86C008B218F /* InsetsLabel.swift */; }; - 995714102518B5DA0070DD93 /* GuidesNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9957140F2518B5D90070DD93 /* GuidesNavigationBarView.swift */; }; - 995714122519F2120070DD93 /* GuidesNavigationBarArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 995714112519F2120070DD93 /* GuidesNavigationBarArea.swift */; }; 995738DB235484410019AEE7 /* AllPassSubscriptionViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 995738DA235484410019AEE7 /* AllPassSubscriptionViewController.xib */; }; 995739042355CAA30019AEE7 /* PageIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 995739032355CAA30019AEE7 /* PageIndicator.swift */; }; 995739062355CAC40019AEE7 /* ImageViewCrossDisolve.swift in Sources */ = {isa = PBXBuildFile; fileRef = 995739052355CAC40019AEE7 /* ImageViewCrossDisolve.swift */; }; @@ -669,7 +665,6 @@ 9977E69C247BFB510073780C /* SearchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9977E69B247BFB510073780C /* SearchTextField.swift */; }; 9977E6A12480E1EE0073780C /* BottomMenuLayerButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9977E6A02480E1EE0073780C /* BottomMenuLayerButton.swift */; }; 9977E6A32480F9BF0073780C /* BottomMenuLayerButtonRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9977E6A22480F9BF0073780C /* BottomMenuLayerButtonRenderer.swift */; }; - 998927302449DE1500260CE2 /* TabBarArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9989272F2449DE1500260CE2 /* TabBarArea.swift */; }; 998927382449E60200260CE2 /* BottomMenuPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998927322449E60200260CE2 /* BottomMenuPresenter.swift */; }; 9989273A2449E60200260CE2 /* BottomMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998927342449E60200260CE2 /* BottomMenuViewController.swift */; }; 9989273B2449E60200260CE2 /* BottomMenuBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998927352449E60200260CE2 /* BottomMenuBuilder.swift */; }; @@ -1080,7 +1075,6 @@ 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WidgetsArea.swift; sourceTree = ""; }; 3444DFCF1F17620C00E73099 /* MWMMapWidgetsHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMapWidgetsHelper.h; sourceTree = ""; }; 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMMapWidgetsHelper.mm; sourceTree = ""; }; - 3444DFDC1F18A5AF00E73099 /* SideButtonsArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideButtonsArea.swift; sourceTree = ""; }; 344532361F6FFE6A0059FBCC /* UGCRating.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGCRating.swift; sourceTree = ""; }; 3445324B1F714FD70059FBCC /* UGCAddReviewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGCAddReviewController.swift; sourceTree = ""; }; 3445324C1F714FD70059FBCC /* UGCAddReviewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UGCAddReviewController.xib; sourceTree = ""; }; @@ -1118,9 +1112,7 @@ 3462258C1DDC5DB9001E8752 /* MWMSearchNoResultsAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchNoResultsAlert.h; sourceTree = ""; }; 3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchNoResultsAlert.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 346225901DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchNoResultsAlert.xib; sourceTree = ""; }; - 3463BA631DE81DB90082417F /* MWMTrafficButtonViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMTrafficButtonViewController.h; sourceTree = ""; }; - 3463BA641DE81DB90082417F /* MWMTrafficButtonViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMTrafficButtonViewController.mm; sourceTree = ""; }; - 3463BA651DE81DB90082417F /* MWMTrafficButtonViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMTrafficButtonViewController.xib; sourceTree = ""; }; + 3463BA651DE81DB90082417F /* TrafficButtonViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TrafficButtonViewController.xib; sourceTree = ""; }; 3467CEB1202C6EEE00D3C670 /* BMCNotificationsHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMCNotificationsHeader.swift; sourceTree = ""; }; 3467CEB4202C6FA900D3C670 /* BMCNotificationsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMCNotificationsCell.swift; sourceTree = ""; }; 3467CEB5202C6FA900D3C670 /* BMCNotificationsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BMCNotificationsCell.xib; sourceTree = ""; }; @@ -1158,7 +1150,6 @@ 34845DAD1E1649F6003D55B9 /* DownloaderNoResultsEmbedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderNoResultsEmbedViewController.swift; sourceTree = ""; }; 34845DB11E165E24003D55B9 /* SearchNoResultsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchNoResultsViewController.swift; sourceTree = ""; }; 34845DB51E166084003D55B9 /* Common.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Common.swift; sourceTree = ""; }; - 3486B5031E27948F0069C126 /* MWMMyPositionMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMMyPositionMode.h; sourceTree = ""; }; 3486B5051E27A4B50069C126 /* LocalNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalNotificationManager.h; sourceTree = ""; }; 3486B5061E27A4B50069C126 /* LocalNotificationManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = LocalNotificationManager.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 3486B50A1E27A4C50069C126 /* MWMPushNotifications.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMPushNotifications.h; sourceTree = ""; }; @@ -1205,7 +1196,6 @@ 34AB65CA1FC5AA320078E451 /* MWMNavigationDashboardManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMNavigationDashboardManager.h; sourceTree = ""; }; 34AB65CB1FC5AA320078E451 /* MWMNavigationDashboardEntity.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMNavigationDashboardEntity.mm; sourceTree = ""; }; 34AB65CD1FC5AA320078E451 /* NavigationControlView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NavigationControlView.xib; sourceTree = ""; }; - 34AB65CE1FC5AA320078E451 /* NavigationTurnsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationTurnsView.swift; sourceTree = ""; }; 34AB65CF1FC5AA320078E451 /* MWMNavigationInfoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMNavigationInfoView.h; sourceTree = ""; }; 34AB65D01FC5AA320078E451 /* MWMNavigationInfoView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMNavigationInfoView.xib; sourceTree = ""; }; 34AB65D21FC5AA320078E451 /* MWMiPhoneRoutePreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMiPhoneRoutePreview.m; sourceTree = ""; }; @@ -1253,7 +1243,6 @@ 34AB66001FC5AA320078E451 /* NavigationAddPointToastView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationAddPointToastView.swift; sourceTree = ""; }; 34AB66011FC5AA320078E451 /* MWMNavigationInfoView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMNavigationInfoView.mm; sourceTree = ""; }; 34AB66021FC5AA320078E451 /* NavigationControlView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationControlView.swift; sourceTree = ""; }; - 34AB66031FC5AA320078E451 /* NavigationStreetNameView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationStreetNameView.swift; sourceTree = ""; }; 34ABA6141C2D185B00FE1BEC /* MWMAuthorizationOSMLoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAuthorizationOSMLoginViewController.h; sourceTree = ""; }; 34ABA6151C2D185B00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAuthorizationOSMLoginViewController.mm; sourceTree = ""; }; 34ABA61E1C2D517500FE1BEC /* MWMInputValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMInputValidator.h; sourceTree = ""; }; @@ -1335,10 +1324,8 @@ 34E6F2DA1F459C05008E14F9 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; 34E7270820444A7A009E4CED /* MWMAlertViewController+CPP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MWMAlertViewController+CPP.h"; sourceTree = ""; }; 34E7270920444B95009E4CED /* MWMAlert+CPP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MWMAlert+CPP.h"; sourceTree = ""; }; - 34E7760E1F14B165003040B3 /* VisibleArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VisibleArea.swift; sourceTree = ""; }; 34E776121F14B17F003040B3 /* AvailableArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AvailableArea.swift; sourceTree = ""; }; 34E776161F14B6E2003040B3 /* MWMAvailableAreaAffectDirection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMAvailableAreaAffectDirection.h; sourceTree = ""; }; - 34E7761D1F14DB48003040B3 /* PlacePageArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlacePageArea.swift; sourceTree = ""; }; 34E776301F15FAC2003040B3 /* MWMPlacePageManagerHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlacePageManagerHelper.h; sourceTree = ""; }; 34E776311F15FAC2003040B3 /* MWMPlacePageManagerHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPlacePageManagerHelper.mm; sourceTree = ""; }; 34F4071D1E9E1AFF00E57AC0 /* Banner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Banner.swift; sourceTree = ""; }; @@ -1417,7 +1404,6 @@ 34FB47581E3B928D00D94ED8 /* MWMCoreUnits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMCoreUnits.h; sourceTree = ""; }; 34FE4C431BCC013500066718 /* MWMMapWidgets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMapWidgets.h; sourceTree = ""; }; 34FE4C441BCC013500066718 /* MWMMapWidgets.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMMapWidgets.mm; sourceTree = ""; }; - 34FE5A6D1F18F30F00BCA729 /* TrafficButtonArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TrafficButtonArea.swift; sourceTree = ""; }; 39CDE69023E1B6C8007CDA58 /* libge0.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libge0.a; sourceTree = BUILT_PRODUCTS_DIR; }; 3D0D2F7523D858BF00945C8D /* IsolinesTutorialBlur.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IsolinesTutorialBlur.xib; sourceTree = ""; }; 3D15ACED2155117000F725D5 /* MWMObjectsCategorySelectorDataSource.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMObjectsCategorySelectorDataSource.mm; sourceTree = ""; }; @@ -1509,6 +1495,11 @@ 474AC76A2139E4F2002F9BF9 /* RemoveAdsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoveAdsViewController.swift; sourceTree = ""; }; 474AC76B2139E4F2002F9BF9 /* RemoveAdsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RemoveAdsViewController.xib; sourceTree = ""; }; 474C9F59213FF75800369009 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; + 4753645A254CFFAA00E92D13 /* MapControlsBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapControlsBuilder.swift; sourceTree = ""; }; + 4753645C254CFFBE00E92D13 /* MapControlsInterfaces.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapControlsInterfaces.swift; sourceTree = ""; }; + 4753645E254CFFE400E92D13 /* MapControlsPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapControlsPresenter.swift; sourceTree = ""; }; + 47536460254CFFFF00E92D13 /* MapControlsInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapControlsInteractor.swift; sourceTree = ""; }; + 47536462254D04BD00E92D13 /* MapControlsRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapControlsRouter.swift; sourceTree = ""; }; 4757D6202535BB6E0062364F /* BookmarksListInterfaces.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksListInterfaces.swift; sourceTree = ""; }; 475EC36C244EDE66003BC295 /* GuidesGalleryPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesGalleryPresenter.swift; sourceTree = ""; }; 475EC36E244EF7A9003BC295 /* GuidesGalleryBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesGalleryBuilder.swift; sourceTree = ""; }; @@ -1566,6 +1557,7 @@ 47B9064F21C7FA3E0079C85E /* UIImageView+WebImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+WebImage.m"; sourceTree = ""; }; 47B9065021C7FA3F0079C85E /* NSString+MD5.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MD5.m"; sourceTree = ""; }; 47B9065121C7FA400079C85E /* IMWMImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IMWMImageCache.h; sourceTree = ""; }; + 47BCC18D2540F08D009413A1 /* MapControlsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapControlsViewController.swift; sourceTree = ""; }; 47C7F9722191E15A00C2760C /* InAppBilling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InAppBilling.swift; sourceTree = ""; }; 47C7F97421930F5300C2760C /* IInAppBilling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IInAppBilling.swift; sourceTree = ""; }; 47C8788E22DF525A00A772DA /* SubscriptionSuccessViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionSuccessViewController.swift; sourceTree = ""; }; @@ -1609,6 +1601,7 @@ 47E6CB0A2178BA3600EA102B /* SearchBannerCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SearchBannerCell.xib; sourceTree = ""; }; 47E8163123B17734008FD836 /* MWMStorage+UI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MWMStorage+UI.h"; sourceTree = ""; }; 47E8163223B17734008FD836 /* MWMStorage+UI.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "MWMStorage+UI.m"; sourceTree = ""; }; + 47E850E82553E63F00B890E1 /* TrafficButtonViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrafficButtonViewController.swift; sourceTree = ""; }; 47EF05B221504D8F00EAC269 /* RemoveAdsPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoveAdsPresentationController.swift; sourceTree = ""; }; 47EF73FB247050E100D32AB8 /* GuidesGalleryRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesGalleryRouter.swift; sourceTree = ""; }; 47EF73FD247056A600D32AB8 /* GuidesGalleryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesGalleryCell.swift; sourceTree = ""; }; @@ -1682,7 +1675,6 @@ 9901284B244732DB00C72B10 /* BottomTabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarViewController.swift; sourceTree = ""; }; 9901284C244732DB00C72B10 /* BottomTabBarBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarBuilder.swift; sourceTree = ""; }; 9901284D244732DB00C72B10 /* BottomTabBarInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarInteractor.swift; sourceTree = ""; }; - 990128552449A82400C72B10 /* BottomTabBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarView.swift; sourceTree = ""; }; 990F33B524BC915200D0F426 /* SearchActionBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchActionBarView.swift; sourceTree = ""; }; 9917D17C2396793A00A7E06E /* PaidRoutesSubscriptionCampaign.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaidRoutesSubscriptionCampaign.swift; sourceTree = ""; }; 9917D17E2397B1D600A7E06E /* IPadModalPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPadModalPresentationController.swift; sourceTree = ""; }; @@ -1771,8 +1763,6 @@ 99514BB423E82B450085D3A7 /* ElevationProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElevationProfileViewController.swift; sourceTree = ""; }; 99514BB523E82B450085D3A7 /* ElevationProfileBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElevationProfileBuilder.swift; sourceTree = ""; }; 99536112235DB86C008B218F /* InsetsLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InsetsLabel.swift; sourceTree = ""; }; - 9957140F2518B5D90070DD93 /* GuidesNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesNavigationBarView.swift; sourceTree = ""; }; - 995714112519F2120070DD93 /* GuidesNavigationBarArea.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesNavigationBarArea.swift; sourceTree = ""; }; 995738DA235484410019AEE7 /* AllPassSubscriptionViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AllPassSubscriptionViewController.xib; sourceTree = ""; }; 995739032355CAA30019AEE7 /* PageIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageIndicator.swift; sourceTree = ""; }; 995739052355CAC40019AEE7 /* ImageViewCrossDisolve.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageViewCrossDisolve.swift; sourceTree = ""; }; @@ -1791,7 +1781,6 @@ 9977E69B247BFB510073780C /* SearchTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTextField.swift; sourceTree = ""; }; 9977E6A02480E1EE0073780C /* BottomMenuLayerButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuLayerButton.swift; sourceTree = ""; }; 9977E6A22480F9BF0073780C /* BottomMenuLayerButtonRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuLayerButtonRenderer.swift; sourceTree = ""; }; - 9989272F2449DE1500260CE2 /* TabBarArea.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarArea.swift; sourceTree = ""; }; 998927322449E60200260CE2 /* BottomMenuPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuPresenter.swift; sourceTree = ""; }; 998927342449E60200260CE2 /* BottomMenuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuViewController.swift; sourceTree = ""; }; 998927352449E60200260CE2 /* BottomMenuBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuBuilder.swift; sourceTree = ""; }; @@ -1963,10 +1952,7 @@ CDCA278A2248F34C00167D87 /* MWMRoutingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMRoutingManager.h; sourceTree = ""; }; CDCA278B2248F34C00167D87 /* MWMRoutingManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMRoutingManager.mm; sourceTree = ""; }; CDCA278C2248F34C00167D87 /* MWMRouterResultCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMRouterResultCode.h; sourceTree = ""; }; - CDCA278F2248F3B800167D87 /* MWMLocationModeListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMLocationModeListener.h; sourceTree = ""; }; CDE0F3AD225B8D45008BA5C3 /* MWMSpeedCameraManagerMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMSpeedCameraManagerMode.h; sourceTree = ""; }; - ED48BBB817C2B1E2003E7E92 /* CircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleView.h; sourceTree = ""; }; - ED48BBB917C2B1E2003E7E92 /* CircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleView.m; sourceTree = ""; }; EE026F0511D6AC0D00645242 /* classificator.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = classificator.txt; path = ../../data/classificator.txt; sourceTree = SOURCE_ROOT; }; EE164810135CEE49003B8A3E /* 06_code2000.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 06_code2000.ttf; path = ../../data/06_code2000.ttf; sourceTree = SOURCE_ROOT; }; EE583CBA12F773F00042CBE3 /* unicode_blocks.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = unicode_blocks.txt; path = ../../data/unicode_blocks.txt; sourceTree = ""; }; @@ -2083,7 +2069,6 @@ F6E2FC261E097B9F0083EBEC /* MWMNoMapsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMNoMapsView.m; sourceTree = ""; }; F6E2FC271E097B9F0083EBEC /* MWMNoMapsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMNoMapsViewController.h; sourceTree = ""; }; F6E2FC281E097B9F0083EBEC /* MWMNoMapsViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMNoMapsViewController.mm; sourceTree = ""; }; - F6E2FC2A1E097B9F0083EBEC /* legacy_bookmark_colors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = legacy_bookmark_colors.h; sourceTree = ""; }; F6E2FC341E097B9F0083EBEC /* MWMEditorAdditionalNamesTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMEditorAdditionalNamesTableViewController.h; sourceTree = ""; }; F6E2FC351E097B9F0083EBEC /* MWMEditorAdditionalNamesTableViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMEditorAdditionalNamesTableViewController.mm; sourceTree = ""; }; F6E2FC371E097B9F0083EBEC /* MWMCuisineEditorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMCuisineEditorViewController.h; sourceTree = ""; }; @@ -2630,7 +2615,6 @@ 3404752D1E081A4600C92850 /* MWMLocationObserver.h */, 3404752E1E081A4600C92850 /* MWMLocationPredictor.h */, 3404752F1E081A4600C92850 /* MWMLocationPredictor.mm */, - 3486B5031E27948F0069C126 /* MWMMyPositionMode.h */, 47F701EC238C2F8400D18E95 /* location_util.h */, ); path = Location; @@ -2931,9 +2915,8 @@ 3463BA621DE81D760082417F /* TrafficButton */ = { isa = PBXGroup; children = ( - 3463BA631DE81DB90082417F /* MWMTrafficButtonViewController.h */, - 3463BA641DE81DB90082417F /* MWMTrafficButtonViewController.mm */, - 3463BA651DE81DB90082417F /* MWMTrafficButtonViewController.xib */, + 3463BA651DE81DB90082417F /* TrafficButtonViewController.xib */, + 47E850E82553E63F00B890E1 /* TrafficButtonViewController.swift */, ); path = TrafficButton; sourceTree = ""; @@ -3190,8 +3173,6 @@ 34AB66001FC5AA320078E451 /* NavigationAddPointToastView.swift */, 34AB66021FC5AA320078E451 /* NavigationControlView.swift */, 34AB65CD1FC5AA320078E451 /* NavigationControlView.xib */, - 34AB66031FC5AA320078E451 /* NavigationStreetNameView.swift */, - 34AB65CE1FC5AA320078E451 /* NavigationTurnsView.swift */, 34AB65D11FC5AA320078E451 /* RoutePreview */, ); path = Views; @@ -3372,15 +3353,9 @@ isa = PBXGroup; children = ( 34E776121F14B17F003040B3 /* AvailableArea.swift */, - 34E7760E1F14B165003040B3 /* VisibleArea.swift */, 34E776161F14B6E2003040B3 /* MWMAvailableAreaAffectDirection.h */, - 34E7761D1F14DB48003040B3 /* PlacePageArea.swift */, 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */, - 3444DFDC1F18A5AF00E73099 /* SideButtonsArea.swift */, - 34FE5A6D1F18F30F00BCA729 /* TrafficButtonArea.swift */, 340708631F2905A500029ECC /* NavigationInfoArea.swift */, - 9989272F2449DE1500260CE2 /* TabBarArea.swift */, - 995714112519F2120070DD93 /* GuidesNavigationBarArea.swift */, ); path = AvailableArea; sourceTree = ""; @@ -3547,6 +3522,19 @@ path = Metrics; sourceTree = ""; }; + 47536459254CFF7000E92D13 /* MapControlsViewControls */ = { + isa = PBXGroup; + children = ( + 47BCC18D2540F08D009413A1 /* MapControlsViewController.swift */, + 4753645A254CFFAA00E92D13 /* MapControlsBuilder.swift */, + 4753645C254CFFBE00E92D13 /* MapControlsInterfaces.swift */, + 4753645E254CFFE400E92D13 /* MapControlsPresenter.swift */, + 47536460254CFFFF00E92D13 /* MapControlsInteractor.swift */, + 47536462254D04BD00E92D13 /* MapControlsRouter.swift */, + ); + path = MapControlsViewControls; + sourceTree = ""; + }; 47B06DEB21B6962D0094CCAD /* GeoTracker */ = { isa = PBXGroup; children = ( @@ -3687,8 +3675,6 @@ isa = PBXGroup; children = ( 995739022355CA5D0019AEE7 /* Pages */, - ED48BBB817C2B1E2003E7E92 /* CircleView.h */, - ED48BBB917C2B1E2003E7E92 /* CircleView.m */, 349A35741B53D4C9009677EE /* CircularProgress */, 34ABA60F1C2D17C200FE1BEC /* Login */, 34BC72091B0DECAE0012A34B /* MapViewControls */, @@ -3708,7 +3694,6 @@ 9901284C244732DB00C72B10 /* BottomTabBarBuilder.swift */, 9901284D244732DB00C72B10 /* BottomTabBarInteractor.swift */, 349D1ACD1E2E325B004A2006 /* BottomTabBarViewController.xib */, - 990128552449A82400C72B10 /* BottomTabBarView.swift */, ); path = TabBar; sourceTree = ""; @@ -3830,7 +3815,6 @@ children = ( 993ECBB124E40CEC00EA5DEF /* GuidesNavigationBarViewController.swift */, 993ECBB224E40CEC00EA5DEF /* GuidesNavigationBarViewController.xib */, - 9957140F2518B5D90070DD93 /* GuidesNavigationBarView.swift */, ); path = GuidesNavigationBar; sourceTree = ""; @@ -4333,7 +4317,6 @@ CDCA278D2248F34C00167D87 /* Location */ = { isa = PBXGroup; children = ( - CDCA278F2248F3B800167D87 /* MWMLocationModeListener.h */, ); path = Location; sourceTree = ""; @@ -4350,6 +4333,7 @@ F613FA741AB330AF002394D4 /* MapViewController */ = { isa = PBXGroup; children = ( + 47536459254CFF7000E92D13 /* MapControlsViewControls */, 46F8A2EB10EB63040045521A /* MapViewController.h */, EED10A4411F78D120095FAD4 /* MapViewController.mm */, ); @@ -4641,7 +4625,6 @@ F6E2FC291E097B9F0083EBEC /* EditBookmark */ = { isa = PBXGroup; children = ( - F6E2FC2A1E097B9F0083EBEC /* legacy_bookmark_colors.h */, 471A7BBF2481C82500A0D4C1 /* BookmarkTitleCell.swift */, 471A7BC12481C9B700A0D4C1 /* BookmarkTitleCell.xib */, 471A7BBD2481A3D000A0D4C1 /* EditBookmarkViewController.swift */, @@ -5359,7 +5342,7 @@ 346DB82B1E5C4F6700E3123E /* GalleryCell.xib in Resources */, F6E2FE2E1E097BA00083EBEC /* MWMStreetEditorEditTableViewCell.xib in Resources */, 47A13CAB24BE881000027D4F /* DatePickerViewController.xib in Resources */, - 3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */, + 3463BA691DE81DB90082417F /* TrafficButtonViewController.xib in Resources */, F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */, 993ECBB424E40CEC00EA5DEF /* GuidesNavigationBarViewController.xib in Resources */, 47E6CB0C2178BA3600EA102B /* SearchBannerCell.xib in Resources */, @@ -5553,6 +5536,7 @@ 34D3AFF61E37A36A004100F9 /* UICollectionView+Cells.swift in Sources */, 4767CDA420AAF66B00BD8166 /* NSAttributedString+HTML.swift in Sources */, 47B06DFE21B965950094CCAD /* Geo.swift in Sources */, + 47BCC18E2540F08D009413A1 /* MapControlsViewController.swift in Sources */, 6741A9A91BF340DE002C974C /* MWMDefaultAlert.mm in Sources */, 990F33B624BC915200D0F426 /* SearchActionBarView.swift in Sources */, 3DBD7B9F242363E500ED9FE8 /* PartnerBannerViewController.swift in Sources */, @@ -5573,10 +5557,10 @@ 99C964292428C0F700E41723 /* PlacePageHeaderPresenter.swift in Sources */, F6E2FE101E097BA00083EBEC /* MWMOpeningHoursTableViewCell.mm in Sources */, 47C8789D22DF662700A772DA /* SubscriptionExpiredViewController.swift in Sources */, + 4753645B254CFFAA00E92D13 /* MapControlsBuilder.swift in Sources */, 6741A9B01BF340DE002C974C /* MapsAppDelegate.mm in Sources */, 996D108824E16E6F002DD0E2 /* BookmarksBannerViewController.swift in Sources */, 993DF12723F6BDB100AC231A /* Fonts.swift in Sources */, - 995714102518B5DA0070DD93 /* GuidesNavigationBarView.swift in Sources */, 996D108624E15FBE002DD0E2 /* DownloadBannerViewController.swift in Sources */, 4719A645219CBD65009F9AA7 /* IPendingTransactionsHandler.swift in Sources */, 34F742321E0834F400AC1FD6 /* UIViewController+Navigation.m in Sources */, @@ -5587,6 +5571,7 @@ BB8123D62130427E00ADE512 /* MetalContextFactory.mm in Sources */, 99A906E823F6F7030005872B /* PlacePageReviewsViewController.swift in Sources */, 3467CEB2202C6EEE00D3C670 /* BMCNotificationsHeader.swift in Sources */, + 47E850E92553E63F00B890E1 /* TrafficButtonViewController.swift in Sources */, 34F4072F1E9E1AFF00E57AC0 /* BannersCache.swift in Sources */, 34D3B0211E389D05004100F9 /* MWMEditorAddAdditionalNameTableViewCell.m in Sources */, 99D363192358685300941BF4 /* SubscriptionGroupItem.swift in Sources */, @@ -5696,14 +5681,12 @@ 99A906E923F6F7030005872B /* WikiDescriptionViewController.swift in Sources */, 99A906DF23F6F7030005872B /* HotelFacilitiesViewController.swift in Sources */, 993DF11023F6BDB100AC231A /* MWMButtonRenderer.swift in Sources */, - 3463BA671DE81DB90082417F /* MWMTrafficButtonViewController.mm in Sources */, 993DF10323F6BDB100AC231A /* MainTheme.swift in Sources */, 34AB66051FC5AA320078E451 /* MWMNavigationDashboardManager+Entity.mm in Sources */, 993DF12A23F6BDB100AC231A /* Style.swift in Sources */, 34ABA6171C2D185C00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm in Sources */, 993DF10423F6BDB100AC231A /* UIView+styleName.swift in Sources */, 991CE2DD2373145C009EB02A /* PromoAfterBookingCampaign.swift in Sources */, - 998927302449DE1500260CE2 /* TabBarArea.swift in Sources */, 995739042355CAA30019AEE7 /* PageIndicator.swift in Sources */, 470F0B7D238842EA006AEC94 /* ExpandableLabel.swift in Sources */, B33D21AF20DAF9F000BAD749 /* Toast.swift in Sources */, @@ -5755,7 +5738,6 @@ 34C9BD031C6DB693000DC38D /* MWMTableViewController.m in Sources */, F6E2FD8C1E097BA00083EBEC /* MWMNoMapsView.m in Sources */, 34D3B0361E389D05004100F9 /* MWMEditorSelectTableViewCell.m in Sources */, - 990128562449A82500C72B10 /* BottomTabBarView.swift in Sources */, F6E2FD711E097BA00083EBEC /* MWMMapDownloaderTableViewCell.m in Sources */, F6E2FE4F1E097BA00083EBEC /* MWMActionBarButton.m in Sources */, 47F86CFF20C936FC00FEE291 /* TabView.swift in Sources */, @@ -5860,7 +5842,6 @@ F660DEE51EAF4F59004DC056 /* MWMLocationManager+SpeedAndAltitude.swift in Sources */, F6E2FDF21E097BA00083EBEC /* MWMOpeningHoursAddScheduleTableViewCell.mm in Sources */, 3304306D21D4EAFB00317CA3 /* SearchCategoryCell.swift in Sources */, - 34AB66111FC5AA320078E451 /* NavigationTurnsView.swift in Sources */, 348A8DF81F66775A00D83026 /* RatingViewDelegate.swift in Sources */, 475ED78624C7C7300063ADC7 /* ValueStepperViewRenderer.swift in Sources */, 4716EABA21A325310029B886 /* IPaidRouteStatistics.swift in Sources */, @@ -5886,7 +5867,6 @@ F6E2FF3C1E097BA00083EBEC /* MWMSearchTableView.m in Sources */, F6E2FF661E097BA00083EBEC /* MWMTTSSettingsViewController.mm in Sources */, 3454D7C21E07F045004AF2AD /* NSString+Categories.m in Sources */, - 34E7761F1F14DB48003040B3 /* PlacePageArea.swift in Sources */, 346DB82E1E5C4F6700E3123E /* GalleryItemViewController.swift in Sources */, 4728F69322CF89A400E00028 /* GradientView.swift in Sources */, 340475561E081A4600C92850 /* Statistics.mm in Sources */, @@ -5920,14 +5900,12 @@ 47E3C72121108E9F008B3B27 /* BookmarksLoadedViewController.swift in Sources */, 3472B5CB200F43EF00DC6CD5 /* BackgroundFetchScheduler.swift in Sources */, 471BBD942130390F00EB17C9 /* TutorialViewController.swift in Sources */, - 34FE5A6F1F18F30F00BCA729 /* TrafficButtonArea.swift in Sources */, 993DF10D23F6BDB100AC231A /* UIPageControlRenderer.swift in Sources */, F6E2FF691E097BA00083EBEC /* MWMUnitsController.mm in Sources */, 6741AA031BF340DE002C974C /* MWMActivityViewController.mm in Sources */, CDCA27382237F1BD00167D87 /* BookmarkInfo.swift in Sources */, 993F5509237C622700545511 /* DeepLinkHandlerStrategy.swift in Sources */, 993DF11A23F6BDB100AC231A /* UIBarButtonItemRenderer.swift in Sources */, - 34AB668C1FC5AA330078E451 /* NavigationStreetNameView.swift in Sources */, 993DF12923F6BDB100AC231A /* ThemeManager.swift in Sources */, 337F98A621D37B7400C8AC27 /* SearchTabViewController.swift in Sources */, 3488B0131E9D0AEC0068AFD8 /* AdBannerCell.swift in Sources */, @@ -5942,6 +5920,7 @@ 34AB66591FC5AA330078E451 /* TransportTransitFlowLayout.swift in Sources */, 99CB34962369C281001D28AD /* FirstLaunchBuilder.swift in Sources */, 3486B5191E27AD3B0069C126 /* MWMFrameworkListener.mm in Sources */, + 47536461254CFFFF00E92D13 /* MapControlsInteractor.swift in Sources */, 3404756B1E081A4600C92850 /* MWMSearch+CoreSpotlight.mm in Sources */, CD9AD96C2281B56900EC174A /* CPViewPortState.swift in Sources */, F653CE121C6DEC8E00A453F1 /* MWMDropDown.m in Sources */, @@ -5949,6 +5928,7 @@ 3454D7BC1E07F045004AF2AD /* CLLocation+Mercator.mm in Sources */, 47E3C7272111E5A8008B3B27 /* AlertPresentationController.swift in Sources */, F6E2FF4E1E097BA00083EBEC /* MWMAboutController.m in Sources */, + 4753645D254CFFBE00E92D13 /* MapControlsInterfaces.swift in Sources */, 993F5512237C622700545511 /* DeepLinkFileStrategy.swift in Sources */, 47EF73FE247056A600D32AB8 /* GuidesGalleryCell.swift in Sources */, 47B06DF921B95F5E0094CCAD /* IGeoTracker.swift in Sources */, @@ -5991,7 +5971,6 @@ F655C027207278300048A241 /* DiscoveryMoreCell.swift in Sources */, 337F98B821D3D67E00C8AC27 /* SearchHistoryQueryCell.swift in Sources */, 34AB66621FC5AA330078E451 /* TransportTransitSeparator.swift in Sources */, - 995714122519F2120070DD93 /* GuidesNavigationBarArea.swift in Sources */, CDCA2743223F8D1E00167D87 /* ListItemInfo.swift in Sources */, B32FE74020D2844600EF7446 /* DownloadedBookmarksViewController.swift in Sources */, 340416541E7C09C200E2B6D6 /* PhotoScalingView.swift in Sources */, @@ -6054,6 +6033,7 @@ 9917D17D2396793A00A7E06E /* PaidRoutesSubscriptionCampaign.swift in Sources */, 3404165C1E7C29AE00E2B6D6 /* PhotosInteractionAnimator.swift in Sources */, 470B3630244E2DB400C0EA9E /* GuidesGalleryViewController.swift in Sources */, + 4753645F254CFFE400E92D13 /* MapControlsPresenter.swift in Sources */, 993F550E237C622700545511 /* DeepLinkCataloguePathStrategy.swift in Sources */, 3404756E1E081A4600C92850 /* MWMSearch.mm in Sources */, 6741AA191BF340DE002C974C /* MWMDownloaderDialogCell.m in Sources */, @@ -6110,7 +6090,6 @@ 471C448C2322A7C800C307EC /* SubscriptionGoToCatalogViewController.swift in Sources */, 99CB34B02369DF2E001D28AD /* WhatsNewPresenter.swift in Sources */, 993DF11423F6BDB100AC231A /* RatingSummaryViewRenderer.swift in Sources */, - 34E776101F14B165003040B3 /* VisibleArea.swift in Sources */, 330473EA21F7440C00DC4AEA /* MWMHotelParams.mm in Sources */, 99A906E223F6F7030005872B /* CatalogGalleryViewController.swift in Sources */, 47C8789922DF622400A772DA /* SubscriptionFailViewController.swift in Sources */, @@ -6130,11 +6109,9 @@ 340416441E7BED3900E2B6D6 /* PhotosTransitionAnimator.swift in Sources */, 34AB66261FC5AA330078E451 /* RouteManagerDimView.swift in Sources */, 993F5514237C622700545511 /* DeepLinkStrategyFactory.swift in Sources */, - 6741AA2B1BF340DE002C974C /* CircleView.m in Sources */, 99CB34982369C291001D28AD /* FirstLaunchPresenter.swift in Sources */, CD08887422B7ABB400C1368D /* MWMDiscoveryCollectionView.mm in Sources */, 4788739220EE326500F6826B /* VerticallyAlignedButton.swift in Sources */, - 3444DFDE1F18A5AF00E73099 /* SideButtonsArea.swift in Sources */, CDCA278622451F5000167D87 /* RouteInfo.swift in Sources */, 3467CEB6202C6FA900D3C670 /* BMCNotificationsCell.swift in Sources */, 34B846A32029DFEB0081ECCD /* BMCPermissionsHeader.swift in Sources */, @@ -6156,6 +6133,7 @@ F5BD29FF26AD58255766C51A /* DiscoverySpinnerCell.swift in Sources */, 47E3C72B2111E62A008B3B27 /* FadeOutAnimatedTransitioning.swift in Sources */, F5BD255A0838E70EC012748E /* DiscoverySearchCell.swift in Sources */, + 47536463254D04BD00E92D13 /* MapControlsRouter.swift in Sources */, 47C7F9732191E15A00C2760C /* InAppBilling.swift in Sources */, F5BD2CA4DBEFACBC48195F39 /* DiscoveryCollectionHolderCell.swift in Sources */, 4796037524482E3900F3BDD0 /* KeychainStorage.swift in Sources */, diff --git a/iphone/Maps/UI/AvailableArea/GuidesNavigationBarArea.swift b/iphone/Maps/UI/AvailableArea/GuidesNavigationBarArea.swift deleted file mode 100644 index 50fca02f197..00000000000 --- a/iphone/Maps/UI/AvailableArea/GuidesNavigationBarArea.swift +++ /dev/null @@ -1,23 +0,0 @@ -final class GuidesNavigationBarArea: AvailableArea { - override var deferNotification: Bool { return false } - - override func isAreaAffectingView(_ other: UIView) -> Bool { - return !other.guidesNavigationBarAreaAffectDirections.isEmpty - } - - override func addAffectingView(_ other: UIView) { - let ov = other.guidesNavigationBarAreaAffectView - let directions = ov.guidesNavigationBarAreaAffectDirections - addConstraints(otherView: ov, directions: directions) - } - - override func notifyObserver() { - GuidesNavigationBarViewController.updateAvailableArea(areaFrame) - } -} - -extension UIView { - @objc var guidesNavigationBarAreaAffectDirections: MWMAvailableAreaAffectDirections { return [] } - - var guidesNavigationBarAreaAffectView: UIView { return self } -} diff --git a/iphone/Maps/UI/AvailableArea/PlacePageArea.swift b/iphone/Maps/UI/AvailableArea/PlacePageArea.swift deleted file mode 100644 index 727db26ef53..00000000000 --- a/iphone/Maps/UI/AvailableArea/PlacePageArea.swift +++ /dev/null @@ -1,25 +0,0 @@ -final class PlacePageArea: AvailableArea { - override var areaFrame: CGRect { - return frame - } - - override func isAreaAffectingView(_ other: UIView) -> Bool { - return !other.placePageAreaAffectDirections.isEmpty - } - - override func addAffectingView(_ other: UIView) { - let ov = other.placePageAreaAffectView - let directions = ov.placePageAreaAffectDirections - addConstraints(otherView: ov, directions: directions) - } - - override func notifyObserver() { - MWMPlacePageManagerHelper.updateAvailableArea(areaFrame) - } -} - -extension UIView { - @objc var placePageAreaAffectDirections: MWMAvailableAreaAffectDirections { return [] } - - var placePageAreaAffectView: UIView { return self } -} diff --git a/iphone/Maps/UI/AvailableArea/SideButtonsArea.swift b/iphone/Maps/UI/AvailableArea/SideButtonsArea.swift deleted file mode 100644 index b9a55b31acd..00000000000 --- a/iphone/Maps/UI/AvailableArea/SideButtonsArea.swift +++ /dev/null @@ -1,23 +0,0 @@ -final class SideButtonsArea: AvailableArea { - override var deferNotification: Bool { return false } - - override func isAreaAffectingView(_ other: UIView) -> Bool { - return !other.sideButtonsAreaAffectDirections.isEmpty - } - - override func addAffectingView(_ other: UIView) { - let ov = other.sideButtonsAreaAffectView - let directions = ov.sideButtonsAreaAffectDirections - addConstraints(otherView: ov, directions: directions) - } - - override func notifyObserver() { - MWMSideButtons.updateAvailableArea(areaFrame) - } -} - -extension UIView { - @objc var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections { return [] } - - var sideButtonsAreaAffectView: UIView { return self } -} diff --git a/iphone/Maps/UI/AvailableArea/TabBarArea.swift b/iphone/Maps/UI/AvailableArea/TabBarArea.swift deleted file mode 100644 index 1bef98ac039..00000000000 --- a/iphone/Maps/UI/AvailableArea/TabBarArea.swift +++ /dev/null @@ -1,25 +0,0 @@ -final class TabBarArea: AvailableArea { - override var areaFrame: CGRect { - return frame - } - - override func isAreaAffectingView(_ other: UIView) -> Bool { - return !other.tabBarAreaAffectDirections.isEmpty - } - - override func addAffectingView(_ other: UIView) { - let ov = other.tabBarAreaAffectView - let directions = ov.tabBarAreaAffectDirections - addConstraints(otherView: ov, directions: directions) - } - - override func notifyObserver() { - BottomTabBarViewController.updateAvailableArea(areaFrame) - } -} - -extension UIView { - @objc var tabBarAreaAffectDirections: MWMAvailableAreaAffectDirections { return [] } - - var tabBarAreaAffectView: UIView { return self } -} diff --git a/iphone/Maps/UI/AvailableArea/TrafficButtonArea.swift b/iphone/Maps/UI/AvailableArea/TrafficButtonArea.swift deleted file mode 100644 index 8747e23f455..00000000000 --- a/iphone/Maps/UI/AvailableArea/TrafficButtonArea.swift +++ /dev/null @@ -1,21 +0,0 @@ -final class TrafficButtonArea: AvailableArea { - override func isAreaAffectingView(_ other: UIView) -> Bool { - return !other.trafficButtonAreaAffectDirections.isEmpty - } - - override func addAffectingView(_ other: UIView) { - let ov = other.trafficButtonAreaAffectView - let directions = ov.trafficButtonAreaAffectDirections - addConstraints(otherView: ov, directions: directions) - } - - override func notifyObserver() { - MWMTrafficButtonViewController.updateAvailableArea(areaFrame) - } -} - -extension UIView { - @objc var trafficButtonAreaAffectDirections: MWMAvailableAreaAffectDirections { return [] } - - var trafficButtonAreaAffectView: UIView { return self } -} diff --git a/iphone/Maps/UI/AvailableArea/VisibleArea.swift b/iphone/Maps/UI/AvailableArea/VisibleArea.swift deleted file mode 100644 index 4e3b1e00a2e..00000000000 --- a/iphone/Maps/UI/AvailableArea/VisibleArea.swift +++ /dev/null @@ -1,26 +0,0 @@ -final class VisibleArea: AvailableArea { - override func isAreaAffectingView(_ other: UIView) -> Bool { - return !other.visibleAreaAffectDirections.isEmpty - } - - override func addAffectingView(_ other: UIView) { - let ov = other.visibleAreaAffectView - let directions = ov.visibleAreaAffectDirections - addConstraints(otherView: ov, directions: directions) - } - - override func notifyObserver() { - if #available(iOS 12.0, *) { - if CarPlayService.shared.isCarplayActivated { - return - } - } - FrameworkHelper.setVisibleViewport(areaFrame, scaleFactor: MapViewController.shared()?.mapView.contentScaleFactor ?? 1) - } -} - -extension UIView { - @objc var visibleAreaAffectDirections: MWMAvailableAreaAffectDirections { return [] } - - var visibleAreaAffectView: UIView { return self } -} diff --git a/iphone/Maps/UI/BottomMenu/Menu/BottomMenuBuilder.swift b/iphone/Maps/UI/BottomMenu/Menu/BottomMenuBuilder.swift index 1424425ed15..b25e2420b2f 100644 --- a/iphone/Maps/UI/BottomMenu/Menu/BottomMenuBuilder.swift +++ b/iphone/Maps/UI/BottomMenu/Menu/BottomMenuBuilder.swift @@ -1,33 +1,27 @@ @objc class BottomMenuBuilder: NSObject { @objc static func buildMenu(mapViewController: MapViewController, - controlsManager: MWMMapViewControlsManager, delegate: BottomMenuDelegate) -> UIViewController { return BottomMenuBuilder.build(mapViewController: mapViewController, - controlsManager: controlsManager, delegate: delegate, sections: [.layers, .items], source: kStatMenu) } @objc static func buildLayers(mapViewController: MapViewController, - controlsManager: MWMMapViewControlsManager, delegate: BottomMenuDelegate) -> UIViewController { return BottomMenuBuilder.build(mapViewController: mapViewController, - controlsManager: controlsManager, delegate: delegate, sections: [.layers], source: kStatMap) } private static func build(mapViewController: MapViewController, - controlsManager: MWMMapViewControlsManager, delegate: BottomMenuDelegate, sections: [BottomMenuPresenter.Sections], source: String) -> UIViewController { let viewController = BottomMenuViewController(nibName: nil, bundle: nil) let interactor = BottomMenuInteractor(viewController: viewController, mapViewController: mapViewController, - controlsManager: controlsManager, delegate: delegate) let presenter = BottomMenuPresenter(view: viewController, interactor: interactor, sections: sections, source: source) diff --git a/iphone/Maps/UI/BottomMenu/Menu/BottomMenuInteractor.swift b/iphone/Maps/UI/BottomMenu/Menu/BottomMenuInteractor.swift index c9b439b80f6..f203a5de1ef 100644 --- a/iphone/Maps/UI/BottomMenu/Menu/BottomMenuInteractor.swift +++ b/iphone/Maps/UI/BottomMenu/Menu/BottomMenuInteractor.swift @@ -8,9 +8,9 @@ protocol BottomMenuInteractorProtocol: class { } @objc protocol BottomMenuDelegate { - func actionDownloadMaps(_ mode: MWMMapDownloaderMode) func addPlace() func didFinishAddingPlace() + func didFinish() } class BottomMenuInteractor { @@ -18,26 +18,19 @@ class BottomMenuInteractor { private weak var viewController: UIViewController? private weak var mapViewController: MapViewController? private weak var delegate: BottomMenuDelegate? - private weak var controlsManager: MWMMapViewControlsManager? init(viewController: UIViewController, mapViewController: MapViewController, - controlsManager: MWMMapViewControlsManager, delegate: BottomMenuDelegate) { self.viewController = viewController self.mapViewController = mapViewController self.delegate = delegate - self.controlsManager = controlsManager } } extension BottomMenuInteractor: BottomMenuInteractorProtocol { func close() { - if controlsManager?.guidesNavigationBarHidden == false { - controlsManager?.menuState = .inactive - } else { - controlsManager?.menuState = .hidden - } + delegate?.didFinish() } func addPlace() { @@ -54,7 +47,7 @@ extension BottomMenuInteractor: BottomMenuInteractorProtocol { func downloadMaps() { Statistics.logEvent(kStatToolbarClick, withParameters: [kStatItem : kStatDownloadMaps]) close() - self.delegate?.actionDownloadMaps(.downloaded) + mapViewController?.openMapsDownloader(.downloaded) } func openSettings() { diff --git a/iphone/Maps/UI/BottomMenu/Menu/BottomMenuPresenter.swift b/iphone/Maps/UI/BottomMenu/Menu/BottomMenuPresenter.swift index 76c6ebcb41e..7fa61525d84 100644 --- a/iphone/Maps/UI/BottomMenu/Menu/BottomMenuPresenter.swift +++ b/iphone/Maps/UI/BottomMenu/Menu/BottomMenuPresenter.swift @@ -59,7 +59,7 @@ extension BottomMenuPresenter { let cell = tableView.dequeueReusableCell(cell: BottomMenuItemCell.self)! switch CellType(rawValue: indexPath.row)! { case .addPlace: - let enabled = MWMNavigationDashboardManager.shared().state == .hidden && FrameworkHelper.canEditMap() + let enabled = MWMNavigationDashboardManager.shared().state == .hidden && FrameworkHelper.shared().canEditMap() cell.configure(imageName: "ic_add_place", title: L("placepage_add_place_button"), badgeCount: 0, diff --git a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarBuilder.swift b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarBuilder.swift index 39695b5aa70..6f5d9b95935 100644 --- a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarBuilder.swift +++ b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarBuilder.swift @@ -1,14 +1,6 @@ @objc class BottomTabBarBuilder: NSObject { @objc static func build(mapViewController: MapViewController, controlsManager: MWMMapViewControlsManager) -> BottomTabBarViewController { let viewController = BottomTabBarViewController(nibName: nil, bundle: nil) - let interactor = BottomTabBarInteractor(viewController: viewController, - mapViewController: mapViewController, - controlsManager: controlsManager) - let presenter = BottomTabBarPresenter(view: viewController, interactor: interactor) - - interactor.presenter = presenter - viewController.presenter = presenter - return viewController } } diff --git a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarInteractor.swift b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarInteractor.swift index e9ebc98531b..ced403b2258 100644 --- a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarInteractor.swift +++ b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarInteractor.swift @@ -16,7 +16,11 @@ class BottomTabBarInteractor { private var isPoint2PointSelected = false - + init(viewController: UIViewController, + mapViewController: MapViewController) { + self.viewController = viewController + self.mapViewController = mapViewController + } init(viewController: UIViewController, mapViewController: MapViewController, diff --git a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarView.swift b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarView.swift deleted file mode 100644 index 2758fba4f1a..00000000000 --- a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarView.swift +++ /dev/null @@ -1,15 +0,0 @@ -import UIKit - -class BottomTabBarView: SolidTouchView { - override var placePageAreaAffectDirections: MWMAvailableAreaAffectDirections { - return alternative(iPhone: [], iPad: [.bottom]) - } - - override var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { - return [.bottom] - } - - override var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections { - return [.bottom] - } -} diff --git a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarViewController.swift b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarViewController.swift index 254064878ce..ecf0046ce8b 100644 --- a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarViewController.swift +++ b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarViewController.swift @@ -1,12 +1,21 @@ protocol BottomTabBarViewProtocol: class { - var presenter: BottomTabBarPresenterProtocol! { get set } +// var presenter: BottomTabBarPresenterProtocol! { get set } var isHidden: Bool { get } var isLayersBadgeHidden: Bool { get set } var isApplicationBadgeHidden: Bool { get set } } -class BottomTabBarViewController: UIViewController { - var presenter: BottomTabBarPresenterProtocol! +protocol BottomTabBarViewControllerDelegate: AnyObject { + func search() + func route() + func discovery() + func bookmarks() + func menu() +} + +final class BottomTabBarViewController: UIViewController { +// var presenter: BottomTabBarPresenterProtocol! + var delegate: BottomTabBarViewControllerDelegate? @IBOutlet var searchButton: MWMButton! @IBOutlet var routeButton: MWMButton! @@ -15,36 +24,29 @@ class BottomTabBarViewController: UIViewController { @IBOutlet var moreButton: MWMButton! @IBOutlet var downloadBadge: UIView! - private var avaliableArea = CGRect.zero - @objc var isHidden: Bool = false { - didSet { - updateFrame(animated: true) - } - } var isLayersBadgeHidden: Bool = true { didSet { updateBadge() } } - @objc var isApplicationBadgeHidden: Bool = true { + + var isApplicationBadgeHidden: Bool = true { didSet { updateBadge() } } - var tabBarView: BottomTabBarView { - return view as! BottomTabBarView - } - @objc static var controller: BottomTabBarViewController? { - return MWMMapViewControlsManager.manager()?.tabBarController - } - + +// var tabBarView: BottomTabBarView { +// return view as! BottomTabBarView +// } + override func viewDidLoad() { super.viewDidLoad() - presenter.configure() +// presenter.configure() updateBadge() MWMSearchManager.add(self) - MWMNavigationDashboardManager.add(self) +// MWMNavigationDashboardManager.add(self) } override func viewDidAppear(_ animated: Bool) { @@ -53,61 +55,32 @@ class BottomTabBarViewController: UIViewController { deinit { MWMSearchManager.remove(self) - MWMNavigationDashboardManager.remove(self) - } - - static func updateAvailableArea(_ frame: CGRect) { - BottomTabBarViewController.controller?.updateAvailableArea(frame) +// MWMNavigationDashboardManager.remove(self) } @IBAction func onSearchButtonPressed(_ sender: Any) { - presenter.onSearchButtonPressed() + delegate?.search() +// presenter.onSearchButtonPressed() } @IBAction func onPoint2PointButtonPressed(_ sender: Any) { - presenter.onPoint2PointButtonPressed() + delegate?.route() +// presenter.onPoint2PointButtonPressed() } @IBAction func onDiscoveryButtonPressed(_ sender: Any) { - presenter.onDiscoveryButtonPressed() + delegate?.discovery() +// presenter.onDiscoveryButtonPressed() } @IBAction func onBookmarksButtonPressed(_ sender: Any) { - presenter.onBookmarksButtonPressed() + delegate?.bookmarks() +// presenter.onBookmarksButtonPressed() } @IBAction func onMenuButtonPressed(_ sender: Any) { - presenter.onMenuButtonPressed() - } - - - private func updateAvailableArea(_ frame:CGRect) { - avaliableArea = frame - updateFrame(animated: false) - self.view.layoutIfNeeded() - } - - private func updateFrame(animated: Bool) { - if avaliableArea == .zero { - return - } - let newFrame = CGRect(x: avaliableArea.minX, - y: isHidden ? avaliableArea.minY + avaliableArea.height : avaliableArea.minY, - width: avaliableArea.width, - height: avaliableArea.height) - let alpha:CGFloat = isHidden ? 0 : 1 - if animated { - UIView.animate(withDuration: kDefaultAnimationDuration, - delay: 0, - options: [.beginFromCurrentState], - animations: { - self.view.frame = newFrame - self.view.alpha = alpha - }, completion: nil) - } else { - self.view.frame = newFrame - self.view.alpha = alpha - } + delegate?.menu() +// presenter.onMenuButtonPressed() } private func updateBadge() { @@ -115,18 +88,18 @@ class BottomTabBarViewController: UIViewController { } } -extension BottomTabBarViewController: BottomTabBarViewProtocol { - -} - +//extension BottomTabBarViewController: BottomTabBarViewProtocol { +// +//} +// // MARK: - MWMNavigationDashboardObserver -extension BottomTabBarViewController: MWMNavigationDashboardObserver { - func onNavigationDashboardStateChanged() { - let state = MWMNavigationDashboardManager.shared().state - self.isHidden = state != .hidden; - } -} +//extension BottomTabBarViewController: MWMNavigationDashboardObserver { +// func onNavigationDashboardStateChanged() { +// let state = MWMNavigationDashboardManager.shared().state +// self.isHidden = state != .hidden; +// } +//} // MARK: - MWMSearchManagerObserver diff --git a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarViewController.xib b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarViewController.xib index 4ea2ffbf010..0ef840c0754 100644 --- a/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarViewController.xib +++ b/iphone/Maps/UI/BottomMenu/TabBar/BottomTabBarViewController.xib @@ -1,9 +1,9 @@ - + - + @@ -20,17 +20,10 @@ - - + + - - - - - - - @@ -104,7 +97,6 @@ - @@ -130,12 +122,9 @@ + - - - - @@ -144,7 +133,6 @@ - diff --git a/iphone/Maps/UI/CarPlay/CarPlayMapViewController.swift b/iphone/Maps/UI/CarPlay/CarPlayMapViewController.swift index 12bee7b2f37..8a019e1bcd7 100644 --- a/iphone/Maps/UI/CarPlay/CarPlayMapViewController.swift +++ b/iphone/Maps/UI/CarPlay/CarPlayMapViewController.swift @@ -126,7 +126,7 @@ final class CarPlayMapViewController: MWMViewController { frame.origin = origin frame.size = CGSize(width: viewBounds.width - origin.x, height: viewBounds.height - origin.y) - FrameworkHelper.setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1) + FrameworkHelper.shared().setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1) } private func updateVisibleViewPortToNavigationState() { @@ -139,11 +139,11 @@ final class CarPlayMapViewController: MWMViewController { frame.origin = origin frame.size = CGSize(width: viewBounds.width - (origin.x + mapControlsWidth), height: viewBounds.height - origin.y) - FrameworkHelper.setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1) + FrameworkHelper.shared().setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1) } private func updateVisibleViewPortToDefaultState() { - FrameworkHelper.setVisibleViewport(view.bounds, scaleFactor: mapView?.contentScaleFactor ?? 1) + FrameworkHelper.shared().setVisibleViewport(view.bounds, scaleFactor: mapView?.contentScaleFactor ?? 1) } override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm index 243c37f890e..986d60af487 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm @@ -280,7 +280,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView canUseNetwork: self.canUseNetwork tap:^{ __strong __typeof__(weakSelf) strongSelf = weakSelf; - if (![MWMFrameworkHelper isNetworkConnected]) { + if (![[MWMFrameworkHelper sharedHelper] isNetworkConnected]) { NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; UIApplication * app = UIApplication.sharedApplication; if ([app canOpenURL:url]) diff --git a/iphone/Maps/UI/Downloader/SearchMapsDataSource.swift b/iphone/Maps/UI/Downloader/SearchMapsDataSource.swift index 2763898312d..ac819618412 100644 --- a/iphone/Maps/UI/Downloader/SearchMapsDataSource.swift +++ b/iphone/Maps/UI/Downloader/SearchMapsDataSource.swift @@ -62,7 +62,7 @@ extension SearchMapsDataSource: IDownloaderDataSource { func search(_ query: String, locale: String, update: @escaping SearchCallback) { searchId += 1 onUpdate = update - FrameworkHelper.search(inDownloader: query, inputLocale: locale) { [weak self, searchId] (results, finished) in + FrameworkHelper.shared().search(inDownloader: query, inputLocale: locale) { [weak self, searchId] (results, finished) in if searchId != self?.searchId { return } diff --git a/iphone/Maps/UI/EditBookmark/EditBookmarkViewController.swift b/iphone/Maps/UI/EditBookmark/EditBookmarkViewController.swift index 9b1ba67ae37..f0b68055f92 100644 --- a/iphone/Maps/UI/EditBookmark/EditBookmarkViewController.swift +++ b/iphone/Maps/UI/EditBookmark/EditBookmarkViewController.swift @@ -22,9 +22,9 @@ final class EditBookmarkViewController: MWMTableViewController { private var bookmarkTitle: String? private var bookmarkDescription: String? private var bookmarkGroupTitle: String? - private var bookmarkId = FrameworkHelper.invalidBookmarkId() - private var bookmarkGroupId = FrameworkHelper.invalidCategoryId() - private var newBookmarkGroupId = FrameworkHelper.invalidCategoryId() + private var bookmarkId = FrameworkHelper.shared().invalidBookmarkId() + private var bookmarkGroupId = FrameworkHelper.shared().invalidCategoryId() + private var newBookmarkGroupId = FrameworkHelper.shared().invalidCategoryId() private var bookmarkColor: BookmarkColor! override func viewDidLoad() { @@ -135,7 +135,7 @@ final class EditBookmarkViewController: MWMTableViewController { title: bookmarkTitle ?? "", color: bookmarkColor, description: bookmarkDescription ?? "") - FrameworkHelper.updatePlacePageData() + FrameworkHelper.shared().updatePlacePageData() placePageData.updateBookmarkStatus() goBack() } @@ -165,7 +165,7 @@ extension EditBookmarkViewController: MWMNoteCellDelegate { extension EditBookmarkViewController: MWMButtonCellDelegate { func cellDidPressButton(_ cell: UITableViewCell) { BookmarksManager.shared().deleteBookmark(bookmarkId) - FrameworkHelper.updatePlacePageData() + FrameworkHelper.shared().updatePlacePageData() placePageData.updateBookmarkStatus() goBack() } diff --git a/iphone/Maps/UI/EditBookmark/legacy_bookmark_colors.h b/iphone/Maps/UI/EditBookmark/legacy_bookmark_colors.h deleted file mode 100644 index 73649714b7a..00000000000 --- a/iphone/Maps/UI/EditBookmark/legacy_bookmark_colors.h +++ /dev/null @@ -1,58 +0,0 @@ -#import "CircleView.h" - -#include "kml/types.hpp" - -namespace ios_bookmark_ui_helper -{ -inline UIColor * UIColorForRGB(int red, int green, int blue) -{ - return [UIColor colorWithRed:red/255.f green:green/255.f blue:blue/255.f alpha:0.8]; -} - -inline UIColor * UIColorForBookmarkColor(kml::PredefinedColor color) -{ - switch (color) - { - case kml::PredefinedColor::Red: return UIColorForRGB(229, 27, 35); - case kml::PredefinedColor::Pink: return UIColorForRGB(255, 65, 130); - case kml::PredefinedColor::Purple: return UIColorForRGB(155, 36, 178); - case kml::PredefinedColor::DeepPurple: return UIColorForRGB(102, 57, 191); - case kml::PredefinedColor::Blue: return UIColorForRGB(0, 102, 204); - case kml::PredefinedColor::LightBlue: return UIColorForRGB(36, 156, 242); - case kml::PredefinedColor::Cyan: return UIColorForRGB(20, 190, 205); - case kml::PredefinedColor::Teal: return UIColorForRGB(0, 165, 140); - case kml::PredefinedColor::Green: return UIColorForRGB(60, 140, 60); - case kml::PredefinedColor::Lime: return UIColorForRGB(147, 191, 57); - case kml::PredefinedColor::Yellow: return UIColorForRGB(255, 200, 0); - case kml::PredefinedColor::Orange: return UIColorForRGB(255, 150, 0); - case kml::PredefinedColor::DeepOrange: return UIColorForRGB(240, 100, 50); - case kml::PredefinedColor::Brown: return UIColorForRGB(128, 70, 51); - case kml::PredefinedColor::Gray: return UIColorForRGB(115, 115, 115); - case kml::PredefinedColor::BlueGray: return UIColorForRGB(89, 115, 128); - case kml::PredefinedColor::None: - case kml::PredefinedColor::Count: return UIColorForBookmarkColor(kml::PredefinedColor::Red); - } -} - -inline UIImage * ImageForBookmark(kml::PredefinedColor color, kml::BookmarkIcon icon) -{ - CGFloat const kPinDiameter = 22; - - NSString *imageName = [NSString stringWithFormat:@"%@%@", @"ic_bm_", [@(kml::ToString(icon).c_str()) lowercaseString]]; - - return [CircleView createCircleImageWithDiameter:kPinDiameter - andColor:UIColorForBookmarkColor(color) - andImageName:imageName]; -} - -inline UIImage * ImageForTrack(float red, float green, float blue) -{ - CGFloat const kPinDiameter = 22; - return [CircleView createCircleImageWithDiameter:kPinDiameter - andColor:[UIColor colorWithRed:red - green:green - blue:blue - alpha:1.f]]; -} -} // namespace ios_bookmark_ui_helper - diff --git a/iphone/Maps/UI/PlacePage/Components/GuidesGallery/GuidesGalleryViewController.swift b/iphone/Maps/UI/PlacePage/Components/GuidesGallery/GuidesGalleryViewController.swift index 57217d40fec..ec5b53357ef 100644 --- a/iphone/Maps/UI/PlacePage/Components/GuidesGallery/GuidesGalleryViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/GuidesGallery/GuidesGalleryViewController.swift @@ -142,3 +142,9 @@ fileprivate final class RoutesGalleryLayout: UICollectionViewFlowLayout { return CGPoint(x: adjustedIndex * pageWidth, y: 0) } } + +extension GuidesGalleryViewController: MapOverlayViewProtocol { + var bottomView: UIView { + view + } +} diff --git a/iphone/Maps/UI/PlacePage/PlacePageBuilder.swift b/iphone/Maps/UI/PlacePage/PlacePageBuilder.swift index d8fbf84e8ce..4d92e989ba6 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageBuilder.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageBuilder.swift @@ -1,5 +1,5 @@ @objc class PlacePageBuilder: NSObject { - @objc static func build() -> UIViewController { + @objc static func build() -> PlacePageViewController { let storyboard = UIStoryboard.instance(.placePage) guard let viewController = storyboard.instantiateInitialViewController() as? PlacePageViewController else { fatalError() diff --git a/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift b/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift index 4eafc4d9677..b84a19cf204 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift @@ -1,5 +1,4 @@ protocol PlacePageInteractorProtocol: class { - func updateTopBound(_ bound: CGFloat, duration: TimeInterval) } class PlacePageInteractor { @@ -17,9 +16,6 @@ class PlacePageInteractor { } extension PlacePageInteractor: PlacePageInteractorProtocol { - func updateTopBound(_ bound: CGFloat, duration: TimeInterval) { - mapViewController?.setPlacePageTopBound(bound, duration: duration) - } } // MARK: - PlacePagePreviewViewControllerDelegate diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift index e351031eab5..4991710edab 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift @@ -84,7 +84,7 @@ final class UGCAddReviewController: MWMTableViewController { let onError = { Toast.toast(withText: L("ugc_thanks_message_not_auth")).show() } let onComplete = { () -> Void in nc.popToRootViewController(animated: true) } - if User.isAuthenticated() || !FrameworkHelper.isNetworkConnected() { + if User.isAuthenticated() || !FrameworkHelper.shared().isNetworkConnected() { if User.isAuthenticated() { onSuccess() } else { diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Layouts/PlacePageCommonLayout.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Layouts/PlacePageCommonLayout.swift index 21a1c198758..56b779d4a02 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Layouts/PlacePageCommonLayout.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Layouts/PlacePageCommonLayout.swift @@ -224,7 +224,7 @@ class PlacePageCommonLayout: NSObject, IPlacePageLayout { if placePageData.taxiProvider != .none && !LocationManager.isLocationProhibited() && - FrameworkHelper.isNetworkConnected() { + FrameworkHelper.shared().isNetworkConnected() { viewControllers.append(taxiViewController) } diff --git a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm index 6ddf15cc159..f0677262ed6 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm @@ -490,15 +490,6 @@ - (void)openElevationDifficultPopup:(PlacePageData *)data { [[MapViewController sharedController] presentViewController:difficultyPopup animated:YES completion:nil]; } -#pragma mark - AvailableArea / PlacePageArea - -- (void)updateAvailableArea:(CGRect)frame -{ -// auto data = self.data; -// if (data) -// [self.layout updateAvailableArea:frame]; -} - #pragma mark - MWMFeatureHolder - (FeatureID const &)featureId { return GetFramework().GetCurrentPlacePageInfo().GetID(); } diff --git a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h index e281d31718b..7fc13394057 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h +++ b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.h @@ -6,7 +6,6 @@ @interface MWMPlacePageManagerHelper : NSObject -+ (void)updateAvailableArea:(CGRect)frame; + (void)showUGCAddReview:(PlacePageData *)data rating:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source; diff --git a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm index 74437353187..0cb78e0651a 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManagerHelper.mm @@ -10,7 +10,6 @@ @interface MWMMapViewControlsManager () @interface MWMPlacePageManager () -- (void)updateAvailableArea:(CGRect)frame; - (void)showUGCAddReview:(PlacePageData *)data rating:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source; - (void)searchSimilar:(PlacePageData *)data; - (void)editPlace; @@ -48,11 +47,6 @@ - (void)openElevationDifficultPopup:(PlacePageData *)data; @implementation MWMPlacePageManagerHelper -+ (void)updateAvailableArea:(CGRect)frame -{ - [[MWMMapViewControlsManager manager].placePageManager updateAvailableArea:frame]; -} - + (void)showUGCAddReview:(PlacePageData *)data rating:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source { [[MWMMapViewControlsManager manager].placePageManager showUGCAddReview:data rating:value fromSource:source]; } diff --git a/iphone/Maps/UI/PlacePage/PlacePagePresenter.swift b/iphone/Maps/UI/PlacePage/PlacePagePresenter.swift index 2682cd11334..2c43f90fa6f 100644 --- a/iphone/Maps/UI/PlacePage/PlacePagePresenter.swift +++ b/iphone/Maps/UI/PlacePage/PlacePagePresenter.swift @@ -3,7 +3,6 @@ protocol PlacePagePresenterProtocol: class { func layoutIfNeeded() func showNextStop() func closeAnimated() - func updateTopBound(_ bound: CGFloat, duration: TimeInterval) } class PlacePagePresenter: NSObject { @@ -39,8 +38,4 @@ extension PlacePagePresenter: PlacePagePresenterProtocol { func closeAnimated() { view.closeAnimated() } - - func updateTopBound(_ bound: CGFloat, duration: TimeInterval) { - interactor.updateTopBound(bound, duration: duration) - } } diff --git a/iphone/Maps/UI/PlacePage/PlacePageViewController.swift b/iphone/Maps/UI/PlacePage/PlacePageViewController.swift index df9c53cc2a8..1192b6601a8 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageViewController.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageViewController.swift @@ -167,12 +167,6 @@ final class PlacePageScrollView: UIScrollView { } } } - - func updateTopBound(_ bound: CGFloat, duration: TimeInterval) { - alternativeSizeClass(iPhone: { - presenter.updateTopBound(bound, duration: duration) - }, iPad: {}) - } } extension PlacePageViewController: PlacePageViewProtocol { @@ -231,9 +225,7 @@ extension PlacePageViewController: PlacePageViewProtocol { beginDragging = true } let scrollPosition = CGPoint(x: point.x, y: min(scrollView.contentSize.height - scrollView.height, point.y)) - let bound = view.height + scrollPosition.y if animated { - updateTopBound(bound, duration: kDefaultAnimationDuration) UIView.animate(withDuration: kDefaultAnimationDuration, animations: { [weak scrollView] in scrollView?.contentOffset = scrollPosition self.layoutIfNeeded() @@ -286,9 +278,6 @@ extension PlacePageViewController: UIScrollViewDelegate { rootViewController.dismissPlacePage() } onOffsetChanged(scrollView.contentOffset.y) - - let bound = view.height + scrollView.contentOffset.y - updateTopBound(bound, duration: 0) } func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { @@ -345,3 +334,9 @@ extension PlacePageViewController: UIScrollViewDelegate { } } } + +extension PlacePageViewController: MapOverlayViewProtocol { + var bottomView: UIView { + stackView + } +} diff --git a/iphone/Maps/UI/Search/SearchBar.swift b/iphone/Maps/UI/Search/SearchBar.swift index 45738f84850..75d8463daf8 100644 --- a/iphone/Maps/UI/Search/SearchBar.swift +++ b/iphone/Maps/UI/Search/SearchBar.swift @@ -14,16 +14,8 @@ final class SearchBar: SolidTouchView { @IBOutlet private var bookingGuestCountLabel: UILabel! @IBOutlet private var bookingDatesLabel: UILabel! - override var visibleAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: .top, iPad: .left) } - - override var placePageAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: [], iPad: .left) } - override var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: [], iPad: .left) } - override var trafficButtonAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: .top, iPad: .left) } - - override var tabBarAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: [], iPad: .left) } - @objc var state: SearchBarState = .ready { didSet { if state != oldValue { diff --git a/iphone/Maps/UI/Settings/MWMAboutController.m b/iphone/Maps/UI/Settings/MWMAboutController.m index 581d5cc6311..5094b8b73e8 100644 --- a/iphone/Maps/UI/Settings/MWMAboutController.m +++ b/iphone/Maps/UI/Settings/MWMAboutController.m @@ -41,7 +41,8 @@ - (void)viewDidLoad version = [NSString stringWithFormat:@"%@.%@", version, appInfo.buildNumber]; self.versionLabel.text = [NSString stringWithFormat:L(@"version"), version]; - self.dataVersionLabel.text = [NSString stringWithFormat:L(@"data_version"), [MWMFrameworkHelper dataVersion]]; + self.dataVersionLabel.text = [NSString stringWithFormat:L(@"data_version"), + [[MWMFrameworkHelper sharedHelper] dataVersion]]; [self.crashlyticsCell configWithDelegate:self title:L(@"opt_out_fabric") isOn:![MWMSettings crashReportingDisabled]]; } diff --git a/iphone/Maps/UI/Settings/MWMHelpController.m b/iphone/Maps/UI/Settings/MWMHelpController.m index 2a29a3bc0ea..4fab6b280bc 100644 --- a/iphone/Maps/UI/Settings/MWMHelpController.m +++ b/iphone/Maps/UI/Settings/MWMHelpController.m @@ -26,7 +26,7 @@ - (void)viewDidLoad self.title = L(@"help"); NSString * html; - if ([MWMFrameworkHelper isNetworkConnected]) { + if ([[MWMFrameworkHelper sharedHelper] isNetworkConnected]) { NSURL *url = [NSURL URLWithString:@"https://support.maps.me"]; self.aboutViewController = [[WebViewController alloc] initWithUrl:url title:nil]; } else { diff --git a/iphone/Maps/UI/Storyboard/Main.storyboard b/iphone/Maps/UI/Storyboard/Main.storyboard index 54701f2fc76..dac5f3ab29c 100644 --- a/iphone/Maps/UI/Storyboard/Main.storyboard +++ b/iphone/Maps/UI/Storyboard/Main.storyboard @@ -1,10 +1,11 @@ - + + @@ -13,29 +14,29 @@ - + - + - + - - - - - - @@ -97,30 +61,12 @@ - - - - - - - - - - - - - - - - - - @@ -128,7 +74,7 @@ - + @@ -155,7 +101,7 @@ - + @@ -200,36 +146,22 @@ - - - - - - - - - - - - - - @@ -238,29 +170,13 @@ - - - - - - - - - - - - - - - - - + @@ -278,11 +194,11 @@ - - + + @@ -292,16 +208,10 @@ - - - - - - @@ -320,7 +230,234 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -337,14 +474,14 @@ - + - + @@ -364,7 +501,7 @@ - + @@ -380,7 +517,7 @@ - + @@ -406,11 +543,11 @@ - + - + @@ -421,10 +558,10 @@ - + - + @@ -441,7 +578,7 @@ - + @@ -450,7 +587,7 @@ - + @@ -459,7 +596,7 @@ - + @@ -468,7 +605,7 @@ - + @@ -477,10 +614,10 @@ - + - + - + @@ -503,7 +640,7 @@ - + @@ -512,7 +649,7 @@ - + @@ -609,7 +746,7 @@ - + @@ -677,26 +814,26 @@ - + - + - + - + @@ -766,7 +903,7 @@ - + @@ -811,11 +948,11 @@ - + - + @@ -826,7 +963,7 @@ - + @@ -837,7 +974,7 @@ - + @@ -881,11 +1018,11 @@ - + - + @@ -897,7 +1034,7 @@ - + @@ -908,7 +1045,7 @@ - + @@ -918,13 +1055,13 @@ - + @@ -971,27 +1108,27 @@ - + - + - + - + - + - + @@ -999,7 +1136,7 @@