[iOS] Navigation bar on map

https://jira.mail.ru/browse/MAPSME-14892
This commit is contained in:
Alexander Boriskov 2020-09-22 15:57:55 +03:00 committed by Aleksey Belousov
parent c332ff2076
commit b9559b2eb4
22 changed files with 338 additions and 210 deletions

View file

@ -1,17 +1,17 @@
import UIKit
@objc class BookmarksCoordinator: NSObject {
@objc enum BookmarksState: Int {
enum BookmarksState {
case opened
case closed
case hidden
case hidden(categoryId: MWMMarkGroupID)
}
private weak var navigationController: UINavigationController?
private weak var controlsManager: MWMMapViewControlsManager?
private weak var navigationManager: MWMNavigationDashboardManager?
private var bookmarksControllers: [UIViewController]?
@objc var state: BookmarksState = .closed {
private var state: BookmarksState = .closed {
didSet {
updateForState(newState: state)
}
@ -25,6 +25,18 @@ import UIKit
self.navigationManager = navigationManager
}
@objc func open() {
state = .opened
}
@objc func close() {
state = .closed
}
@objc func hide(categoryId: MWMMarkGroupID) {
state = .hidden(categoryId: categoryId)
}
private func updateForState(newState: BookmarksState) {
guard let navigationController = navigationController else {
fatalError()
@ -47,12 +59,12 @@ import UIKit
}, completion: nil)
FrameworkHelper.deactivateMapSelection(notifyUI: true)
self.bookmarksControllers = nil
controlsManager?.bookmarksBackButtonHidden = true
controlsManager?.hideGuidesNavigationBar()
case .closed:
navigationController.popToRootViewController(animated: true)
bookmarksControllers = nil
controlsManager?.bookmarksBackButtonHidden = true
case .hidden:
controlsManager?.hideGuidesNavigationBar()
case let .hidden(categoryId):
UIView.transition(with: self.navigationController!.view,
duration: kDefaultAnimationDuration,
options: [.curveEaseInOut, .transitionCrossDissolve],
@ -60,7 +72,9 @@ import UIKit
self.bookmarksControllers = navigationController.popToRootViewController(animated: false)
}, completion: nil)
let isNavigation = navigationManager?.state != .hidden
controlsManager?.bookmarksBackButtonHidden = false || isNavigation
if isNavigation == false {
controlsManager?.showGuidesNavigationBar(categoryId)
}
}
}
}

View file

@ -1,28 +1,22 @@
#import "MWMViewController.h"
#import <CoreApi/MWMTypes.h>
#import "MWMViewController.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, BookmarksVCSelectedType) {
BookmarksVCSelectedTypeNone,
BookmarksVCSelectedTypeBookmark,
BookmarksVCSelectedTypeTrack
};
@class BookmarksVC;
@protocol BookmarksVCDelegate
- (void)bookmarksVCdidUpdateCategory:(BookmarksVC *)viewController;
- (void)bookmarksVCdidDeleteCategory:(BookmarksVC *)viewController;
- (void)bookmarksVCdidViewOnMap:(BookmarksVC *)viewController type:(BookmarksVCSelectedType) type;
- (void)bookmarksVCdidViewOnMap:(BookmarksVC *)viewController categoryId:(MWMMarkGroupID)categoryId;
@end
@interface BookmarksVC : MWMViewController <UITextFieldDelegate>
@property (nonatomic) MWMMarkGroupID categoryId;
@property (weak, nonatomic) id<BookmarksVCDelegate> delegate;
@property(nonatomic) MWMMarkGroupID categoryId;
@property(weak, nonatomic) id<BookmarksVCDelegate> delegate;
- (instancetype)initWithCategory:(MWMMarkGroupID)categoryId;

View file

