[ios] Auto updated maps after what's new.

This commit is contained in:
VladiMihaylenko 2017-04-17 11:14:50 +03:00 committed by Sergey Yershov
parent 44e50188dd
commit ff86f2c8c5
11 changed files with 488 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#import "MWMAuthorizationCommon.h"
#import "MWMAuthorizationLoginViewController.h"
#import "MWMAuthorizationWebViewLoginViewController.h"
#import "MWMAutoupdateController.h"
#import "MWMCommon.h"
#import "MWMEditBookmarkController.h"
#import "MWMEditorViewController.h"
@ -292,6 +293,23 @@ BOOL gIsFirstMyPositionMode = YES;
{
if ([pageController isEqual:self.welcomePageController])
self.welcomePageController = nil;
auto const todo = GetFramework().ToDoAfterUpdate();
switch (todo)
{
case Framework::DoAfterUpdate::Nothing:
break;
case Framework::DoAfterUpdate::Migrate:
[self openMigration];
break;
case Framework::DoAfterUpdate::AutoupdateMaps:
case Framework::DoAfterUpdate::AskForUpdateMaps:
[self presentViewController:[MWMAutoupdateController instanceWithPurpose:todo] animated:YES completion:nil];
break;
}
}
- (void)showViralAlertIfNeeded

