Added dialog for more than one country

This commit is contained in:
VladiMihaylenko 2015-03-10 17:30:34 +03:00 committed by Alex Zolotarev
parent 3f5af422f9
commit b5f8a4bd1a
11 changed files with 293 additions and 87 deletions

View file

@ -9,7 +9,8 @@
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, MWMAlertType) {
MWMAlertTypeDownloadAllMaps
MWMAlertTypeDownloadAllMaps,
MWMAlertTypeDownloadTransitMap
};
@class MWMAlertViewController;

View file

@ -7,6 +7,7 @@
//
#import "MWMAlert.h"
#import "MWMDownloadTransitMapAlert.h"
#import "MWMDownloadAllMapsAlert.h"
@class MWMAlertEntity;
@ -15,6 +16,9 @@
+ (MWMAlert *)alertWithType:(MWMAlertType)type {
switch (type) {
case MWMAlertTypeDownloadTransitMap: {
return [MWMDownloadTransitMapAlert alert];
}
case MWMAlertTypeDownloadAllMaps: {
return [MWMDownloadAllMapsAlert alert];
}
@ -22,7 +26,7 @@
}
- (void)configureWithEntity:(MWMAlertEntity *)entity {
[self doesNotRecognizeSelector:_cmd];
// [self doesNotRecognizeSelector:_cmd];
}
@end

View file

@ -7,7 +7,7 @@
//
#import "MWMAlertViewController.h"
#import "MWMDownloadAllMapsAlert.h"
#import "MWMDownloadTransitMapAlert.h"
#import "MWMAlertEntity.h"
#import "MWMAlertViewControllerDelegate.h"

View file

@ -1,16 +1,13 @@
//
// MWMGetTransitionMapAlert.h
// MWMDownloadAllMapsAlert.h
// Maps
//
// Created by v.mikhaylenko on 05.03.15.
// Created by v.mikhaylenko on 10.03.15.
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "MWMAlert.h"
@class MWMAlertEntity;
@interface MWMDownloadAllMapsAlert : MWMAlert
+ (instancetype)alert;
- (void)configureWithEntity:(MWMAlertEntity *)entity;
@end

View file

@ -0,0 +1,54 @@
//
// MWMDownloadAllMapsAlert.m
// Maps
//
// Created by v.mikhaylenko on 10.03.15.
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "MWMDownloadAllMapsAlert.h"
#import "MWMAlertViewController.h"
#import "CountryTreeVC.h"
@interface MWMDownloadAllMapsAlert ()
@property (nonatomic, weak) IBOutlet UIView *specsView;
@property (nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (nonatomic, weak) IBOutlet UILabel *messageLabel;
@property (nonatomic, weak) IBOutlet UIButton *notNowButton;
@property (nonatomic, weak) IBOutlet UIButton *downloadButton;
@property (nonatomic, weak) IBOutlet UILabel *downloadMapsLabel;
@end
static NSString * const kDownloadAllMapsAlertNibName = @"MWMDownloadAllMapsAlert";
@implementation MWMDownloadAllMapsAlert
+ (instancetype)alert {
MWMDownloadAllMapsAlert *alert = [[[NSBundle mainBundle] loadNibNamed:kDownloadAllMapsAlertNibName owner:self options:nil] firstObject];
return alert;
}
- (IBAction)notNowButtonTap:(id)sender {
[self.alertController close];
}
- (IBAction)downloadMapsButtonTap:(id)sender {
[UIView animateWithDuration:0.2f animations:^{
self.specsView.backgroundColor = [UIColor colorWithRed:211/255. green:209/255. blue:205/255. alpha:1.];
} completion:^(BOOL finished) {
[self.alertController close];
CountryTreeVC *viewController = [[CountryTreeVC alloc] initWithNodePosition:-1];
[self.alertController.ownerViewController.navigationController pushViewController:viewController animated:YES];
}];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end

View file

@ -7,75 +7,63 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clipsSubviews="YES" contentMode="scaleToFill" id="jqI-GQ-yDh" customClass="MWMDownloadAllMapsAlert">
<rect key="frame" x="0.0" y="-3" width="280" height="263"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<view clipsSubviews="YES" contentMode="scaleToFill" id="iN0-l3-epB" customClass="MWMDownloadAllMapsAlert">
<rect key="frame" x="0.0" y="0.0" width="280" height="243"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Download all maps along your route" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="MvX-7q-CIH">
<rect key="frame" x="23" y="20" width="232" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Get transit maps" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Pcv-OL-Jdp">
<rect key="frame" x="23" y="20" width="232" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.82000000000000006" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.81999999999999995" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<size key="shadowOffset" width="0.0" height="0.0"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="q87-qQ-0rn">
<rect key="frame" x="140" y="211" width="140" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="15"/>
<state key="normal" title="DOWNLOAD">
<color key="titleColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="downloadButtonTap:" destination="jqI-GQ-yDh" eventType="touchUpInside" id="L2t-kQ-AzL"/>
</connections>
</button>
<view contentMode="scaleToFill" id="qWl-uG-l5d">
<rect key="frame" x="-2" y="150" width="284" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Creating routes between regions is only possible when all the transit maps are downloaded and updated." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="e9b-ae-kho">
<rect key="frame" x="23" y="54" width="234" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.81999999999999995" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" id="BTz-50-QHZ">
<rect key="frame" x="-2" y="126" width="284" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Champagne-Ardenne" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="R9w-d7-Fy4">
<rect key="frame" x="23" y="12" width="167" height="19"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Download maps" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="0a5-pt-lJD">
<rect key="frame" x="100" y="21" width="159" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.82000000000000006" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="France" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="rQS-yn-R5J">
<rect key="frame" x="23" y="33" width="232" height="15"/>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="eFe-Uk-Foc">
<rect key="frame" x="34" y="21" width="16" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.52000000000000002" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="132 MB" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="nFt-i2-6uJ">
<rect key="frame" x="198" y="11" width="55" height="21"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="qq0-AY-zm6">
<rect key="frame" x="0.0" y="0.0" width="284" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="13"/>
<color key="textColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<state key="normal">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="downloadMapsButtonTap:" destination="iN0-l3-epB" eventType="touchUpInside" id="4BO-Hf-EUE"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.97254901960784312" green="0.96862745098039216" blue="0.95686274509803915" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.97254901959999995" green="0.96862745100000003" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="layer.borderUIColor">
<color key="value" red="0.8784313725490196" green="0.8784313725490196" blue="0.8784313725490196" alpha="1" colorSpace="calibratedRGB"/>
<color key="value" red="0.87843137250000003" green="0.87843137250000003" blue="0.87843137250000003" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Creating routes between regions is only possible when all the transit maps are downloaded and updated." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Q3X-9G-3PT">
<rect key="frame" x="22" y="78" width="234" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.82000000000000006" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="dhS-fg-rNl">
<rect key="frame" x="-1" y="211" width="140" height="52"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Mxy-pG-5oc">
<rect key="frame" x="142" y="191" width="140" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="15"/>
<state key="normal" title="NOT NOW">
@ -83,11 +71,11 @@
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="notNowButtonTap:" destination="jqI-GQ-yDh" eventType="touchUpInside" id="Uwh-Pd-AVC"/>
<action selector="notNowButtonTap:" destination="iN0-l3-epB" eventType="touchUpInside" id="aSV-CD-2PF"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="layer.shadowOffset">
@ -104,16 +92,14 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="countryLabel" destination="rQS-yn-R5J" id="tV8-5q-FWp"/>
<outlet property="downloadButton" destination="q87-qQ-0rn" id="ua1-lE-qmX"/>
<outlet property="locationLabel" destination="R9w-d7-Fy4" id="Stv-ei-GdK"/>
<outlet property="messageLabel" destination="Q3X-9G-3PT" id="AUA-bn-mAy"/>
<outlet property="notNowButton" destination="dhS-fg-rNl" id="07j-d0-QOj"/>
<outlet property="sizeLabel" destination="nFt-i2-6uJ" id="lOV-l2-F8A"/>
<outlet property="specsView" destination="qWl-uG-l5d" id="T1w-Ll-0Q6"/>
<outlet property="titleLabel" destination="MvX-7q-CIH" id="hej-5l-48z"/>
<outlet property="downloadButton" destination="qq0-AY-zm6" id="VFS-uN-baX"/>
<outlet property="downloadMapsLabel" destination="0a5-pt-lJD" id="BRq-Gn-f93"/>
<outlet property="messageLabel" destination="e9b-ae-kho" id="4TS-hw-lG0"/>
<outlet property="notNowButton" destination="Mxy-pG-5oc" id="rPh-od-SvP"/>
<outlet property="specsView" destination="BTz-50-QHZ" id="UAw-2W-iu5"/>
<outlet property="titleLabel" destination="Pcv-OL-Jdp" id="L51-Oh-h8b"/>
</connections>
<point key="canvasLocation" x="295" y="401.5"/>
<point key="canvasLocation" x="343" y="270.5"/>
</view>
</objects>
<simulatedMetricsContainer key="defaultSimulatedMetrics">

View file

@ -0,0 +1,16 @@
//
// MWMGetTransitionMapAlert.h
// Maps
//
// Created by v.mikhaylenko on 05.03.15.
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "MWMAlert.h"
@class MWMAlertEntity;
@interface MWMDownloadTransitMapAlert : MWMAlert
+ (instancetype)alert;
- (void)configureWithEntity:(MWMAlertEntity *)entity;
@end

View file

@ -6,14 +6,14 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "MWMDownloadAllMapsAlert.h"
#import "MWMDownloadTransitMapAlert.h"
#import "MWMAlertViewController.h"
#import "MWMAlertEntity.h"
#import "UIKitCategories.h"
#import "MWMAlertViewControllerDelegate.h"
#import "ActiveMapsVC.h"
@interface MWMDownloadAllMapsAlert ()
@interface MWMDownloadTransitMapAlert ()
@property (nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (nonatomic, weak) IBOutlet UILabel *messageLabel;
@property (nonatomic, weak) IBOutlet UIButton *notNowButton;
@ -24,10 +24,12 @@
@property (nonatomic, weak) IBOutlet UIView *specsView;
@end
@implementation MWMDownloadAllMapsAlert
static NSString * kDownloadTransitMapAlertNibName = @"MWMDownloadTransitMapAlert";
@implementation MWMDownloadTransitMapAlert
+ (instancetype)alert {
MWMDownloadAllMapsAlert *alert = [[[NSBundle mainBundle] loadNibNamed:@"MWMDownloadAllMapsAlert" owner:self options:nil] firstObject];
MWMDownloadTransitMapAlert *alert = [[[NSBundle mainBundle] loadNibNamed:kDownloadTransitMapAlertNibName owner:self options:nil] firstObject];
return alert;
}

View file

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clipsSubviews="YES" contentMode="scaleToFill" id="jqI-GQ-yDh" customClass="MWMDownloadTransitMapAlert">
<rect key="frame" x="0.0" y="-3" width="280" height="263"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Download all maps along your route" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="MvX-7q-CIH">
<rect key="frame" x="23" y="20" width="232" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.82000000000000006" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<size key="shadowOffset" width="0.0" height="0.0"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="q87-qQ-0rn">
<rect key="frame" x="140" y="211" width="140" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="15"/>
<state key="normal" title="DOWNLOAD">
<color key="titleColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="downloadButtonTap:" destination="jqI-GQ-yDh" eventType="touchUpInside" id="L2t-kQ-AzL"/>
</connections>
</button>
<view contentMode="scaleToFill" id="qWl-uG-l5d">
<rect key="frame" x="-2" y="150" width="284" height="63"/>
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Champagne-Ardenne" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="R9w-d7-Fy4">
<rect key="frame" x="23" y="12" width="167" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.82000000000000006" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="France" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="rQS-yn-R5J">
<rect key="frame" x="23" y="33" width="232" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.52000000000000002" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="132 MB" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="nFt-i2-6uJ">
<rect key="frame" x="198" y="11" width="55" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="13"/>
<color key="textColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.97254901960784312" green="0.96862745098039216" blue="0.95686274509803915" alpha="1" colorSpace="calibratedRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="layer.borderUIColor">
<color key="value" red="0.8784313725490196" green="0.8784313725490196" blue="0.8784313725490196" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Creating routes between regions is only possible when all the transit maps are downloaded and updated." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Q3X-9G-3PT">
<rect key="frame" x="22" y="78" width="234" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.82000000000000006" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="dhS-fg-rNl">
<rect key="frame" x="-1" y="211" width="140" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="15"/>
<state key="normal" title="NOT NOW">
<color key="titleColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="notNowButtonTap:" destination="jqI-GQ-yDh" eventType="touchUpInside" id="Uwh-Pd-AVC"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="layer.shadowOffset">
<size key="value" width="0.0" height="3"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="layer.shadowUIColor">
<color key="value" white="0.0" alpha="0.22" colorSpace="calibratedWhite"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="layer.shadowRadius">
<integer key="value" value="6"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="4"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="countryLabel" destination="rQS-yn-R5J" id="tV8-5q-FWp"/>
<outlet property="downloadButton" destination="q87-qQ-0rn" id="ua1-lE-qmX"/>
<outlet property="locationLabel" destination="R9w-d7-Fy4" id="Stv-ei-GdK"/>
<outlet property="messageLabel" destination="Q3X-9G-3PT" id="AUA-bn-mAy"/>
<outlet property="notNowButton" destination="dhS-fg-rNl" id="07j-d0-QOj"/>
<outlet property="sizeLabel" destination="nFt-i2-6uJ" id="lOV-l2-F8A"/>
<outlet property="specsView" destination="qWl-uG-l5d" id="T1w-Ll-0Q6"/>
<outlet property="titleLabel" destination="MvX-7q-CIH" id="hej-5l-48z"/>
</connections>
<point key="canvasLocation" x="295" y="401.5"/>
</view>
</objects>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -806,9 +806,13 @@
- (void)showDownloaderDialogWithCountries:(vector<storage::TIndex> const &)countries {
MWMAlertViewController *alert = [[MWMAlertViewController alloc] initWithViewController:self];
self.downloaderManager = [[MWMAlertDownloaderManager alloc] initWithMapsIndexes:countries];
alert.delegate = self.downloaderManager;
[alert presentAlertWithType:MWMAlertTypeDownloadAllMaps];
if (countries.size()) {
self.downloaderManager = [[MWMAlertDownloaderManager alloc] initWithMapsIndexes:countries];
alert.delegate = self.downloaderManager;
[alert presentAlertWithType:MWMAlertTypeDownloadTransitMap];
} else {
[alert presentAlertWithType:MWMAlertTypeDownloadAllMaps];
}
}
#pragma mark - Getters

View file

@ -116,15 +116,17 @@
EED10A4511F78D120095FAD4 /* MapViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = EED10A4411F78D120095FAD4 /* MapViewController.mm */; };
EEFE7C1412F8C9E1006AF8C3 /* fonts_blacklist.txt in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C1212F8C9E1006AF8C3 /* fonts_blacklist.txt */; };
EEFE7C1512F8C9E1006AF8C3 /* fonts_whitelist.txt in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C1312F8C9E1006AF8C3 /* fonts_whitelist.txt */; };
F63CC8B11AAF0E600019338C /* MWMDownloadAllMapsAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = F63CC8B01AAF0E600019338C /* MWMDownloadAllMapsAlert.m */; };
F63CC8B31AAF0E8D0019338C /* MWMDownloadAllMapsAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = F63CC8B21AAF0E8D0019338C /* MWMDownloadAllMapsAlert.xib */; };
F6A85A151AA9AB23003667A2 /* MWMAlertEntity.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6A85A141AA9AB23003667A2 /* MWMAlertEntity.mm */; };
F6A85A201AAB1175003667A2 /* MWMAlertDownloaderManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6A85A1F1AAB1175003667A2 /* MWMAlertDownloaderManager.mm */; };
F6A85A241AAB44AD003667A2 /* MWMDownloaderController.m in Sources */ = {isa = PBXBuildFile; fileRef = F6A85A231AAB44AD003667A2 /* MWMDownloaderController.m */; };
F6A85A271AAB4559003667A2 /* MWMDownloaderViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6A85A261AAB4559003667A2 /* MWMDownloaderViewController.xib */; };
F6DBF9A01AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib */; };
F6DBF9A01AA75B6D00F2EC2C /* MWMDownloadTransitMapAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadTransitMapAlert.xib */; };
F6DBF9AC1AA847ED00F2EC2C /* MWMAlertViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9AA1AA847ED00F2EC2C /* MWMAlertViewController.mm */; };
F6DBF9AD1AA847ED00F2EC2C /* MWMAlertViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6DBF9AB1AA847ED00F2EC2C /* MWMAlertViewController.xib */; };
F6DBF9B01AA85E3500F2EC2C /* MWMAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9AF1AA85E3500F2EC2C /* MWMAlert.m */; };
F6DBF9B31AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm */; };
F6DBF9B31AA8611A00F2EC2C /* MWMDownloadTransitMapAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9B21AA8611A00F2EC2C /* MWMDownloadTransitMapAlert.mm */; };
F6DBF9B61AA8779300F2EC2C /* CALayer+RuntimeAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9B51AA8779300F2EC2C /* CALayer+RuntimeAttributes.m */; };
F785EB4016386FC4003A38A8 /* BookmarkCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F785EB3F16386FC4003A38A8 /* BookmarkCell.mm */; };
F7B90CD31521E6D200C054EE /* CustomNavigationView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F7B90CD21521E6D100C054EE /* CustomNavigationView.mm */; };
@ -375,6 +377,9 @@
EED10A4411F78D120095FAD4 /* MapViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MapViewController.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
EEFE7C1212F8C9E1006AF8C3 /* fonts_blacklist.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fonts_blacklist.txt; path = ../../data/fonts_blacklist.txt; sourceTree = "<group>"; };
EEFE7C1312F8C9E1006AF8C3 /* fonts_whitelist.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fonts_whitelist.txt; path = ../../data/fonts_whitelist.txt; sourceTree = "<group>"; };
F63CC8AF1AAF0E600019338C /* MWMDownloadAllMapsAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMDownloadAllMapsAlert.h; sourceTree = "<group>"; };
F63CC8B01AAF0E600019338C /* MWMDownloadAllMapsAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMDownloadAllMapsAlert.m; sourceTree = "<group>"; };
F63CC8B21AAF0E8D0019338C /* MWMDownloadAllMapsAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMDownloadAllMapsAlert.xib; sourceTree = "<group>"; };
F6A85A131AA9AB23003667A2 /* MWMAlertEntity.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = MWMAlertEntity.h; sourceTree = "<group>"; };
F6A85A141AA9AB23003667A2 /* MWMAlertEntity.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAlertEntity.mm; sourceTree = "<group>"; };
F6A85A1E1AAB1175003667A2 /* MWMAlertDownloaderManager.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = MWMAlertDownloaderManager.h; sourceTree = "<group>"; };
@ -383,14 +388,14 @@
F6A85A221AAB44AD003667A2 /* MWMDownloaderController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMDownloaderController.h; sourceTree = "<group>"; };
F6A85A231AAB44AD003667A2 /* MWMDownloaderController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMDownloaderController.m; sourceTree = "<group>"; };
F6A85A261AAB4559003667A2 /* MWMDownloaderViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMDownloaderViewController.xib; sourceTree = "<group>"; };
F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMDownloadAllMapsAlert.xib; sourceTree = "<group>"; };
F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadTransitMapAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMDownloadTransitMapAlert.xib; sourceTree = "<group>"; };
F6DBF9A91AA847ED00F2EC2C /* MWMAlertViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAlertViewController.h; sourceTree = "<group>"; };
F6DBF9AA1AA847ED00F2EC2C /* MWMAlertViewController.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MWMAlertViewController.mm; sourceTree = "<group>"; };
F6DBF9AB1AA847ED00F2EC2C /* MWMAlertViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMAlertViewController.xib; sourceTree = "<group>"; };
F6DBF9AE1AA85E3500F2EC2C /* MWMAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAlert.h; sourceTree = "<group>"; };
F6DBF9AF1AA85E3500F2EC2C /* MWMAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMAlert.m; sourceTree = "<group>"; };
F6DBF9B11AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMDownloadAllMapsAlert.h; sourceTree = "<group>"; };
F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MWMDownloadAllMapsAlert.mm; sourceTree = "<group>"; };
F6DBF9B11AA8611A00F2EC2C /* MWMDownloadTransitMapAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMDownloadTransitMapAlert.h; sourceTree = "<group>"; };
F6DBF9B21AA8611A00F2EC2C /* MWMDownloadTransitMapAlert.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MWMDownloadTransitMapAlert.mm; sourceTree = "<group>"; };
F6DBF9B41AA8779300F2EC2C /* CALayer+RuntimeAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+RuntimeAttributes.h"; sourceTree = "<group>"; };
F6DBF9B51AA8779300F2EC2C /* CALayer+RuntimeAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+RuntimeAttributes.m"; sourceTree = "<group>"; };
F785EB3E16386FC4003A38A8 /* BookmarkCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BookmarkCell.h; path = Bookmarks/BookmarkCell.h; sourceTree = SOURCE_ROOT; };
@ -832,16 +837,26 @@
path = Statistics;
sourceTree = "<group>";
};
F6A85A161AA9CAAD003667A2 /* DownloadAllMaps */ = {
F63CC8AE1AAF0E350019338C /* DownloadAllMaps */ = {
isa = PBXGroup;
children = (
F6DBF9B11AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.h */,
F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm */,
F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib */,
F63CC8AF1AAF0E600019338C /* MWMDownloadAllMapsAlert.h */,
F63CC8B01AAF0E600019338C /* MWMDownloadAllMapsAlert.m */,
F63CC8B21AAF0E8D0019338C /* MWMDownloadAllMapsAlert.xib */,
);
name = DownloadAllMaps;
sourceTree = "<group>";
};
F6A85A161AA9CAAD003667A2 /* DownloadTransitMap */ = {
isa = PBXGroup;
children = (
F6DBF9B11AA8611A00F2EC2C /* MWMDownloadTransitMapAlert.h */,
F6DBF9B21AA8611A00F2EC2C /* MWMDownloadTransitMapAlert.mm */,
F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadTransitMapAlert.xib */,
);
name = DownloadTransitMap;
sourceTree = "<group>";
};
F6A85A1D1AA9CCF7003667A2 /* Entity */ = {
isa = PBXGroup;
children = (
@ -870,7 +885,8 @@
F6DBF9AB1AA847ED00F2EC2C /* MWMAlertViewController.xib */,
F6DBF9AE1AA85E3500F2EC2C /* MWMAlert.h */,
F6DBF9AF1AA85E3500F2EC2C /* MWMAlert.m */,
F6A85A161AA9CAAD003667A2 /* DownloadAllMaps */,
F63CC8AE1AAF0E350019338C /* DownloadAllMaps */,
F6A85A161AA9CAAD003667A2 /* DownloadTransitMap */,
F6A85A1D1AA9CCF7003667A2 /* Entity */,
F6A85A1E1AAB1175003667A2 /* MWMAlertDownloaderManager.h */,
F6A85A1F1AAB1175003667A2 /* MWMAlertDownloaderManager.mm */,
@ -1134,11 +1150,12 @@
FAAFD697139D9BE2000AE70C /* categories.txt in Resources */,
FA64D9A913F975AD00350ECF /* types.txt in Resources */,
97FC99DC19C1A2CD00C1CF98 /* resources-mdpi in Resources */,
F63CC8B31AAF0E8D0019338C /* MWMDownloadAllMapsAlert.xib in Resources */,
97FC99DE19C1A2CD00C1CF98 /* resources-xhdpi in Resources */,
97D40C0A184D031900A1D572 /* Images.xcassets in Resources */,
B0DFE6311A1B78A200B6C35E /* LocalNotifications.plist in Resources */,
978D4A31199A11E600D72CA7 /* faq.html in Resources */,
F6DBF9A01AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib in Resources */,
F6DBF9A01AA75B6D00F2EC2C /* MWMDownloadTransitMapAlert.xib in Resources */,
97D40C08184CFA4100A1D572 /* ImagesPro.xcassets in Resources */,
97FC99E019C1A2CD00C1CF98 /* resources-xxhdpi in Resources */,
97719D4B1843B86700BDD815 /* Main_iPad.storyboard in Resources */,
@ -1284,9 +1301,10 @@
97508423199522D300A7457D /* SettingsAndMoreVC.mm in Sources */,
F6DBF9B01AA85E3500F2EC2C /* MWMAlert.m in Sources */,
9773DB8F198652E600C4A9E9 /* PlacePageBookmarkDescriptionCell.m in Sources */,
F63CC8B11AAF0E600019338C /* MWMDownloadAllMapsAlert.m in Sources */,
97ABBA4518C8DF620079333C /* PlacePageView.mm in Sources */,
97F61794183E7445009919E2 /* LinkCell.m in Sources */,
F6DBF9B31AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm in Sources */,
F6DBF9B31AA8611A00F2EC2C /* MWMDownloadTransitMapAlert.mm in Sources */,
976D86EC19C8697700C920EF /* ProgressView.m in Sources */,
97D092B1190A681F00FF645B /* PlacePageInfoCell.mm in Sources */,
B0FBFA271A515AFD0086819E /* ViewController.m in Sources */,