@ -377,7 +377,7 @@ using namespace std;
- (void)viewOnMap {
GetFramework().ShowBookmarkCategory(self.categoryId);
[self.delegate bookmarksVCdidViewOnMap:self type:BookmarksVCSelectedTypeNone];
[self.delegate bookmarksVCdidViewOnMap:self categoryId:self.categoryId];
}
- (IBAction)onSort:(UIBarButtonItem *)sender {
@ -694,13 +694,7 @@ using namespace std;
[Statistics logEvent:kStatBookmarksSearchResultSelected withParameters:@{kStatFrom : kStatBookmarksList}];
[self.searchBar resignFirstResponder];
BookmarksVCSelectedType selectedType = BookmarksVCSelectedTypeNone;
if ([currentSection isKindOfClass:[BookmarksSection class]]) {
selectedType = BookmarksVCSelectedTypeBookmark;
} else if ([currentSection isKindOfClass:[TracksSection class]]) {
selectedType = BookmarksVCSelectedTypeTrack;
}
[self.delegate bookmarksVCdidViewOnMap:self type:selectedType];
[self.delegate bookmarksVCdidViewOnMap:self categoryId:self.categoryId];
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {

View file

@ -195,12 +195,7 @@ extension DownloadedBookmarksViewController: BookmarksVCDelegate {
func bookmarksVCdidDeleteCategory(_ viewController: BookmarksVC) { }
func bookmarksVCdidView(onMap viewController: BookmarksVC, type: BookmarksVCSelectedType) {
switch type {
case .bookmark:
coordinator?.state = .hidden
default:
coordinator?.state = .closed
}
func bookmarksVCdidView(onMap viewController: BookmarksVC, categoryId: MWMMarkGroupID) {
coordinator?.hide(categoryId: categoryId)
}
}

View file

@ -392,12 +392,7 @@ extension BMCViewController: BookmarksVCDelegate {
navigationController?.popToViewController(parentVC, animated: true)
}
func bookmarksVCdidView(onMap viewController: BookmarksVC, type: BookmarksVCSelectedType) {
switch type {
case .bookmark:
coordinator?.state = .hidden
default:
coordinator?.state = .closed
}
func bookmarksVCdidView(onMap viewController: BookmarksVC, categoryId: MWMMarkGroupID) {
coordinator?.hide(categoryId: categoryId)
}
}

View file

@ -1,77 +0,0 @@
class BookmarksBackButtonViewController: UIViewController {
private let kTopOffset: CGFloat = 6
private var topOffset: NSLayoutConstraint?
private var leftOffset: NSLayoutConstraint?
private var availableArea = CGRect.zero
private var mapViewController = MapViewController.shared()
private var abTestBookingBackButtonColor = ABTestManager.manager().abTestBookingBackButtonColor
@objc var hidden: Bool = true {
didSet {
refreshLayout()
}
}
@IBOutlet var button: MWMButton!
static var controller: BookmarksBackButtonViewController = {
guard let bookmarksBackButton = MWMMapViewControlsManager.manager()?.bookmarksBackButton else {
fatalError()
}
return bookmarksBackButton
}()
override func viewDidLoad() {
super.viewDidLoad()
switch abTestBookingBackButtonColor.type {
case .opaque:
button.setStyleAndApply("ButtonBookmarksBackOpaque")
default:
button.setStyleAndApply("ButtonBookmarksBack")
}
refreshLayout(false)
}
@objc func configLayout() {
guard let superview = view.superview else {
fatalError()
}
topOffset = view.topAnchor.constraint(equalTo: superview.topAnchor, constant: kTopOffset)
topOffset?.isActive = true
leftOffset = view.leadingAnchor.constraint(equalTo: superview.leadingAnchor, constant: kViewControlsOffsetToBounds)
leftOffset?.isActive = true
}
func refreshLayout(_ animated: Bool = true) {
DispatchQueue.main.async {
let availableArea = self.availableArea
let leftOffset = self.hidden ? -self.view.width : availableArea.origin.x + kViewControlsOffsetToBounds
let animations = {
self.topOffset?.constant = availableArea.origin.y + self.kTopOffset
self.leftOffset?.constant = leftOffset
self.view.alpha = self.hidden ? 0 : 1
}
if animated {
self.view.superview?.animateConstraints(animations: animations)
} else {
animations()
}
}
}
class func updateAvailableArea(_ frame: CGRect) {
let controller = BookmarksBackButtonViewController.controller
if controller.availableArea.equalTo(frame) {
return
}
controller.availableArea = frame
controller.refreshLayout()
}
@IBAction func buttonTouchUpInside(_ sender: Any) {
MapViewController.shared()?.bookmarksCoordinator.state = .opened
Statistics.logEvent(kStatBackClick, withParameters: [kStatFrom: kStatMap,
kStatTo: kStatBookmarks])
}
}

View file

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BookmarksBackButtonViewController" customModule="maps_me" customModuleProvider="target">
<connections>
<outlet property="button" destination="cCO-58-yy1" id="3ZH-dK-IBJ"/>
<outlet property="view" destination="cCO-58-yy1" id="67p-Rk-DQH"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cCO-58-yy1" customClass="MWMButton" propertyAccessControl="none">
<rect key="frame" x="0.0" y="0.0" width="56" height="56"/>
<accessibility key="accessibilityConfiguration" identifier="layers_button"/>
<constraints>
<constraint firstAttribute="width" constant="56" id="Fh2-kG-VTp"/>
<constraint firstAttribute="height" constant="56" id="STF-1m-URL"/>
</constraints>
<viewLayoutGuide key="safeArea" id="yu3-89-hgx"/>
<state key="normal" image="btn_back_light"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="ButtonBookmarksBack"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="buttonTouchUpInside:" destination="-1" eventType="touchUpInside" id="bmV-Fg-c8q"/>
</connections>
<point key="canvasLocation" x="0.0" y="0.0"/>
</button>
</objects>
<resources>
<image name="btn_back_light" width="56" height="56"/>
</resources>
</document>

View file

@ -0,0 +1,9 @@
class GuidesNavigationBarView: UIView {
override var sideButtonsAreaAffectDirections: MWMAvailableAreaAffectDirections {
return .top
}
override var trafficButtonAreaAffectDirections: MWMAvailableAreaAffectDirections {
return .top
}
}

View file

@ -0,0 +1,74 @@
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) {
category = BookmarksManager.shared().category(withId: categoryId)
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
navigationBarItem.title = category.title
let rightButton: UIButton = UIButton(type: .custom)
rightButton.setImage(UIImage(named: "ic_nav_bar_back")?.withRenderingMode(.alwaysTemplate), for: .normal)
rightButton.setTitle(L("list"), for: .normal)
rightButton.addTarget(self, action: #selector(onBackPressed), for: .touchUpInside)
rightButton.contentHorizontalAlignment = .left
rightButton.styleName = "FlatNormalTransButton"
navigationBarItem.leftBarButtonItem = UIBarButtonItem(customView: rightButton)
navigationBarItem.rightBarButtonItem = UIBarButtonItem(title: L("cancel"),
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) {
MapViewController.shared()?.bookmarksCoordinator.open()
Statistics.logEvent(kStatBackClick, withParameters: [kStatFrom: kStatMap,
kStatTo: kStatBookmarks])
}
@objc func onCancelPessed(_ sender: Any) {
MapViewController.shared()?.bookmarksCoordinator.close()
}
}

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GuidesNavigationBarViewController" customModule="maps_me" customModuleProvider="target">
<connections>
<outlet property="navigationBar" destination="X8t-dV-Pzo" id="0Qr-Dz-GiZ"/>
<outlet property="navigationBarItem" destination="0ra-tr-cS5" id="rot-KP-0tl"/>
<outlet property="view" destination="Iv5-MO-8Pg" id="FWK-vN-Dii"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Iv5-MO-8Pg" customClass="GuidesNavigationBarView" customModule="maps_me" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="88"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qZw-eD-VMo">
<rect key="frame" x="0.0" y="0.0" width="414" height="88"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="width" constant="350" id="j7g-67-BFK"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Background"/>
</userDefinedRuntimeAttributes>
<variation key="default">
<mask key="constraints">
<exclude reference="j7g-67-BFK"/>
</mask>
</variation>
<variation key="heightClass=compact">
<mask key="constraints">
<include reference="j7g-67-BFK"/>
</mask>
</variation>
</view>
<navigationBar contentMode="scaleToFill" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X8t-dV-Pzo">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="350" id="FYc-u4-JgZ"/>
</constraints>
<items>
<navigationItem title="Title" id="0ra-tr-cS5"/>
</items>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="GuidesNavigationBar"/>
</userDefinedRuntimeAttributes>
<variation key="default">
<mask key="constraints">
<exclude reference="FYc-u4-JgZ"/>
</mask>
</variation>
<variation key="heightClass=compact">
<mask key="constraints">
<include reference="FYc-u4-JgZ"/>
</mask>
</variation>
</navigationBar>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="X8t-dV-Pzo" firstAttribute="trailing" secondItem="5XC-oh-dVB" secondAttribute="trailing" id="37z-Lo-ixM"/>
<constraint firstItem="X8t-dV-Pzo" firstAttribute="leading" secondItem="5XC-oh-dVB" secondAttribute="leading" id="OOU-Ho-HZu"/>
<constraint firstItem="qZw-eD-VMo" firstAttribute="leading" secondItem="5XC-oh-dVB" secondAttribute="leading" id="QUr-kY-7ix"/>
<constraint firstAttribute="bottom" secondItem="X8t-dV-Pzo" secondAttribute="bottom" id="eAH-SY-ZW5"/>
<constraint firstItem="X8t-dV-Pzo" firstAttribute="top" secondItem="5XC-oh-dVB" secondAttribute="top" id="jjf-kv-dvT"/>
<constraint firstItem="qZw-eD-VMo" firstAttribute="top" secondItem="Iv5-MO-8Pg" secondAttribute="top" id="lOa-ka-zdu"/>
<constraint firstItem="5XC-oh-dVB" firstAttribute="trailing" secondItem="qZw-eD-VMo" secondAttribute="trailing" id="qL8-KQ-zpx"/>
<constraint firstItem="qZw-eD-VMo" firstAttribute="bottom" secondItem="X8t-dV-Pzo" secondAttribute="bottom" id="sV8-Jt-i0D"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<viewLayoutGuide key="safeArea" id="5XC-oh-dVB"/>
<variation key="default">
<mask key="constraints">
<exclude reference="qL8-KQ-zpx"/>
<exclude reference="37z-Lo-ixM"/>
</mask>
</variation>
<variation key="heightClass=regular">
<mask key="constraints">
<include reference="qL8-KQ-zpx"/>
<include reference="37z-Lo-ixM"/>
</mask>
</variation>
<point key="canvasLocation" x="0.0" y="95.089285714285708"/>
</view>
</objects>
</document>

View file

@ -5,7 +5,7 @@
@class MapViewController;
@class BottomTabBarViewController;
@class BookmarksBackButtonViewController;
@class GuidesNavigationBarViewController;
@protocol MWMFeatureHolder;
@interface MWMMapViewControlsManager : NSObject
@ -16,18 +16,22 @@
@property(nonatomic) BOOL zoomHidden;
@property(nonatomic) BOOL sideButtonsHidden;
@property(nonatomic) BOOL trafficButtonHidden;
@property(nonatomic) BOOL bookmarksBackButtonHidden;
@property(nonatomic, readonly) BOOL guidesNavigationBarHidden;
@property(nonatomic) MWMBottomMenuState menuState;
@property(nonatomic) MWMBottomMenuState menuRestoreState;
@property(nonatomic) BOOL isDirectionViewHidden;
@property(nonatomic) BottomTabBarViewController *tabBarController;
@property(nonatomic) BookmarksBackButtonViewController *bookmarksBackButton;
@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;

View file

@ -63,7 +63,6 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
self.sideButtonsHidden = NO;
self.trafficButtonHidden = NO;
self.isDirectionViewHidden = YES;
self.bookmarksBackButtonHidden = YES;
self.menuRestoreState = MWMBottomMenuStateInactive;
self.promoDiscoveryCampaign = [ABTestManager manager].promoDiscoveryCampaign;
if (_promoDiscoveryCampaign.enabled) {
@ -104,7 +103,7 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
[self.trafficButton viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[self.tabBarController viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[self.bookmarksBackButton viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[self.guidesNavigationBar viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[self.searchManager viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}
@ -197,8 +196,11 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
- (void)onSearchManagerStateChanged {
auto state = [MWMSearchManager manager].state;
if (!IPAD && state == MWMSearchManagerStateHidden)
if (!IPAD && state == MWMSearchManagerStateHidden) {
self.hidden = NO;
} else if (state != MWMSearchManagerStateHidden) {
[self hideGuidesNavigationBar];
}
}
#pragma mark - Routing
@ -207,6 +209,7 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
auto nm = self.navigationManager;
[nm onRoutePrepare];
[nm onRoutePointsUpdated];
[self.ownerController.bookmarksCoordinator close];
self.promoButton.hidden = YES;
}
@ -214,6 +217,7 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
if (IPAD)
self.searchManager.state = MWMSearchManagerStateHidden;
[self.ownerController.bookmarksCoordinator close];
[self.navigationManager onRoutePlanning];
self.promoButton.hidden = YES;
}
@ -277,16 +281,6 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
return _tabBarController;
}
- (BookmarksBackButtonViewController *)bookmarksBackButton {
if (!_bookmarksBackButton) {
_bookmarksBackButton = [[BookmarksBackButtonViewController alloc] init];
[self.ownerController addChildViewController:_bookmarksBackButton];
[self.ownerController.controlsView addSubview:_bookmarksBackButton.view];
[_bookmarksBackButton configLayout];
}
return _bookmarksBackButton;
}
- (id<MWMPlacePageProtocol>)placePageManager {
if (!_placePageManager)
_placePageManager = [[MWMPlacePageManager alloc] init];
@ -334,13 +328,25 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
self.trafficButton.hidden = self.hidden || _trafficButtonHidden;
}
- (void)setBookmarksBackButtonHidden:(BOOL)bookmarksBackButtonHidden {
_bookmarksBackButtonHidden = bookmarksBackButtonHidden;
self.bookmarksBackButton.hidden = _bookmarksBackButtonHidden;
if (_bookmarksBackButtonHidden) {
self.trafficButton.hidden = self.hidden || _trafficButtonHidden;
} else {
self.trafficButton.hidden = YES;
- (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;
}
}

View file

@ -236,7 +236,7 @@ BOOL defaultOrientation(CGSize const & size)
withParameters:@{
kStatMode: (isOnRoute ? kStatRoutingModeOnRoute : kStatRoutingModePlanning)
}];
[MapViewController sharedController].bookmarksCoordinator.state = BookmarksStateOpened;
[[MapViewController sharedController].bookmarksCoordinator open];
}
- (void)collapseSearchOnTimer

View file

@ -91,6 +91,7 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
@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;
@ -224,10 +225,6 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
}
}
BOOL const isBookmarksViewHidden = self.bookmarksCoordinator.state == BookmarksStateHidden;
if (isBookmarksViewHidden)
self.bookmarksCoordinator.state = BookmarksStateClosed;
if (!switchFullScreenMode)
return;
@ -396,7 +393,8 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
[super viewWillAppear:animated];
if ([MWMNavigationDashboardManager sharedManager].state == MWMNavigationDashboardStateHidden &&
[MWMSearchManager manager].state == MWMSearchManagerStateHidden)
[MWMSearchManager manager].state == MWMSearchManagerStateHidden &&
[MWMMapViewControlsManager manager].guidesNavigationBarHidden == NO)
self.controlsManager.menuState = self.controlsManager.menuRestoreState;
[self updateStatusBarStyle];
@ -797,7 +795,7 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
auto searchState = MWMSearchManagerStateHidden;
[MWMRouter stopRouting];
if ([action isEqualToString:@"me.maps.3daction.bookmarks"])
self.bookmarksCoordinator.state = BookmarksStateOpened;
[self.bookmarksCoordinator open];
else if ([action isEqualToString:@"me.maps.3daction.search"])
searchState = MWMSearchManagerStateDefault;
else if ([action isEqualToString:@"me.maps.3daction.route"])
@ -879,6 +877,7 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
- (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];

View file

@ -121,5 +121,14 @@ class MapStyleSheet: IStyleSheet {
s.shadowOpacity = 1
s.backgroundColor = colors.white
}
theme.add(styleName: "GuidesNavigationBar") { (s) -> (Void) in
s.barTintColor = colors.white
s.tintColor = colors.linkBlue
s.backgroundImage = UIImage()
s.shadowImage = UIImage()
s.font = fonts.regular18
s.fontColor = colors.blackPrimaryText
}
}
}