View file

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "wn_autoupdate.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "wn_autoupdate@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "wn_autoupdate@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -931,6 +931,12 @@
F68FCB8B1DA7BD20007CC7D7 /* MWMTaxiPreviewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F68FCB881DA7BD20007CC7D7 /* MWMTaxiPreviewCell.mm */; };
F68FCB8C1DA7BD20007CC7D7 /* MWMTaxiPreviewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F68FCB891DA7BD20007CC7D7 /* MWMTaxiPreviewCell.xib */; };
F68FCB8D1DA7BD20007CC7D7 /* MWMTaxiPreviewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F68FCB891DA7BD20007CC7D7 /* MWMTaxiPreviewCell.xib */; };
F69018B81E9E601400B3C10B /* MWMAutoupdateController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F69018B71E9E601400B3C10B /* MWMAutoupdateController.mm */; };
F69018BC1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F69018BB1E9F7CB600B3C10B /* MWMAutoupdateController.xib */; };
F69018BD1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F69018BB1E9F7CB600B3C10B /* MWMAutoupdateController.xib */; };
F69018BE1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F69018BB1E9F7CB600B3C10B /* MWMAutoupdateController.xib */; };
F692F3831EA0FAF5001E82EB /* MWMAutoupdateController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F69018B71E9E601400B3C10B /* MWMAutoupdateController.mm */; };
F692F3841EA0FAF5001E82EB /* MWMAutoupdateController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F69018B71E9E601400B3C10B /* MWMAutoupdateController.mm */; };
F69CE8D51E5C49B4002B5881 /* PPHotelCarouselCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69CE8D41E5C49B4002B5881 /* PPHotelCarouselCell.swift */; };
F69CE8D61E5C49B4002B5881 /* PPHotelCarouselCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69CE8D41E5C49B4002B5881 /* PPHotelCarouselCell.swift */; };
F69CE8D71E5C49B4002B5881 /* PPHotelCarouselCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69CE8D41E5C49B4002B5881 /* PPHotelCarouselCell.swift */; };
@ -2037,6 +2043,9 @@
F68FCB871DA7BD20007CC7D7 /* MWMTaxiPreviewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMTaxiPreviewCell.h; sourceTree = "<group>"; };
F68FCB881DA7BD20007CC7D7 /* MWMTaxiPreviewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMTaxiPreviewCell.mm; sourceTree = "<group>"; };
F68FCB891DA7BD20007CC7D7 /* MWMTaxiPreviewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMTaxiPreviewCell.xib; sourceTree = "<group>"; };
F69018B61E9E601400B3C10B /* MWMAutoupdateController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAutoupdateController.h; sourceTree = "<group>"; };
F69018B71E9E601400B3C10B /* MWMAutoupdateController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAutoupdateController.mm; sourceTree = "<group>"; };
F69018BB1E9F7CB600B3C10B /* MWMAutoupdateController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMAutoupdateController.xib; sourceTree = "<group>"; };
F69CE8D41E5C49B4002B5881 /* PPHotelCarouselCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PPHotelCarouselCell.swift; sourceTree = "<group>"; };
F69CE8D81E5C5088002B5881 /* PPHotelCarouselCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PPHotelCarouselCell.xib; sourceTree = "<group>"; };
F69CE8DC1E5C51AB002B5881 /* CarouselElement.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CarouselElement.xib; sourceTree = "<group>"; };
@ -3538,6 +3547,16 @@
path = BookingCells;
sourceTree = "<group>";
};
F69018B51E9E5FEB00B3C10B /* Autoupdate */ = {
isa = PBXGroup;
children = (
F69018B61E9E601400B3C10B /* MWMAutoupdateController.h */,
F69018B71E9E601400B3C10B /* MWMAutoupdateController.mm */,
F69018BB1E9F7CB600B3C10B /* MWMAutoupdateController.xib */,
);
path = Autoupdate;
sourceTree = "<group>";
};
F6BBF2C31B4FFB56000CF8E2 /* LocationAlert */ = {
isa = PBXGroup;
children = (
@ -3573,6 +3592,7 @@
children = (
3432E17F1E49BEFA008477E9 /* Ads */,
34574A601E3B5B2A0061E839 /* Appearance */,
F69018B51E9E5FEB00B3C10B /* Autoupdate */,
349D1AC21E2E325B004A2006 /* BottomMenu */,
F6E2FBFC1E097B9F0083EBEC /* Downloader */,
F6E2FC291E097B9F0083EBEC /* EditBookmark */,
@ -4559,6 +4579,7 @@
F682249E1E5B105900BC1C18 /* PPHotelDescriptionCell.xib in Resources */,
340E1EF71E2F614400CE49BF /* Settings.storyboard in Resources */,
5605022F1B6211E100169CAD /* sound-strings in Resources */,
F69018BC1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */,
FAAEA7D1161BD26600CCD661 /* synonyms.txt in Resources */,
3476B8E01BFDD33A00874594 /* tts-how-to-set-up-voice-img in Resources */,
3476B8DC1BFDD30B00874594 /* tts-how-to-set-up-voice.html in Resources */,
@ -4728,6 +4749,7 @@
F682249F1E5B105900BC1C18 /* PPHotelDescriptionCell.xib in Resources */,
340E1EF81E2F614400CE49BF /* Settings.storyboard in Resources */,
6741A9421BF340DE002C974C /* sound-strings in Resources */,
F69018BD1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */,
6741A97D1BF340DE002C974C /* synonyms.txt in Resources */,
3476B8E11BFDD33A00874594 /* tts-how-to-set-up-voice-img in Resources */,
3476B8DD1BFDD30B00874594 /* tts-how-to-set-up-voice.html in Resources */,
@ -4897,6 +4919,7 @@
340E1EF61E2F614400CE49BF /* SearchFilters.storyboard in Resources */,
340E1EF91E2F614400CE49BF /* Settings.storyboard in Resources */,
849CF5EA1DE842290024A8A5 /* sound-strings in Resources */,
F69018BE1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */,
849CF64C1DE842290024A8A5 /* synonyms.txt in Resources */,
849CF6111DE842290024A8A5 /* tts-how-to-set-up-voice-img in Resources */,
849CF6281DE842290024A8A5 /* tts-how-to-set-up-voice.html in Resources */,
@ -5067,6 +5090,7 @@
3404754F1E081A4600C92850 /* fabric_logging_ios.mm in Sources */,
34ABA6281C2D567B00FE1BEC /* MWMInputLoginValidator.mm in Sources */,
34F4073D1E9E1AFF00E57AC0 /* MPNativeAd+MWM.mm in Sources */,
F69018B81E9E601400B3C10B /* MWMAutoupdateController.mm in Sources */,
560634F21B78806100F3D670 /* MWMTextToSpeech.mm in Sources */,
F6E2FECF1E097BA00083EBEC /* MWMSearchFilterViewController.mm in Sources */,
34D4FA661E265749003F53EF /* WhatsNewController.swift in Sources */,
@ -5443,6 +5467,7 @@
F6E2FE4F1E097BA00083EBEC /* MWMActionBarButton.mm in Sources */,
340475531E081A4600C92850 /* MWMCustomFacebookEvents.mm in Sources */,
349D1CE41E3F836900A878FD /* UIViewController+Hierarchy.swift in Sources */,
F692F3831EA0FAF5001E82EB /* MWMAutoupdateController.mm in Sources */,
34574A671E3B85F80061E839 /* ThemeManager.swift in Sources */,
34BF0CC71C31304A00D097EB /* MWMAuthorizationCommon.mm in Sources */,
F6E2FD771E097BA00083EBEC /* MWMMapDownloaderDataSource.mm in Sources */,
@ -5732,6 +5757,7 @@
F6E2FD721E097BA00083EBEC /* MWMMapDownloaderTableViewCell.mm in Sources */,
F6E2FE501E097BA00083EBEC /* MWMActionBarButton.mm in Sources */,
349D1CE51E3F836900A878FD /* UIViewController+Hierarchy.swift in Sources */,
F692F3841EA0FAF5001E82EB /* MWMAutoupdateController.mm in Sources */,
34574A681E3B85F80061E839 /* ThemeManager.swift in Sources */,
849CF6DC1DE842290024A8A5 /* MWMRoutePreview.mm in Sources */,
F6E2FD781E097BA00083EBEC /* MWMMapDownloaderDataSource.mm in Sources */,

View file

@ -0,0 +1,9 @@
#import "MWMViewController.h"
#include "Framework.h"
@interface MWMAutoupdateController : MWMViewController
+ (instancetype)instanceWithPurpose:(Framework::DoAfterUpdate)todo;
@end

View file

@ -0,0 +1,197 @@
#import "MWMAutoupdateController.h"
#import "MWMCircularProgress.h"
#import "MWMCommon.h"
#import "MWMFrameworkListener.h"
#import "MWMStorage.h"
#import "UIButton+RuntimeAttributes.h"
#include <vector>
namespace
{
string RootId() { return GetFramework().GetStorage().GetRootId(); }
} // namespace
@interface MWMAutoupdateView : UIView
@property(weak, nonatomic) IBOutlet UIImageView * image;
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * imageMinHeight;
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * imageHeight;
@property(weak, nonatomic) IBOutlet UILabel * title;
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * titleTopOffset;
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * titleImageOffset;
@property(weak, nonatomic) IBOutlet UILabel * text;
@property(weak, nonatomic) IBOutlet UIButton * primaryButton;
@property(weak, nonatomic) IBOutlet UIButton * secondaryButton;
@property(weak, nonatomic) IBOutlet UIView * spinnerView;
@property(weak, nonatomic) id<MWMCircularProgressProtocol> delegate;
@property(nonatomic) MWMCircularProgress * spinner;
@property(copy, nonatomic) NSString * updateSize;
- (void)startSpinner;
- (void)stopSpinner;
- (void)setProgress:(CGFloat)progress;
- (void)updateForSize:(CGSize)size;
@end
@implementation MWMAutoupdateView
- (void)setFrame:(CGRect)frame
{
[self updateForSize:frame.size];
super.frame = frame;
}
- (void)updateForSize:(CGSize)size
{
BOOL const hideImage = (self.imageHeight.multiplier * size.height <= self.imageMinHeight.constant);
self.titleImageOffset.priority = hideImage ? UILayoutPriorityDefaultLow : UILayoutPriorityDefaultHigh;
self.image.hidden = hideImage;
[self layoutIfNeeded];
}
- (void)stateDownloading
{
self.primaryButton.hidden = YES;
[self startSpinner];
self.secondaryButton.localizedText = L(@"cancel");
[MWMStorage updateNode:RootId()];
}
- (void)stateWaiting
{
[self stopSpinner];
self.primaryButton.hidden = NO;
self.secondaryButton.localizedText = L(@"whats_new_auto_update_button_later");
NSString * pattern = [L(@"whats_new_auto_update_button_size") stringByReplacingOccurrencesOfString:@"%s"
withString:@"%@"];
self.primaryButton.localizedText = [NSString stringWithFormat:pattern, self.updateSize];
[MWMStorage cancelDownloadNode:RootId()];
}
- (void)startSpinner
{
self.primaryButton.hidden = YES;
self.spinnerView.hidden = NO;
self.spinner = [MWMCircularProgress downloaderProgressForParentView:self.spinnerView];
self.spinner.delegate = self.delegate;
[self.spinner setInvertColor:YES];
self.spinner.state = MWMCircularProgressStateSpinner;
}
- (void)stopSpinner
{
self.primaryButton.hidden = NO;
self.spinnerView.hidden = YES;
self.spinner = nil;
}
- (void)setProgress:(CGFloat)progress
{
self.spinner.progress = progress;
}
@end
@interface MWMAutoupdateController () <MWMCircularProgressProtocol, MWMFrameworkStorageObserver>
@property(nonatomic) Framework::DoAfterUpdate todo;
@end
@implementation MWMAutoupdateController
+ (instancetype)instanceWithPurpose:(Framework::DoAfterUpdate)todo
{
MWMAutoupdateController * controller = [[MWMAutoupdateController alloc] initWithNibName:[self className]
bundle:[NSBundle mainBundle]];
controller.todo = todo;
auto view = static_cast<MWMAutoupdateView *>(controller.view);
view.delegate = controller;
auto & f = GetFramework();
auto const & s = f.GetStorage();
NodeAttrs attrs;
s.GetNodeAttrs(s.GetRootId(), attrs);
TMwmSize const countrySizeInBytes = attrs.m_localMwmSize;
view.updateSize = formattedSize(countrySizeInBytes);
[MWMFrameworkListener addObserver:controller];
return controller;
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
auto view = static_cast<MWMAutoupdateView *>(self.view);
if (self.todo == Framework::DoAfterUpdate::AutoupdateMaps)
[view stateDownloading];
else
[view stateWaiting];
}
- (void)dismiss
{
[static_cast<MWMAutoupdateView *>(self.view) stopSpinner];
[self dismissViewControllerAnimated:YES completion:^{
[MWMFrameworkListener removeObserver:self];
}];
}
- (IBAction)updateTap
{
[static_cast<MWMAutoupdateView *>(self.view) stateDownloading];
[MWMStorage updateNode:RootId()];
}
- (IBAction)cancelTap
{
[MWMStorage cancelDownloadNode:RootId()];
[self dismiss];
}
- (void)viewWillTransitionToSize:(CGSize)size
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
[static_cast<MWMAutoupdateView *>(self.view) updateForSize:size];
} completion:nil];
}
#pragma mark - MWMCircularProgressProtocol
- (void)progressButtonPressed:(MWMCircularProgress *)progress
{
[MWMStorage cancelDownloadNode:RootId()];
[static_cast<MWMAutoupdateView *>(self.view) stateWaiting];
}
#pragma mark - MWMFrameworkStorageObserver
- (void)processCountryEvent:(TCountryId const &)countryId
{
NodeStatuses nodeStatuses;
GetFramework().GetStorage().GetNodeStatuses(countryId, nodeStatuses);
if (nodeStatuses.m_status == NodeStatus::Error)
[static_cast<MWMAutoupdateView *>(self.view) stateWaiting];
}
- (void)processCountry:(TCountryId const &)countryId
progress:(MapFilesDownloader::TProgress const &)progress
{
auto const & s = GetFramework().GetStorage();
storage::TCountriesVec downloaded;
storage::TCountriesVec _;
NodeAttrs nodeAttrs;
s.GetNodeAttrs(RootId(), nodeAttrs);
auto const p = nodeAttrs.m_downloadingProgress;
static_cast<MWMAutoupdateView *>(self.view).progress = static_cast<CGFloat>(p.first) / p.second;
if (p.first == p.second)
[self dismiss];
}
@end

