forked from organicmaps/organicmaps
[iOS] Added back button to bookmarks from map
https://jira.mail.ru/browse/MAPSME-13249
This commit is contained in:
parent
a8d79afbe0
commit
b0cf9c86c0
28 changed files with 374 additions and 18 deletions
62
iphone/Maps/Bookmarks/BookmarksCoordinator.swift
Normal file
62
iphone/Maps/Bookmarks/BookmarksCoordinator.swift
Normal file
|
@ -0,0 +1,62 @@
|
|||
import UIKit
|
||||
|
||||
@objc class BookmarksCoordinator: NSObject {
|
||||
@objc enum BookmarksState: Int {
|
||||
case opened
|
||||
case closed
|
||||
case hidden
|
||||
}
|
||||
|
||||
private weak var navigationController: UINavigationController?
|
||||
private weak var controlsManager: MWMMapViewControlsManager?
|
||||
private var bookmarksControllers: [UIViewController]?
|
||||
@objc var state: BookmarksState = .closed {
|
||||
didSet {
|
||||
updateForState(newState: state)
|
||||
}
|
||||
}
|
||||
|
||||
@objc init(navigationController: UINavigationController,
|
||||
controlsManager: MWMMapViewControlsManager) {
|
||||
self.navigationController = navigationController
|
||||
self.controlsManager = controlsManager
|
||||
}
|
||||
|
||||
private func updateForState(newState: BookmarksState) {
|
||||
guard let navigationController = navigationController else {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
switch state {
|
||||
case .opened:
|
||||
guard let bookmarksControllers = bookmarksControllers else {
|
||||
navigationController.pushViewController(BookmarksTabViewController(coordinator: self),
|
||||
animated: true)
|
||||
return
|
||||
}
|
||||
var controllers = navigationController.viewControllers
|
||||
controllers.append(contentsOf: bookmarksControllers)
|
||||
UIView.transition(with: self.navigationController!.view,
|
||||
duration: kDefaultAnimationDuration,
|
||||
options: [.curveEaseInOut, .transitionCrossDissolve],
|
||||
animations: {
|
||||
navigationController.setViewControllers(controllers, animated: false)
|
||||
}, completion: nil)
|
||||
FrameworkHelper.deactivateMapSelection(notifyUI: true)
|
||||
self.bookmarksControllers = nil
|
||||
controlsManager?.bookmarksBackButtonHidden = true
|
||||
case .closed:
|
||||
navigationController.popToRootViewController(animated: true)
|
||||
bookmarksControllers = nil
|
||||
controlsManager?.bookmarksBackButtonHidden = true
|
||||
case .hidden:
|
||||
UIView.transition(with: self.navigationController!.view,
|
||||
duration: kDefaultAnimationDuration,
|
||||
options: [.curveEaseInOut, .transitionCrossDissolve],
|
||||
animations: {
|
||||
self.bookmarksControllers = navigationController.popToRootViewController(animated: false)
|
||||
}, completion: nil)
|
||||
controlsManager?.bookmarksBackButtonHidden = false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,11 +14,22 @@ final class BookmarksTabViewController: TabViewController {
|
|||
}
|
||||
}
|
||||
|
||||
private weak var coordinator: BookmarksCoordinator?
|
||||
|
||||
init(coordinator: BookmarksCoordinator?) {
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
self.coordinator = coordinator
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
let bookmarks = BMCViewController()
|
||||
let catalog = DownloadedBookmarksViewController()
|
||||
let bookmarks = BMCViewController(coordinator: coordinator)
|
||||
let catalog = DownloadedBookmarksViewController(coordinator: coordinator)
|
||||
bookmarks.title = L("bookmarks")
|
||||
catalog.title = L("guides")
|
||||
viewControllers = [bookmarks, catalog]
|
||||
|
|
|
@ -3,12 +3,19 @@
|
|||
|
||||
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;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#import "MWMLocationObserver.h"
|
||||
#import "MWMSearchNoResults.h"
|
||||
#import "TracksSection.h"
|
||||
#import "MapViewController.h"
|
||||
|
||||
#import <CoreApi/CoreApi.h>
|
||||
|
||||
|
@ -67,7 +68,6 @@ using namespace std;
|
|||
@property(weak, nonatomic) IBOutlet UIBarButtonItem *sortDownloadedSpinnerItem;
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UIBarButtonItem * moreItem;
|
||||
|
||||
@end
|
||||
|
||||
@implementation BookmarksVC
|
||||
|
@ -377,8 +377,8 @@ using namespace std;
|
|||
}
|
||||
|
||||
- (void)viewOnMap {
|
||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||
GetFramework().ShowBookmarkCategory(self.categoryId);
|
||||
[self.delegate bookmarksVCdidViewOnMap:self type:BookmarksVCSelectedTypeNone];
|
||||
}
|
||||
|
||||
- (IBAction)onSort:(UIBarButtonItem *)sender {
|
||||
|
@ -689,11 +689,19 @@ using namespace std;
|
|||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
// Remove cell selection
|
||||
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
[[self currentSections][indexPath.section] didSelectRow:indexPath.row];
|
||||
id<TableSectionDataSource> currentSection = [self currentSections][indexPath.section];
|
||||
[currentSection didSelectRow:indexPath.row];
|
||||
if (self.searchSections != nil)
|
||||
[Statistics logEvent:kStatBookmarksSearchResultSelected withParameters:@{kStatFrom : kStatBookmarksList}];
|
||||
[self.searchBar resignFirstResponder];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
|
||||
BookmarksVCSelectedType selectedType = BookmarksVCSelectedTypeNone;
|
||||
if ([currentSection isKindOfClass:[BookmarksSection class]]) {
|
||||
selectedType = BookmarksVCSelectedTypeBookmark;
|
||||
} else if ([currentSection isKindOfClass:[TracksSection class]]) {
|
||||
selectedType = BookmarksVCSelectedTypeTrack;
|
||||
}
|
||||
[self.delegate bookmarksVCdidViewOnMap:self type:selectedType];
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
|
|
@ -22,6 +22,16 @@ class DownloadedBookmarksViewController: MWMViewController {
|
|||
}
|
||||
|
||||
let dataSource = DownloadedBookmarksDataSource()
|
||||
private weak var coordinator: BookmarksCoordinator?
|
||||
|
||||
init(coordinator: BookmarksCoordinator?) {
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
self.coordinator = coordinator
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
@ -90,6 +100,13 @@ class DownloadedBookmarksViewController: MWMViewController {
|
|||
tableView.reloadData()
|
||||
}
|
||||
}
|
||||
|
||||
private func openCategory(category: BookmarkGroup) {
|
||||
let bmViewController = BookmarksVC(category: category.categoryId)
|
||||
bmViewController.delegate = self
|
||||
MapViewController.topViewController().navigationController?.pushViewController(bmViewController,
|
||||
animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
extension DownloadedBookmarksViewController: UITableViewDataSource {
|
||||
|
@ -127,9 +144,7 @@ extension DownloadedBookmarksViewController: UITableViewDelegate {
|
|||
}
|
||||
|
||||
let category = dataSource.category(at: indexPath.row)
|
||||
let bmViewController = BookmarksVC(category: category.categoryId)
|
||||
MapViewController.topViewController().navigationController?.pushViewController(bmViewController,
|
||||
animated: true)
|
||||
openCategory(category: category)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,3 +189,18 @@ extension DownloadedBookmarksViewController: BMCCategoriesHeaderDelegate {
|
|||
tableView.reloadData()
|
||||
}
|
||||
}
|
||||
|
||||
extension DownloadedBookmarksViewController: BookmarksVCDelegate {
|
||||
func bookmarksVCdidUpdateCategory(_ viewController: BookmarksVC) { }
|
||||
|
||||
func bookmarksVCdidDeleteCategory(_ viewController: BookmarksVC) { }
|
||||
|
||||
func bookmarksVCdidView(onMap viewController: BookmarksVC, type: BookmarksVCSelectedType) {
|
||||
switch type {
|
||||
case .bookmark:
|
||||
coordinator?.state = .hidden
|
||||
default:
|
||||
coordinator?.state = .closed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ final class BMCViewController: MWMViewController {
|
|||
}
|
||||
}
|
||||
|
||||
private weak var coordinator: BookmarksCoordinator?
|
||||
|
||||
@IBOutlet private weak var tableView: UITableView! {
|
||||
didSet {
|
||||
let cells = [
|
||||
|
@ -29,6 +31,15 @@ final class BMCViewController: MWMViewController {
|
|||
@IBOutlet private var actionsHeader: UIView!
|
||||
@IBOutlet private var notificationsHeader: BMCNotificationsHeader!
|
||||
|
||||
init(coordinator: BookmarksCoordinator?) {
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
self.coordinator = coordinator
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
viewModel = BMCDefaultViewModel()
|
||||
|
@ -380,4 +391,13 @@ extension BMCViewController: BookmarksVCDelegate {
|
|||
guard let parentVC = parent else { return }
|
||||
navigationController?.popToViewController(parentVC, animated: true)
|
||||
}
|
||||
|
||||
func bookmarksVCdidView(onMap viewController: BookmarksVC, type: BookmarksVCSelectedType) {
|
||||
switch type {
|
||||
case .bookmark:
|
||||
coordinator?.state = .hidden
|
||||
default:
|
||||
coordinator?.state = .closed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,3 +92,4 @@
|
|||
#import "UIImageView+WebImage.h"
|
||||
#import "UIViewController+Navigation.h"
|
||||
#import "WebViewController.h"
|
||||
#import "MWMMapViewControlsCommon.h"
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
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()
|
||||
|
||||
@objc var hidden: Bool = true {
|
||||
didSet {
|
||||
refreshLayout()
|
||||
}
|
||||
}
|
||||
|
||||
static var controller: BookmarksBackButtonViewController = {
|
||||
guard let bookmarksBackButton = MWMMapViewControlsManager.manager()?.bookmarksBackButton else {
|
||||
fatalError()
|
||||
}
|
||||
return bookmarksBackButton
|
||||
}()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
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
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
<?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="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>
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
@class MapViewController;
|
||||
@class BottomTabBarViewController;
|
||||
@class BookmarksBackButtonViewController;
|
||||
@protocol MWMFeatureHolder;
|
||||
|
||||
@interface MWMMapViewControlsManager : NSObject
|
||||
|
@ -15,10 +16,12 @@
|
|||
@property(nonatomic) BOOL zoomHidden;
|
||||
@property(nonatomic) BOOL sideButtonsHidden;
|
||||
@property(nonatomic) BOOL trafficButtonHidden;
|
||||
@property(nonatomic) BOOL bookmarksBackButtonHidden;
|
||||
@property(nonatomic) MWMBottomMenuState menuState;
|
||||
@property(nonatomic) MWMBottomMenuState menuRestoreState;
|
||||
@property(nonatomic) BOOL isDirectionViewHidden;
|
||||
@property(nonatomic) BottomTabBarViewController *tabBarController;
|
||||
@property(nonatomic) BookmarksBackButtonViewController *bookmarksBackButton;
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("init is not available")));
|
||||
- (instancetype)initWithParentController:(MapViewController *)controller;
|
||||
|
|
|
@ -63,6 +63,7 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
|
|||
self.sideButtonsHidden = NO;
|
||||
self.trafficButtonHidden = NO;
|
||||
self.isDirectionViewHidden = YES;
|
||||
self.bookmarksBackButtonHidden = YES;
|
||||
self.menuRestoreState = MWMBottomMenuStateInactive;
|
||||
self.promoDiscoveryCampaign = [PromoCampaignManager manager].promoDiscoveryCampaign;
|
||||
if (_promoDiscoveryCampaign.enabled) {
|
||||
|
@ -103,6 +104,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.searchManager viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
|
||||
}
|
||||
|
||||
|
@ -275,6 +277,16 @@ 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];
|
||||
|
@ -322,6 +334,16 @@ 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)setMenuState:(MWMBottomMenuState)menuState {
|
||||
_menuState = menuState;
|
||||
switch (_menuState) {
|
||||
|
|
|
@ -85,6 +85,7 @@ NSArray<UIImage *> *imagesWithName(NSString *name) {
|
|||
[self.view.superview animateConstraintsWithAnimations:^{
|
||||
self.topOffset.constant = availableArea.origin.y + kTopOffset;
|
||||
self.leftOffset.constant = leftOffset;
|
||||
self.view.alpha = self.hidden ? 0 : 1;
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ BOOL defaultOrientation(CGSize const & size)
|
|||
withParameters:@{
|
||||
kStatMode: (isOnRoute ? kStatRoutingModeOnRoute : kStatRoutingModePlanning)
|
||||
}];
|
||||
[[MapViewController sharedController] openBookmarks];
|
||||
[MapViewController sharedController].bookmarksCoordinator.state = BookmarksStateOpened;
|
||||
}
|
||||
|
||||
- (void)collapseSearchOnTimer
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
@class MWMMapViewControlsManager;
|
||||
@class EAGLView;
|
||||
@class MWMMapDownloadDialog;
|
||||
@class BookmarksCoordinator;
|
||||
@protocol MWMLocationModeListener;
|
||||
|
||||
@interface MapViewController : MWMViewController
|
||||
|
@ -24,7 +25,6 @@
|
|||
|
||||
- (void)performAction:(NSString *)action;
|
||||
|
||||
- (void)openBookmarks;
|
||||
- (void)openMapsDownloader:(MWMMapDownloaderMode)mode;
|
||||
- (void)openEditor;
|
||||
- (void)openBookmarkEditor;
|
||||
|
@ -51,7 +51,7 @@
|
|||
@property(nonatomic, readonly) MWMMapViewControlsManager * controlsManager;
|
||||
@property(nonatomic) MWMWelcomePageController * welcomePageController;
|
||||
@property(nonatomic, readonly) MWMMapDownloadDialog * downloadDialog;
|
||||
|
||||
@property(nonatomic, readonly) BookmarksCoordinator * bookmarksCoordinator;
|
||||
|
||||
@property(nonatomic) MWMMyPositionMode currentPositionMode;
|
||||
@property(strong, nonatomic) IBOutlet EAGLView * _Nonnull mapView;
|
||||
|
|
|
@ -94,6 +94,7 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
|
|||
@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<id<MWMLocationModeListener>> *listeners;
|
||||
|
||||
|
@ -223,6 +224,10 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
|
|||
}
|
||||
}
|
||||
|
||||
BOOL const isBookmarksViewHidden = self.bookmarksCoordinator.state == BookmarksStateHidden;
|
||||
if (isBookmarksViewHidden)
|
||||
self.bookmarksCoordinator.state = BookmarksStateClosed;
|
||||
|
||||
if (!switchFullScreenMode)
|
||||
return;
|
||||
|
||||
|
@ -550,10 +555,6 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
|
|||
|
||||
#pragma mark - Open controllers
|
||||
|
||||
- (void)openBookmarks {
|
||||
[self.navigationController pushViewController:[[MWMBookmarksTabViewController alloc] init] animated:YES];
|
||||
}
|
||||
|
||||
- (void)openMapsDownloader:(MWMMapDownloaderMode)mode {
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"downloader"];
|
||||
[self performSegueWithIdentifier:kDownloaderSegue sender:@(mode)];
|
||||
|
@ -796,7 +797,7 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
|
|||
auto searchState = MWMSearchManagerStateHidden;
|
||||
[MWMRouter stopRouting];
|
||||
if ([action isEqualToString:@"me.maps.3daction.bookmarks"])
|
||||
[self openBookmarks];
|
||||
self.bookmarksCoordinator.state = BookmarksStateOpened;
|
||||
else if ([action isEqualToString:@"me.maps.3daction.search"])
|
||||
searchState = MWMSearchManagerStateDefault;
|
||||
else if ([action isEqualToString:@"me.maps.3daction.route"])
|
||||
|
@ -892,6 +893,13 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
|
|||
f.SetViewportCenter(center, zoomLevel, false);
|
||||
}
|
||||
|
||||
- (BookmarksCoordinator *)bookmarksCoordinator {
|
||||
if (!_bookmarksCoordinator)
|
||||
_bookmarksCoordinator = [[BookmarksCoordinator alloc] initWithNavigationController:self.navigationController
|
||||
controlsManager:self.controlsManager];
|
||||
return _bookmarksCoordinator;
|
||||
}
|
||||
|
||||
#pragma mark - CarPlay map append/remove
|
||||
|
||||
- (void)disableCarPlayRepresentation {
|
||||
|
|
|
@ -93,6 +93,10 @@ class MapStyleSheet: IStyleSheet {
|
|||
s.mwmImage = "promo_discovery_button"
|
||||
}
|
||||
|
||||
theme.add(styleName: "ButtonBookmarksBack") { (s) -> (Void) in
|
||||
s.mwmImage = "btn_back"
|
||||
}
|
||||
|
||||
theme.add(styleName: "FirstTurnView") { (s) -> (Void) in
|
||||
s.backgroundColor = colors.linkBlue
|
||||
s.cornerRadius = 4
|
||||
|
|
6
iphone/Maps/Images.xcassets/Layers/Back/Contents.json
Normal file
6
iphone/Maps/Images.xcassets/Layers/Back/Contents.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
12
iphone/Maps/Images.xcassets/Layers/Back/btn_back_dark.imageset/Contents.json
vendored
Normal file
12
iphone/Maps/Images.xcassets/Layers/Back/btn_back_dark.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "btn_back_dark.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
BIN
iphone/Maps/Images.xcassets/Layers/Back/btn_back_dark.imageset/btn_back_dark.pdf
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Layers/Back/btn_back_dark.imageset/btn_back_dark.pdf
vendored
Normal file
Binary file not shown.
12
iphone/Maps/Images.xcassets/Layers/Back/btn_back_highlighted_dark.imageset/Contents.json
vendored
Normal file
12
iphone/Maps/Images.xcassets/Layers/Back/btn_back_highlighted_dark.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "btn_back_highlighted_dark.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
Binary file not shown.
12
iphone/Maps/Images.xcassets/Layers/Back/btn_back_highlighted_light.imageset/Contents.json
vendored
Normal file
12
iphone/Maps/Images.xcassets/Layers/Back/btn_back_highlighted_light.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "btn_back_highlighted_light.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
Binary file not shown.
12
iphone/Maps/Images.xcassets/Layers/Back/btn_back_light.imageset/Contents.json
vendored
Normal file
12
iphone/Maps/Images.xcassets/Layers/Back/btn_back_light.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "btn_back_light.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
BIN
iphone/Maps/Images.xcassets/Layers/Back/btn_back_light.imageset/btn_back_light.pdf
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Layers/Back/btn_back_light.imageset/btn_back_light.pdf
vendored
Normal file
Binary file not shown.
|
@ -606,6 +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 */; };
|
||||
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 */; };
|
||||
|
@ -637,6 +639,7 @@
|
|||
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 */; };
|
||||
|
@ -1704,6 +1707,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>"; };
|
||||
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>"; };
|
||||
|
@ -1738,6 +1743,7 @@
|
|||
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>"; };
|
||||
|
@ -3288,6 +3294,7 @@
|
|||
34BC72091B0DECAE0012A34B /* MapViewControls */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
993ECBB024E40C6700EA5DEF /* BookmarksBackButton */,
|
||||
99B6A74A2362F579002C94CB /* PromoButton */,
|
||||
340537621BBED98600D452C6 /* MWMMapViewControlsCommon.h */,
|
||||
34BC72101B0DECAE0012A34B /* MWMMapViewControlsManager.h */,
|
||||
|
@ -3771,6 +3778,15 @@
|
|||
path = Core;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
993ECBB024E40C6700EA5DEF /* BookmarksBackButton */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
993ECBB124E40CEC00EA5DEF /* BookmarksBackButtonViewController.swift */,
|
||||
993ECBB224E40CEC00EA5DEF /* BookmarksBackButtonViewController.xib */,
|
||||
);
|
||||
path = BookmarksBackButton;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
993F54F6237C622700545511 /* DeepLink */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -4990,6 +5006,7 @@
|
|||
BB87BF8922FAF1CA008A8A72 /* TracksSection.mm */,
|
||||
BB87BF8B22FAF3B8008A8A72 /* InfoSection.h */,
|
||||
BB87BF8C22FAF435008A8A72 /* InfoSection.mm */,
|
||||
996D108924E3DBF2002DD0E2 /* BookmarksCoordinator.swift */,
|
||||
);
|
||||
path = Bookmarks;
|
||||
sourceTree = "<group>";
|
||||
|
@ -5267,6 +5284,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 */,
|
||||
47E6CB0C2178BA3600EA102B /* SearchBannerCell.xib in Resources */,
|
||||
6741A9761BF340DE002C974C /* packed_polygons.bin in Resources */,
|
||||
470A8A012136097000D72FBF /* SubwayTutorialBlur.xib in Resources */,
|
||||
|
@ -5585,6 +5603,7 @@
|
|||
F6E2FEDF1E097BA00083EBEC /* MWMSearchManager+Layout.m in Sources */,
|
||||
F64D9CA01C899C350063FA30 /* MWMEditorViralAlert.mm in Sources */,
|
||||
34AC8FD11EFC02C000E7F910 /* MWMRoutePoint.mm in Sources */,
|
||||
993ECBB324E40CEC00EA5DEF /* BookmarksBackButtonViewController.swift in Sources */,
|
||||
CDB4D5012231412900104869 /* ListTemplateBuilder.swift in Sources */,
|
||||
99A906F323FA95AB0005872B /* PlacePageStyleSheet.swift in Sources */,
|
||||
6741A9CF1BF340DE002C974C /* MWMLocationAlert.m in Sources */,
|
||||
|
@ -5798,6 +5817,7 @@
|
|||
344532381F6FFE6A0059FBCC /* UGCRating.swift in Sources */,
|
||||
47A6F3C5235F47B90053FBA4 /* BookmarksSubscriptionButton.swift in Sources */,
|
||||
34AB66411FC5AA330078E451 /* RouteManagerTransitioningManager.swift in Sources */,
|
||||
996D108A24E3DBF2002DD0E2 /* BookmarksCoordinator.swift in Sources */,
|
||||
3454D7CE1E07F045004AF2AD /* UIFont+MapsMeFonts.m in Sources */,
|
||||
99A906E123F6F7030005872B /* PlacePageButtonsViewController.swift in Sources */,
|
||||
CD4A1F1A230EADC100F2A6B6 /* CatalogConnectionErrorView.swift in Sources */,
|
||||
|
|
|
@ -11,6 +11,7 @@ final class TrafficButtonArea: AvailableArea {
|
|||
|
||||
override func notifyObserver() {
|
||||
MWMTrafficButtonViewController.updateAvailableArea(areaFrame)
|
||||
BookmarksBackButtonViewController.updateAvailableArea(areaFrame)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ extension BottomTabBarInteractor: BottomTabBarInteractorProtocol {
|
|||
}
|
||||
|
||||
func openBookmarks() {
|
||||
MapViewController.shared()?.openBookmarks()
|
||||
mapViewController?.bookmarksCoordinator.state = .opened
|
||||
}
|
||||
|
||||
func openMenu() {
|
||||
|
|
Loading…
Add table
Reference in a new issue