View file

@ -606,8 +606,8 @@
993DF12B23F6BDB100AC231A /* StyleManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993DF0FF23F6BDB100AC231A /* StyleManager.swift */; };
993DF12C23F6BDB100AC231A /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993DF10023F6BDB100AC231A /* Theme.swift */; };
993DF12D23F6BDB100AC231A /* GlobalStyleSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993DF10123F6BDB100AC231A /* GlobalStyleSheet.swift */; };
993ECBB324E40CEC00EA5DEF /* BookmarksBackButtonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993ECBB124E40CEC00EA5DEF /* BookmarksBackButtonViewController.swift */; };
993ECBB424E40CEC00EA5DEF /* BookmarksBackButtonViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 993ECBB224E40CEC00EA5DEF /* BookmarksBackButtonViewController.xib */; };
993ECBB324E40CEC00EA5DEF /* GuidesNavigationBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993ECBB124E40CEC00EA5DEF /* GuidesNavigationBarViewController.swift */; };
993ECBB424E40CEC00EA5DEF /* GuidesNavigationBarViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 993ECBB224E40CEC00EA5DEF /* GuidesNavigationBarViewController.xib */; };
993F5507237C622700545511 /* DeepLinkSearchStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993F54F8237C622700545511 /* DeepLinkSearchStrategy.swift */; };
993F5508237C622700545511 /* DeepLinkRouteStrategyAdapter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 993F54F9237C622700545511 /* DeepLinkRouteStrategyAdapter.mm */; };
993F5509237C622700545511 /* DeepLinkHandlerStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993F54FA237C622700545511 /* DeepLinkHandlerStrategy.swift */; };
@ -632,6 +632,8 @@
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 */; };
@ -639,13 +641,13 @@
9959C75C24599CCD008FD4FD /* DirectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9959C75B24599CCC008FD4FD /* DirectionView.swift */; };
995F1613244F0AA50060631D /* BottomMenuLayersCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 995F1611244F0AA40060631D /* BottomMenuLayersCell.swift */; };
995F1614244F0AA50060631D /* BottomMenuLayersCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 995F1612244F0AA40060631D /* BottomMenuLayersCell.xib */; };
9977E69C247BFB510073780C /* SearchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9977E69B247BFB510073780C /* SearchTextField.swift */; };
996D108A24E3DBF2002DD0E2 /* BookmarksCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 996D108924E3DBF2002DD0E2 /* BookmarksCoordinator.swift */; };
996D108124E14AEB002DD0E2 /* MultiPartnerBannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 996D107F24E14AEB002DD0E2 /* MultiPartnerBannerViewController.swift */; };
996D108224E14AEB002DD0E2 /* MultiPartnerBannerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 996D108024E14AEB002DD0E2 /* MultiPartnerBannerViewController.xib */; };
996D108624E15FBE002DD0E2 /* DownloadBannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 996D108524E15FBE002DD0E2 /* DownloadBannerViewController.swift */; };
996D108824E16E6F002DD0E2 /* BookmarksBannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 996D108724E16E6F002DD0E2 /* BookmarksBannerViewController.swift */; };
996D108A24E3DBF2002DD0E2 /* BookmarksCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 996D108924E3DBF2002DD0E2 /* BookmarksCoordinator.swift */; };
996F8C9F24E1420800498993 /* PartnerBannerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 996F8C9E24E1420800498993 /* PartnerBannerViewModel.swift */; };
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 */; };
@ -1708,8 +1710,8 @@
993DF0FF23F6BDB100AC231A /* StyleManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StyleManager.swift; sourceTree = "<group>"; };
993DF10023F6BDB100AC231A /* Theme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = "<group>"; };
993DF10123F6BDB100AC231A /* GlobalStyleSheet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalStyleSheet.swift; sourceTree = "<group>"; };
993ECBB124E40CEC00EA5DEF /* BookmarksBackButtonViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksBackButtonViewController.swift; sourceTree = "<group>"; };
993ECBB224E40CEC00EA5DEF /* BookmarksBackButtonViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BookmarksBackButtonViewController.xib; sourceTree = "<group>"; };
993ECBB124E40CEC00EA5DEF /* GuidesNavigationBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesNavigationBarViewController.swift; sourceTree = "<group>"; };
993ECBB224E40CEC00EA5DEF /* GuidesNavigationBarViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GuidesNavigationBarViewController.xib; sourceTree = "<group>"; };
993F54F8237C622700545511 /* DeepLinkSearchStrategy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeepLinkSearchStrategy.swift; sourceTree = "<group>"; };
993F54F9237C622700545511 /* DeepLinkRouteStrategyAdapter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeepLinkRouteStrategyAdapter.mm; sourceTree = "<group>"; };
993F54FA237C622700545511 /* DeepLinkHandlerStrategy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeepLinkHandlerStrategy.swift; sourceTree = "<group>"; };
@ -1735,6 +1737,8 @@
99514BB423E82B450085D3A7 /* ElevationProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElevationProfileViewController.swift; sourceTree = "<group>"; };
99514BB523E82B450085D3A7 /* ElevationProfileBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElevationProfileBuilder.swift; sourceTree = "<group>"; };
99536112235DB86C008B218F /* InsetsLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InsetsLabel.swift; sourceTree = "<group>"; };
9957140F2518B5D90070DD93 /* GuidesNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesNavigationBarView.swift; sourceTree = "<group>"; };
995714112519F2120070DD93 /* GuidesNavigationBarArea.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidesNavigationBarArea.swift; sourceTree = "<group>"; };
995738DA235484410019AEE7 /* AllPassSubscriptionViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AllPassSubscriptionViewController.xib; sourceTree = "<group>"; };
995739032355CAA30019AEE7 /* PageIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageIndicator.swift; sourceTree = "<group>"; };
995739052355CAC40019AEE7 /* ImageViewCrossDisolve.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageViewCrossDisolve.swift; sourceTree = "<group>"; };
@ -1745,12 +1749,12 @@
995F1611244F0AA40060631D /* BottomMenuLayersCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuLayersCell.swift; sourceTree = "<group>"; };
995F1612244F0AA40060631D /* BottomMenuLayersCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BottomMenuLayersCell.xib; sourceTree = "<group>"; };
996D107F24E14AEB002DD0E2 /* MultiPartnerBannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiPartnerBannerViewController.swift; sourceTree = "<group>"; };
996D108924E3DBF2002DD0E2 /* BookmarksCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksCoordinator.swift; sourceTree = "<group>"; };
9977E69B247BFB510073780C /* SearchTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTextField.swift; sourceTree = "<group>"; };
996D108024E14AEB002DD0E2 /* MultiPartnerBannerViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MultiPartnerBannerViewController.xib; sourceTree = "<group>"; };
996D108524E15FBE002DD0E2 /* DownloadBannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadBannerViewController.swift; sourceTree = "<group>"; };
996D108724E16E6F002DD0E2 /* BookmarksBannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksBannerViewController.swift; sourceTree = "<group>"; };
996D108924E3DBF2002DD0E2 /* BookmarksCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksCoordinator.swift; sourceTree = "<group>"; };
996F8C9E24E1420800498993 /* PartnerBannerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerBannerViewModel.swift; sourceTree = "<group>"; };
9977E69B247BFB510073780C /* SearchTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTextField.swift; sourceTree = "<group>"; };
9977E6A02480E1EE0073780C /* BottomMenuLayerButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuLayerButton.swift; sourceTree = "<group>"; };
9977E6A22480F9BF0073780C /* BottomMenuLayerButtonRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomMenuLayerButtonRenderer.swift; sourceTree = "<group>"; };
9989272F2449DE1500260CE2 /* TabBarArea.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarArea.swift; sourceTree = "<group>"; };
@ -3297,7 +3301,7 @@
34BC72091B0DECAE0012A34B /* MapViewControls */ = {
isa = PBXGroup;
children = (
993ECBB024E40C6700EA5DEF /* BookmarksBackButton */,
993ECBB024E40C6700EA5DEF /* GuidesNavigationBar */,
99B6A74A2362F579002C94CB /* PromoButton */,
340537621BBED98600D452C6 /* MWMMapViewControlsCommon.h */,
34BC72101B0DECAE0012A34B /* MWMMapViewControlsManager.h */,
@ -3354,6 +3358,7 @@
34FE5A6D1F18F30F00BCA729 /* TrafficButtonArea.swift */,
340708631F2905A500029ECC /* NavigationInfoArea.swift */,
9989272F2449DE1500260CE2 /* TabBarArea.swift */,
995714112519F2120070DD93 /* GuidesNavigationBarArea.swift */,
);
path = AvailableArea;
sourceTree = "<group>";
@ -3756,13 +3761,14 @@
path = Core;
sourceTree = "<group>";
};
993ECBB024E40C6700EA5DEF /* BookmarksBackButton */ = {
993ECBB024E40C6700EA5DEF /* GuidesNavigationBar */ = {
isa = PBXGroup;
children = (
993ECBB124E40CEC00EA5DEF /* BookmarksBackButtonViewController.swift */,
993ECBB224E40CEC00EA5DEF /* BookmarksBackButtonViewController.xib */,
993ECBB124E40CEC00EA5DEF /* GuidesNavigationBarViewController.swift */,
993ECBB224E40CEC00EA5DEF /* GuidesNavigationBarViewController.xib */,
9957140F2518B5D90070DD93 /* GuidesNavigationBarView.swift */,
);
path = BookmarksBackButton;
path = GuidesNavigationBar;
sourceTree = "<group>";
};
993F54F6237C622700545511 /* DeepLink */ = {
@ -5295,7 +5301,7 @@
47A13CAB24BE881000027D4F /* DatePickerViewController.xib in Resources */,
3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */,
F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */,
993ECBB424E40CEC00EA5DEF /* BookmarksBackButtonViewController.xib in Resources */,
993ECBB424E40CEC00EA5DEF /* GuidesNavigationBarViewController.xib in Resources */,
47E6CB0C2178BA3600EA102B /* SearchBannerCell.xib in Resources */,
6741A9761BF340DE002C974C /* packed_polygons.bin in Resources */,
470A8A012136097000D72FBF /* SubwayTutorialBlur.xib in Resources */,
@ -5509,6 +5515,7 @@
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 */,
@ -5614,7 +5621,7 @@
F6E2FEDF1E097BA00083EBEC /* MWMSearchManager+Layout.m in Sources */,
F64D9CA01C899C350063FA30 /* MWMEditorViralAlert.mm in Sources */,
34AC8FD11EFC02C000E7F910 /* MWMRoutePoint.mm in Sources */,
993ECBB324E40CEC00EA5DEF /* BookmarksBackButtonViewController.swift in Sources */,
993ECBB324E40CEC00EA5DEF /* GuidesNavigationBarViewController.swift in Sources */,
CDB4D5012231412900104869 /* ListTemplateBuilder.swift in Sources */,
99A906F323FA95AB0005872B /* PlacePageStyleSheet.swift in Sources */,
6741A9CF1BF340DE002C974C /* MWMLocationAlert.m in Sources */,
@ -5918,6 +5925,7 @@
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 */,

View file

@ -0,0 +1,23 @@
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 }
}