View file

@ -0,0 +1,206 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="HelveticaNeue.ttc">
<string>HelveticaNeue-Medium</string>
</array>
</customFonts>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MWMAutoupdateController">
<connections>
<outlet property="view" destination="4Q8-tQ-qqq" id="Efv-Uv-ihD"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="4Q8-tQ-qqq" customClass="MWMAutoupdateView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CrL-6X-EJl" userLabel="Container">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5Cw-y3-ipv" userLabel="BoundsView">
<rect key="frame" x="16" y="100" width="343" height="425"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vVR-Wh-jf5" userLabel="CenteredView">
<rect key="frame" x="0.0" y="86.5" width="343" height="253"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalCompressionResistancePriority="749" image="wn_autoupdate" translatesAutoresizingMaskIntoConstraints="NO" id="ym1-j4-Fn7">
<rect key="frame" x="91.5" y="0.0" width="160" height="160"/>
<constraints>
<constraint firstAttribute="height" relation="lessThanOrEqual" priority="800" constant="240" id="0ZT-MS-DwR"/>
<constraint firstAttribute="height" relation="lessThanOrEqual" priority="800" constant="160" id="lKy-F4-tpj"/>
<constraint firstAttribute="width" secondItem="ym1-j4-Fn7" secondAttribute="height" multiplier="1:1" id="yrH-8J-BCh"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Update your downloaded maps " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MdA-9O-3gH" userLabel="Title">
<rect key="frame" x="0.0" y="180" width="343" height="24"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="medium18"/>
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackPrimaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="whats_new_auto_update_title"/>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Updated maps supports information about objects in the current state" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WLZ-Z2-pj2" userLabel="Text">
<rect key="frame" x="0.0" y="220" width="343" height="33"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular14"/>
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackSecondaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="whats_new_auto_update_message"/>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<accessibility key="accessibilityConfiguration" identifier="CenteredView"/>
<constraints>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="400" id="3h0-Vi-2o8"/>
<constraint firstItem="WLZ-Z2-pj2" firstAttribute="top" secondItem="MdA-9O-3gH" secondAttribute="bottom" constant="16" id="7GI-WD-Pbc"/>
<constraint firstItem="MdA-9O-3gH" firstAttribute="centerX" secondItem="vVR-Wh-jf5" secondAttribute="centerX" id="EEg-qo-ze1"/>
<constraint firstItem="ym1-j4-Fn7" firstAttribute="centerX" secondItem="vVR-Wh-jf5" secondAttribute="centerX" id="Fdz-HB-l8c"/>
<constraint firstItem="ym1-j4-Fn7" firstAttribute="top" secondItem="vVR-Wh-jf5" secondAttribute="top" id="Jen-Ph-CoE"/>
<constraint firstAttribute="bottom" secondItem="WLZ-Z2-pj2" secondAttribute="bottom" id="KyM-Hx-UGh"/>
<constraint firstItem="WLZ-Z2-pj2" firstAttribute="width" secondItem="vVR-Wh-jf5" secondAttribute="width" id="Mvt-BV-8I4"/>
<constraint firstItem="WLZ-Z2-pj2" firstAttribute="centerX" secondItem="vVR-Wh-jf5" secondAttribute="centerX" id="RGt-pT-PAB"/>
<constraint firstItem="MdA-9O-3gH" firstAttribute="width" secondItem="vVR-Wh-jf5" secondAttribute="width" id="Vmk-jQ-wvC"/>
<constraint firstItem="MdA-9O-3gH" firstAttribute="top" secondItem="vVR-Wh-jf5" secondAttribute="top" priority="740" id="dh3-iA-fGg"/>
<constraint firstItem="MdA-9O-3gH" firstAttribute="top" secondItem="ym1-j4-Fn7" secondAttribute="bottom" priority="750" constant="20" id="vk2-tC-DOE"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<accessibility key="accessibilityConfiguration" identifier="BoundsView"/>
<constraints>
<constraint firstItem="vVR-Wh-jf5" firstAttribute="height" relation="lessThanOrEqual" secondItem="5Cw-y3-ipv" secondAttribute="height" id="6PW-WV-Zsn"/>
<constraint firstItem="vVR-Wh-jf5" firstAttribute="leading" secondItem="5Cw-y3-ipv" secondAttribute="leading" priority="999" id="9Eo-eG-hWU"/>
<constraint firstItem="vVR-Wh-jf5" firstAttribute="centerY" secondItem="5Cw-y3-ipv" secondAttribute="centerY" id="TGt-HK-faY"/>
<constraint firstAttribute="trailing" secondItem="vVR-Wh-jf5" secondAttribute="trailing" priority="999" id="ZA8-2V-Loy"/>
<constraint firstItem="vVR-Wh-jf5" firstAttribute="centerX" secondItem="5Cw-y3-ipv" secondAttribute="centerX" id="oRE-Lp-pk2"/>
</constraints>
</view>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5nF-zu-Yw0">
<rect key="frame" x="67.5" y="549" width="240" height="44"/>
<color key="backgroundColor" red="0.12549019610000001" green="0.58823529409999997" blue="0.95294117649999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="240" id="ARV-BQ-Avk"/>
<constraint firstAttribute="height" constant="44" id="eRe-p3-Uls"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
<state key="normal" title="Update All Maps">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular17"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="string" keyPath="textColorName" value="whiteColor"/>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="linkBlue"/>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundHighlightedColorName" value="linkBlueHighlighted"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="updateTap" destination="-1" eventType="touchUpInside" id="Xf3-wC-jZS"/>
</connections>
</button>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="wordWrap" translatesAutoresizingMaskIntoConstraints="NO" id="iEE-M5-NnV">
<rect key="frame" x="67.5" y="603" 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="adp-HR-zDl"/>
<constraint firstAttribute="height" constant="44" id="qzn-GV-spI"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
<state key="normal" title="Manualy update later ">
<color key="titleColor" red="0.01176470588" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular14"/>
<userDefinedRuntimeAttribute type="string" keyPath="textColorName" value="linkBlue"/>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="clearColor"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="cancelTap" destination="-1" eventType="touchUpInside" id="sXb-Nt-cd4"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SqI-nm-lNO">
<rect key="frame" x="169.5" y="539" width="36" height="36"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="36" id="Lfg-Ln-a6V"/>
<constraint firstAttribute="height" constant="36" id="oVz-gc-j9W"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<accessibility key="accessibilityConfiguration" identifier="ContainerView"/>
<constraints>
<constraint firstItem="SqI-nm-lNO" firstAttribute="centerX" secondItem="CrL-6X-EJl" secondAttribute="centerX" id="2zw-eu-fGT"/>
<constraint firstItem="5nF-zu-Yw0" firstAttribute="centerX" secondItem="CrL-6X-EJl" secondAttribute="centerX" id="9se-pw-oRi"/>
<constraint firstItem="iEE-M5-NnV" firstAttribute="top" secondItem="5nF-zu-Yw0" secondAttribute="bottom" priority="500" constant="10" id="LWi-4H-ezA"/>
<constraint firstAttribute="bottom" secondItem="iEE-M5-NnV" secondAttribute="bottom" constant="20" id="Mag-7y-dYi"/>
<constraint firstAttribute="trailing" secondItem="5Cw-y3-ipv" secondAttribute="trailing" constant="16" id="QsU-yA-a5N"/>
<constraint firstItem="5Cw-y3-ipv" firstAttribute="top" secondItem="CrL-6X-EJl" secondAttribute="top" constant="100" id="S3w-Tp-ulT"/>
<constraint firstItem="ym1-j4-Fn7" firstAttribute="height" secondItem="CrL-6X-EJl" secondAttribute="height" multiplier="0.3" priority="750" id="fWB-qe-uuj"/>
<constraint firstItem="5Cw-y3-ipv" firstAttribute="leading" secondItem="CrL-6X-EJl" secondAttribute="leading" constant="16" id="iWS-dU-Nwv"/>
<constraint firstItem="5nF-zu-Yw0" firstAttribute="top" secondItem="5Cw-y3-ipv" secondAttribute="bottom" priority="250" constant="24" id="jli-Ut-tZT"/>
<constraint firstAttribute="bottom" secondItem="SqI-nm-lNO" secondAttribute="bottom" constant="92" id="olJ-ci-imz"/>
<constraint firstItem="iEE-M5-NnV" firstAttribute="centerX" secondItem="CrL-6X-EJl" secondAttribute="centerX" id="pHJ-KJ-l9f"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="layer.shadowOffset">
<size key="value" width="0.0" height="3"/>
</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>
<userDefinedRuntimeAttribute type="number" keyPath="layer.shadowOpacity">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="white"/>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="CrL-6X-EJl" firstAttribute="width" secondItem="4Q8-tQ-qqq" secondAttribute="width" id="TM3-Rp-oI1"/>
<constraint firstItem="CrL-6X-EJl" firstAttribute="height" secondItem="4Q8-tQ-qqq" secondAttribute="height" id="nfT-Ff-8TY"/>
<constraint firstItem="CrL-6X-EJl" firstAttribute="centerX" secondItem="4Q8-tQ-qqq" secondAttribute="centerX" id="owQ-ao-M5Q"/>
<constraint firstItem="CrL-6X-EJl" firstAttribute="centerY" secondItem="4Q8-tQ-qqq" secondAttribute="centerY" id="sM6-Cf-eHx"/>
</constraints>
<connections>
<outlet property="image" destination="ym1-j4-Fn7" id="XrK-nD-Jii"/>
<outlet property="imageHeight" destination="fWB-qe-uuj" id="k07-Lv-4Ui"/>
<outlet property="imageMinHeight" destination="lKy-F4-tpj" id="zef-yg-5d3"/>
<outlet property="primaryButton" destination="5nF-zu-Yw0" id="CAx-NV-Vke"/>
<outlet property="secondaryButton" destination="iEE-M5-NnV" id="clP-02-Qne"/>
<outlet property="spinnerView" destination="SqI-nm-lNO" id="dBJ-ee-nQn"/>
<outlet property="text" destination="WLZ-Z2-pj2" id="XFP-yM-UH3"/>
<outlet property="title" destination="MdA-9O-3gH" id="7NW-eO-on5"/>
<outlet property="titleImageOffset" destination="vk2-tC-DOE" id="40I-iU-krz"/>
<outlet property="titleTopOffset" destination="dh3-iA-fGg" id="pM9-PQ-ryI"/>
</connections>
</view>
</objects>
<resources>
<image name="wn_autoupdate" width="240" height="240"/>
</resources>
</document>

View file

@ -1520,6 +1520,9 @@ Framework::DoAfterUpdate Framework::ToDoAfterUpdate() const
s.GetNodeAttrs(rootId, attrs);
TMwmSize const countrySizeInBytes = attrs.m_localMwmSize;
if (countrySizeInBytes == 0 || attrs.m_status != NodeStatus::OnDiskOutOfDate)
return DoAfterUpdate::Nothing;
return countrySizeInBytes > maxSizeInBytes ? DoAfterUpdate::AskForUpdateMaps
: DoAfterUpdate::AutoupdateMaps;
}