View file

@ -11,7 +11,6 @@ final class TrafficButtonArea: AvailableArea {
override func notifyObserver() {
MWMTrafficButtonViewController.updateAvailableArea(areaFrame)
BookmarksBackButtonViewController.updateAvailableArea(areaFrame)
}
}

View file

@ -33,7 +33,11 @@ class BottomMenuInteractor {
extension BottomMenuInteractor: BottomMenuInteractorProtocol {
func close() {
controlsManager?.menuState = .inactive
if controlsManager?.guidesNavigationBarHidden == false {
controlsManager?.menuState = .inactive
} else {
controlsManager?.menuState = .hidden
}
}
func addPlace() {

View file

@ -54,7 +54,7 @@ extension BottomTabBarInteractor: BottomTabBarInteractorProtocol {
}
func openBookmarks() {
mapViewController?.bookmarksCoordinator.state = .opened
mapViewController?.bookmarksCoordinator.open()
}
func openMenu() {

View file

@ -170,8 +170,7 @@ final class PlacePageScrollView: UIScrollView {
func updateTopBound(_ bound: CGFloat, duration: TimeInterval) {
alternativeSizeClass(iPhone: {
let isLandscape = UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight
presenter.updateTopBound(isLandscape ? 0 : bound, duration: duration)
presenter.updateTopBound(bound, duration: duration)
}, iPad: {})
}
}

View file

@ -68,6 +68,10 @@
</mask>
</variation>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QNg-zA-Jne" customClass="GuidesNavigationBarArea" customModule="maps_me" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="awj-9E-eBS" customClass="PlacePageArea" customModule="maps_me" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="0.20000000000000001" colorSpace="calibratedRGB"/>
@ -101,8 +105,10 @@
<constraint firstAttribute="trailing" secondItem="aVk-ab-LFJ" secondAttribute="trailing" priority="100" id="GPp-90-Ied"/>
<constraint firstItem="TdT-ia-GP9" firstAttribute="top" secondItem="rL1-9E-4b7" secondAttribute="top" priority="100" id="RAX-O7-Lnd"/>
<constraint firstAttribute="trailing" secondItem="awj-9E-eBS" secondAttribute="trailing" priority="100" id="TEL-dH-TJ7"/>
<constraint firstItem="QNg-zA-Jne" firstAttribute="leading" secondItem="rL1-9E-4b7" secondAttribute="leading" id="VQH-6U-4Db"/>
<constraint firstAttribute="trailing" secondItem="TdT-ia-GP9" secondAttribute="trailing" priority="100" id="aeq-NS-iqz"/>
<constraint firstItem="awj-9E-eBS" firstAttribute="leading" secondItem="rL1-9E-4b7" secondAttribute="leading" priority="100" id="m7e-b7-NS9"/>
<constraint firstAttribute="trailing" secondItem="QNg-zA-Jne" secondAttribute="trailing" id="nMy-dG-vag"/>
<constraint firstAttribute="trailing" secondItem="QKu-4A-UgP" secondAttribute="trailing" priority="100" id="p0L-Ic-nWq"/>
<constraint firstAttribute="trailing" secondItem="65S-M4-TnM" secondAttribute="trailing" priority="100" id="pyg-ph-5Qe"/>
<constraint firstItem="awj-9E-eBS" firstAttribute="top" secondItem="rL1-9E-4b7" secondAttribute="top" priority="100" id="sdc-wL-91M"/>
@ -211,6 +217,8 @@
<constraint firstItem="utd-Jy-pE5" firstAttribute="trailing" secondItem="rL1-9E-4b7" secondAttribute="trailing" id="QdS-Yx-ADV"/>
<constraint firstItem="jio-3T-E6G" firstAttribute="leading" secondItem="utd-Jy-pE5" secondAttribute="leading" id="SAj-bF-qrr"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="xJx-UU-IdV" secondAttribute="bottom" id="SDX-4J-Jz5"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="bottom" secondItem="QNg-zA-Jne" secondAttribute="bottom" id="TGG-JD-3dN"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="bottom" secondItem="FFY-Dy-Wou" secondAttribute="bottom" id="TZk-MH-pMV"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="bottom" secondItem="xJx-UU-IdV" secondAttribute="bottom" priority="100" id="VfU-Zk-8IU"/>
<constraint firstItem="rbx-Oj-jeo" firstAttribute="leading" secondItem="utd-Jy-pE5" secondAttribute="leading" constant="8" id="W0l-NG-7lt"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="top" secondItem="QKu-4A-UgP" secondAttribute="top" priority="100" id="X96-y7-5oI"/>
@ -229,16 +237,32 @@
<constraint firstAttribute="trailing" secondItem="jio-3T-E6G" secondAttribute="trailing" id="t9l-Ud-h6j"/>
<constraint firstAttribute="bottom" secondItem="aPn-pa-nCx" secondAttribute="bottom" id="tB3-eX-gUV"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="rbx-Oj-jeo" secondAttribute="bottom" constant="70" id="u9s-KY-yCt"/>
<constraint firstItem="QNg-zA-Jne" firstAttribute="top" secondItem="utd-Jy-pE5" secondAttribute="top" id="vCA-75-hd4"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="bottom" secondItem="xJx-UU-IdV" secondAttribute="bottom" id="veF-Rn-BEm"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="top" secondItem="65S-M4-TnM" secondAttribute="top" priority="100" id="vfQ-ZT-Dlc"/>
<constraint firstItem="utd-Jy-pE5" firstAttribute="trailing" secondItem="rL1-9E-4b7" secondAttribute="trailing" priority="100" id="xUq-Vo-ETR"/>
</constraints>
<viewLayoutGuide key="safeArea" id="utd-Jy-pE5"/>
<variation key="default">
<mask key="constraints">
<exclude reference="SDX-4J-Jz5"/>
<exclude reference="TZk-MH-pMV"/>
<exclude reference="u9s-KY-yCt"/>
<exclude reference="veF-Rn-BEm"/>
<exclude reference="W0l-NG-7lt"/>
</mask>
</variation>
<variation key="heightClass=compact">
<mask key="constraints">
<include reference="TZk-MH-pMV"/>
<include reference="veF-Rn-BEm"/>
</mask>
</variation>
<variation key="heightClass=regular">
<mask key="constraints">
<include reference="SDX-4J-Jz5"/>
</mask>
</variation>
<variation key="heightClass=compact-widthClass=compact">
<mask key="constraints">
<exclude reference="t9l-Ud-h6j"/>
@ -268,6 +292,7 @@
<outlet property="controlsView" destination="rL1-9E-4b7" id="sfV-7X-WlR"/>
<outlet property="guidesCollectionContainer" destination="at1-V1-pzl" id="zwo-PP-5N0"/>
<outlet property="guidesHiddenConstraint" destination="8JV-dP-iYZ" id="19x-c0-wYa"/>
<outlet property="guidesNavigationBarAreaBottom" destination="TGG-JD-3dN" id="n00-S5-6VI"/>
<outlet property="guidesVisibleConstraint" destination="O8L-nd-nOa" id="vhS-sT-o0o"/>
<outlet property="mapView" destination="aPn-pa-nCx" id="tCi-LW-1ll"/>
<outlet property="placePageAreaKeyboard" destination="PFs-sL-oVA" id="O3P-ia-ZlX"/>
@ -953,17 +978,17 @@
<objects>
<viewController storyboardIdentifier="MWMNoMapsViewController" id="3el-Zi-2E4" customClass="MWMNoMapsViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="4WP-vj-Alg">
<rect key="frame" x="0.0" y="0.0" width="414" height="762"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="1310"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gmw-e3-n53" userLabel="Container" customClass="MWMNoMapsView">
<rect key="frame" x="3.5" y="0.0" width="407" height="762"/>
<rect key="frame" x="308.5" y="0.0" width="407" height="1310"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dCZ-PN-2Ob" userLabel="BoundsView">
<rect key="frame" x="16" y="0.0" width="375" height="658"/>
<rect key="frame" x="16" y="0.0" width="375" height="1206"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="87G-jh-N8H" userLabel="CenteredView">
<rect key="frame" x="0.0" y="204.5" width="375" height="249"/>
<rect key="frame" x="0.0" y="478.5" width="375" height="249"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalCompressionResistancePriority="749" image="img_no_maps" translatesAutoresizingMaskIntoConstraints="NO" id="vI9-fc-FO2">
<rect key="frame" x="107.5" y="0.0" width="160" height="160"/>
@ -1024,7 +1049,7 @@
</constraints>
</view>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Moj-UK-oyl" userLabel="DownloadMaps" customClass="MWMButton">
<rect key="frame" x="83.5" y="678" width="240" height="44"/>
<rect key="frame" x="83.5" y="1226" width="240" height="44"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="240" id="49x-bx-JJj"/>