Clang-format.

This commit is contained in:
Ilya Grechuhin 2016-08-29 11:52:44 +03:00
parent 436c25692f
commit e63913c16f
21 changed files with 497 additions and 533 deletions

View file

@ -1,10 +1,10 @@
#import "AppInfo.h"
#import "MWMAlertViewController.h"
#import "MWMRateAlert.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import <MessageUI/MFMailComposeViewController.h>
#import <sys/utsname.h>
#import "AppInfo.h"
#import "MWMAlertViewController.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "3party/Alohalytics/src/alohalytics_objc.h"
@ -19,13 +19,13 @@ static NSString * const kRateEmail = @"rating@maps.me";
static NSString * const kStatisticsEvent = @"Rate Alert";
@interface MWMRateAlert () <MFMailComposeViewControllerDelegate>
@interface MWMRateAlert ()<MFMailComposeViewControllerDelegate>
@property (nonatomic) IBOutletCollection(UIButton) NSArray * buttons;
@property (nonatomic, weak) IBOutlet UIButton * rateButton;
@property (nonatomic, weak) IBOutlet UILabel * title;
@property (nonatomic, weak) IBOutlet UILabel * message;
@property (nonatomic) NSUInteger selectedTag;
@property(nonatomic) IBOutletCollection(UIButton) NSArray * buttons;
@property(nonatomic, weak) IBOutlet UIButton * rateButton;
@property(nonatomic, weak) IBOutlet UILabel * title;
@property(nonatomic, weak) IBOutlet UILabel * message;
@property(nonatomic) NSUInteger selectedTag;
@end
@ -34,7 +34,8 @@ static NSString * const kStatisticsEvent = @"Rate Alert";
+ (instancetype)alert
{
[Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatOpen}];
MWMRateAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kRateAlertNibName owner:self options:nil] firstObject];
MWMRateAlert * alert =
[[[NSBundle mainBundle] loadNibNamed:kRateAlertNibName owner:self options:nil] firstObject];
[alert configureButtons];
return alert;
}
@ -83,22 +84,14 @@ static NSString * const kStatisticsEvent = @"Rate Alert";
self.selectedTag = tag;
}
- (IBAction)starHighlighted:(UIButton *)sender
{
[self setHighlighted:sender.tag];
}
- (IBAction)starHighlighted:(UIButton *)sender { [self setHighlighted:sender.tag]; }
- (IBAction)starTouchCanceled
{
for (UIButton * b in self.buttons)
b.highlighted = NO;
}
- (IBAction)starDragInside:(UIButton *)sender
{
[self setHighlighted:sender.tag];
}
- (IBAction)starDragInside:(UIButton *)sender { [self setHighlighted:sender.tag]; }
- (void)setHighlighted:(NSUInteger)tag
{
for (UIButton * b in self.buttons)
@ -121,7 +114,9 @@ static NSString * const kStatisticsEvent = @"Rate Alert";
{
NSUInteger const tag = self.selectedTag;
[Statistics logEvent:kStatEventName(kStatisticsEvent, kStatRate)
withParameters:@{kStatValue : @(tag).stringValue}];
withParameters:@{
kStatValue : @(tag).stringValue
}];
if (tag == 5)
{
[[UIApplication sharedApplication] rateVersionFrom:@"ios_pro_popup"];
@ -158,33 +153,35 @@ static NSString * const kStatisticsEvent = @"Rate Alert";
device = machine;
NSString * languageCode = [[NSLocale preferredLanguages] firstObject];
NSString * language = [[NSLocale localeWithLocaleIdentifier:kLocaleUsedInSupportEmails]
displayNameForKey:NSLocaleLanguageCode
value:languageCode];
displayNameForKey:NSLocaleLanguageCode
value:languageCode];
NSString * locale = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
NSString * country = [[NSLocale localeWithLocaleIdentifier:kLocaleUsedInSupportEmails]
displayNameForKey:NSLocaleCountryCode
value:locale];
displayNameForKey:NSLocaleCountryCode
value:locale];
NSString * bundleVersion = AppInfo.sharedInfo.bundleVersion;
NSString * text = [NSString stringWithFormat:@"\n\n\n\n- %@ (%@)\n- MAPS.ME %@\n- %@/%@", device,
[UIDevice currentDevice].systemVersion,
bundleVersion,
language,
country];
NSString * text = [NSString stringWithFormat:@"\n\n\n\n- %@ (%@)\n- MAPS.ME %@\n- %@/%@",
device, [UIDevice currentDevice].systemVersion,
bundleVersion, language, country];
MFMailComposeViewController * mailController = [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate = self;
[mailController setSubject:[NSString stringWithFormat:@"%@ : %@", L(@"rating_just_rated"), @(self.selectedTag)]];
[mailController setToRecipients:@[kRateEmail]];
[mailController setSubject:[NSString stringWithFormat:@"%@ : %@", L(@"rating_just_rated"),
@(self.selectedTag)]];
[mailController setToRecipients:@[ kRateEmail ]];
[mailController setMessageBody:text isHTML:NO];
mailController.navigationBar.tintColor = [UIColor blackColor];
[self.alertController.ownerViewController presentViewController:mailController animated:YES completion:nil];
[self.alertController.ownerViewController presentViewController:mailController
animated:YES
completion:nil];
}
else
{
NSString * text = [NSString stringWithFormat:L(@"email_error_body"), kRateEmail];
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title") message:text
delegate:nil
cancelButtonTitle:L(@"ok")
otherButtonTitles:nil] show];
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title")
message:text
delegate:nil
cancelButtonTitle:L(@"ok")
otherButtonTitles:nil] show];
}
}
@ -194,11 +191,12 @@ static NSString * const kStatisticsEvent = @"Rate Alert";
didFinishWithResult:(MFMailComposeResult)result
error:(NSError *)error
{
[self.alertController.ownerViewController dismissViewControllerAnimated:YES completion:^
{
[Statistics logEvent:kStatEventName(kStatisticsEvent, kStatClose)];
[self close];
}];
[self.alertController.ownerViewController
dismissViewControllerAnimated:YES
completion:^{
[Statistics logEvent:kStatEventName(kStatisticsEvent, kStatClose)];
[self close];
}];
}
@end

View file

@ -1,38 +1,37 @@
#import "MWMAuthorizationOSMLoginViewController.h"
#import "MWMAlertViewController.h"
#import "MWMAuthorizationCommon.h"
#import "MWMAuthorizationOSMLoginViewController.h"
#import "MWMCircularProgress.h"
#import "MWMSettingsViewController.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "UITextField+RuntimeAttributes.h"
#import "MWMSettingsViewController.h"
#include "private.h"
#include "base/logging.hpp"
#include "editor/server_api.hpp"
#include "platform/platform.hpp"
#include "base/logging.hpp"
#include "private.h"
typedef NS_OPTIONS(NSUInteger, MWMFieldCorrect)
{
MWMFieldCorrectNO = 0,
MWMFieldCorrectLogin = 1 << 0,
typedef NS_OPTIONS(NSUInteger, MWMFieldCorrect) {
MWMFieldCorrectNO = 0,
MWMFieldCorrectLogin = 1 << 0,
MWMFieldCorrectPassword = 1 << 1,
MWMFieldCorrectAll = MWMFieldCorrectLogin | MWMFieldCorrectPassword
};
using namespace osm;
@interface MWMAuthorizationOSMLoginViewController () <UITextFieldDelegate>
@interface MWMAuthorizationOSMLoginViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField * loginTextField;
@property (weak, nonatomic) IBOutlet UITextField * passwordTextField;
@property (weak, nonatomic) IBOutlet UIButton * loginButton;
@property (weak, nonatomic) IBOutlet UIButton * forgotButton;
@property (weak, nonatomic) IBOutlet UIView * spinnerView;
@property(weak, nonatomic) IBOutlet UITextField * loginTextField;
@property(weak, nonatomic) IBOutlet UITextField * passwordTextField;
@property(weak, nonatomic) IBOutlet UIButton * loginButton;
@property(weak, nonatomic) IBOutlet UIButton * forgotButton;
@property(weak, nonatomic) IBOutlet UIView * spinnerView;
@property (nonatomic) MWMFieldCorrect isCorrect;
@property(nonatomic) MWMFieldCorrect isCorrect;
@property (nonatomic) MWMCircularProgress * spinner;
@property(nonatomic) MWMCircularProgress * spinner;
@end
@ -54,19 +53,13 @@ using namespace osm;
[self.loginTextField becomeFirstResponder];
}
- (BOOL)shouldAutorotate
{
return NO;
}
- (void)checkConnection
{
self.forgotButton.enabled = Platform::IsConnected();
}
- (BOOL)shouldAutorotate { return NO; }
- (void)checkConnection { self.forgotButton.enabled = Platform::IsConnected(); }
#pragma mark - UITextFieldDelegate
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
- (BOOL)textField:(UITextField *)textField
shouldChangeCharactersInRange:(NSRange)range
replacementString:(NSString *)string
{
NSString * newString =
[textField.text stringByReplacingCharactersInRange:range withString:string];
@ -135,8 +128,7 @@ using namespace osm;
if (Platform::IsConnected())
{
[self startSpinner];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
string const username = self.loginTextField.text.UTF8String;
string const password = self.passwordTextField.text.UTF8String;
OsmOAuth auth = OsmOAuth::ServerAuth();
@ -147,18 +139,20 @@ using namespace osm;
catch (exception const & ex)
{
LOG(LWARNING, ("Error login", ex.what()));
[Statistics logEvent:@"Editor_Auth_request_result" withParameters:@{kStatIsSuccess : kStatNo,
kStatErrorData : @(ex.what()),
kStatType : kStatOSM}];
[Statistics logEvent:@"Editor_Auth_request_result"
withParameters:@{
kStatIsSuccess : kStatNo,
kStatErrorData : @(ex.what()),
kStatType : kStatOSM
}];
}
dispatch_async(dispatch_get_main_queue(), ^
{
dispatch_async(dispatch_get_main_queue(), ^{
[self stopSpinner];
if (auth.IsAuthorized())
{
osm_auth_ios::AuthorizationStoreCredentials(auth.GetKeySecret());
[Statistics logEvent:@"Editor_Auth_request_result" withParameters:@{kStatIsSuccess : kStatYes,
kStatType : kStatOSM}];
[Statistics logEvent:@"Editor_Auth_request_result"
withParameters:@{kStatIsSuccess : kStatYes, kStatType : kStatOSM}];
UIViewController * svc = nil;
for (UIViewController * vc in self.navigationController.viewControllers)
{
@ -186,11 +180,7 @@ using namespace osm;
}
}
- (IBAction)cancel
{
[self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)cancel { [self.navigationController popViewControllerAnimated:YES]; }
- (IBAction)forgotPassword
{
[self openUrl:[NSURL URLWithString:@(OsmOAuth::ServerAuth().GetResetPasswordURL().c_str())]];

View file

@ -1,10 +1,10 @@
#import "MWMAuthorizationWebViewLoginViewController.h"
#import "Common.h"
#import "MWMAlertViewController.h"
#import "MWMAuthorizationCommon.h"
#import "MWMAuthorizationWebViewLoginViewController.h"
#import "MWMCircularProgress.h"
#import "Statistics.h"
#import "MWMSettingsViewController.h"
#import "Statistics.h"
#include "base/logging.hpp"
#include "editor/osm_auth.hpp"
@ -17,8 +17,8 @@ NSString * const kVerifierKey = @"oauth_verifier";
BOOL checkURLHasVerifierKey(NSString * urlString)
{
return isIOS7 ? [urlString rangeOfString:kVerifierKey].location != NSNotFound :
[urlString containsString:kVerifierKey];
return isIOS7 ? [urlString rangeOfString:kVerifierKey].location != NSNotFound
: [urlString containsString:kVerifierKey];
}
BOOL checkURLNeedsReload(NSString * urlString)
@ -27,7 +27,6 @@ BOOL checkURLNeedsReload(NSString * urlString)
if (!isIOS7)
return hasSlashSuffix || [urlString containsString:@"/welcome"];
return hasSlashSuffix || ([urlString rangeOfString:@"/welcome"].location != NSNotFound);
}
NSString * getVerifier(NSString * urlString)
@ -47,12 +46,12 @@ NSString * getVerifier(NSString * urlString)
}
} // namespace
@interface MWMAuthorizationWebViewLoginViewController () <UIWebViewDelegate>
@interface MWMAuthorizationWebViewLoginViewController ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView * webView;
@property (weak, nonatomic) IBOutlet UIView * spinnerView;
@property(weak, nonatomic) IBOutlet UIWebView * webView;
@property(weak, nonatomic) IBOutlet UIView * spinnerView;
@property (nonatomic) MWMCircularProgress * spinner;
@property(nonatomic) MWMCircularProgress * spinner;
@end
@ -83,26 +82,20 @@ NSString * getVerifier(NSString * urlString)
- (void)loadAuthorizationPage
{
[self startSpinner];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
OsmOAuth const auth = OsmOAuth::ServerAuth();
try
{
OsmOAuth::TUrlRequestToken urt;
switch (self.authType)
{
case MWMWebViewAuthorizationTypeGoogle:
urt = auth.GetGoogleOAuthURL();
break;
case MWMWebViewAuthorizationTypeFacebook:
urt = auth.GetFacebookOAuthURL();
break;
case MWMWebViewAuthorizationTypeGoogle: urt = auth.GetGoogleOAuthURL(); break;
case MWMWebViewAuthorizationTypeFacebook: urt = auth.GetFacebookOAuthURL(); break;
}
self->m_requestToken = urt.second;
NSURL * url = [NSURL URLWithString:@(urt.first.c_str())];
NSURLRequest * request = [NSURLRequest requestWithURL:url];
dispatch_async(dispatch_get_main_queue(), ^
{
dispatch_async(dispatch_get_main_queue(), ^{
[self stopSpinner];
self.webView.hidden = NO;
[self.webView loadRequest:request];
@ -110,8 +103,7 @@ NSString * getVerifier(NSString * urlString)
}
catch (exception const & ex)
{
dispatch_async(dispatch_get_main_queue(), ^
{
dispatch_async(dispatch_get_main_queue(), ^{
[self stopSpinner];
[self.alertController presentInternalErrorAlert];
});
@ -140,16 +132,15 @@ NSString * getVerifier(NSString * urlString)
{
switch (self.authType)
{
case MWMWebViewAuthorizationTypeGoogle: return kStatGoogle;
case MWMWebViewAuthorizationTypeFacebook: return kStatFacebook;
case MWMWebViewAuthorizationTypeGoogle: return kStatGoogle;
case MWMWebViewAuthorizationTypeFacebook: return kStatFacebook;
}
}
- (void)checkAuthorization:(NSString *)verifier
{
[self startSpinner];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
OsmOAuth const auth = OsmOAuth::ServerAuth();
TKeySecret ks;
try
@ -159,18 +150,20 @@ NSString * getVerifier(NSString * urlString)
catch (exception const & ex)
{
LOG(LWARNING, ("checkAuthorization error", ex.what()));
[Statistics logEvent:@"Editor_Auth_request_result" withParameters:@{kStatIsSuccess : kStatNo,
kStatErrorData : @(ex.what()),
kStatType : self.authTypeAsString}];
[Statistics logEvent:@"Editor_Auth_request_result"
withParameters:@{
kStatIsSuccess : kStatNo,
kStatErrorData : @(ex.what()),
kStatType : self.authTypeAsString
}];
}
dispatch_async(dispatch_get_main_queue(), ^
{
dispatch_async(dispatch_get_main_queue(), ^{
[self stopSpinner];
if (OsmOAuth::IsValid(ks))
{
osm_auth_ios::AuthorizationStoreCredentials(ks);
[Statistics logEvent:@"Editor_Auth_request_result" withParameters:@{kStatIsSuccess : kStatYes,
kStatType : self.authTypeAsString}];
[Statistics logEvent:@"Editor_Auth_request_result"
withParameters:@{kStatIsSuccess : kStatYes, kStatType : self.authTypeAsString}];
UIViewController * svc = nil;
for (UIViewController * vc in self.navigationController.viewControllers)
{
@ -197,18 +190,10 @@ NSString * getVerifier(NSString * urlString)
#pragma mark - Actions
- (void)onCancel
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)onCancel { [self.navigationController popViewControllerAnimated:YES]; }
#pragma mark - UIWebViewDelegate
- (void)webViewDidStartLoad:(UIWebView *)webView
{
[self startSpinner];
}
- (void)webViewDidStartLoad:(UIWebView *)webView { [self startSpinner]; }
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
[self stopSpinner];

View file

@ -13,10 +13,10 @@
#import "MWMMapViewControlsManager.h"
#import "MWMRouter.h"
#import "MWMSearchManager.h"
#import "MWMSettingsViewController.h"
#import "MWMTextToSpeech.h"
#import "MapViewController.h"
#import "MapsAppDelegate.h"
#import "MWMSettingsViewController.h"
#import "Statistics.h"
#import "TimeUtils.h"
#import "UIColor+MapsMeColor.h"

View file

@ -2,10 +2,10 @@
#import "Common.h"
#import "MWMButton.h"
#import "MWMRouter.h"
#import "MWMSettings.h"
#import "MWMSideButtonsView.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "MWMSettings.h"
#import "3party/Alohalytics/src/alohalytics_objc.h"

View file

@ -1,8 +1,8 @@
#import "Common.h"
#import "MapsAppDelegate.h"
#import "MWMLocationManager.h"
#import "MWMNavigationDashboardEntity.h"
#import "Common.h"
#import "MWMLocationManager.h"
#import "MWMSettings.h"
#import "MapsAppDelegate.h"
#include "Framework.h"
#include "geometry/distance_on_sphere.hpp"
@ -27,16 +27,16 @@ using namespace routing::turns;
string distance;
CLLocationCoordinate2D const & coordinate = lastLocation.coordinate;
_pedestrianDirectionPosition = info.m_pedestrianDirectionPos;
//TODO: Not the best solution, but this solution is temporary and will be replaced in future
// TODO: Not the best solution, but this solution is temporary and will be replaced in future
measurement_utils::FormatDistance(
ms::DistanceOnEarth(coordinate.latitude, coordinate.longitude,
_pedestrianDirectionPosition.lat, _pedestrianDirectionPosition.lon),
distance);
istringstream is (distance);
istringstream is(distance);
string dist;
string units;
is>>dist;
is>>units;
is >> dist;
is >> units;
_nextTurnImage = nil;
_distanceToTurn = @(dist.c_str());
_turnUnits = @(units.c_str());
@ -70,47 +70,23 @@ UIImage * image(routing::turns::TurnDirection t, bool isNextTurn)
NSString * imageName;
switch (t)
{
case TurnDirection::TurnSlightRight:
imageName = @"slight_right";
break;
case TurnDirection::TurnRight:
imageName = @"simple_right";
break;
case TurnDirection::TurnSharpRight:
imageName = @"sharp_right";
break;
case TurnDirection::TurnSlightLeft:
imageName = @"slight_left";
break;
case TurnDirection::TurnLeft:
imageName = @"simple_left";
break;
case TurnDirection::TurnSharpLeft:
imageName = @"sharp_left";
break;
case TurnDirection::UTurnLeft:
imageName = @"uturn_left";
break;
case TurnDirection::UTurnRight:
imageName = @"uturn_right";
break;
case TurnDirection::ReachedYourDestination:
imageName = @"finish_point";
break;
case TurnDirection::LeaveRoundAbout:
case TurnDirection::EnterRoundAbout:
imageName = @"round";
break;
case TurnDirection::GoStraight:
imageName = @"straight";
break;
case TurnDirection::StartAtEndOfStreet:
case TurnDirection::StayOnRoundAbout:
case TurnDirection::TakeTheExit:
case TurnDirection::Count:
case TurnDirection::NoTurn:
imageName = isNextTurn ? nil : @"straight";
break;
case TurnDirection::TurnSlightRight: imageName = @"slight_right"; break;
case TurnDirection::TurnRight: imageName = @"simple_right"; break;
case TurnDirection::TurnSharpRight: imageName = @"sharp_right"; break;
case TurnDirection::TurnSlightLeft: imageName = @"slight_left"; break;
case TurnDirection::TurnLeft: imageName = @"simple_left"; break;
case TurnDirection::TurnSharpLeft: imageName = @"sharp_left"; break;
case TurnDirection::UTurnLeft: imageName = @"uturn_left"; break;
case TurnDirection::UTurnRight: imageName = @"uturn_right"; break;
case TurnDirection::ReachedYourDestination: imageName = @"finish_point"; break;
case TurnDirection::LeaveRoundAbout:
case TurnDirection::EnterRoundAbout: imageName = @"round"; break;
case TurnDirection::GoStraight: imageName = @"straight"; break;
case TurnDirection::StartAtEndOfStreet:
case TurnDirection::StayOnRoundAbout:
case TurnDirection::TakeTheExit:
case TurnDirection::Count:
case TurnDirection::NoTurn: imageName = isNextTurn ? nil : @"straight"; break;
}
if (!imageName)
return nil;

View file

@ -23,6 +23,7 @@
#import "MWMPlacePageEntity.h"
#import "MWMRouter.h"
#import "MWMRouterSavedState.h"
#import "MWMSettings.h"
#import "MWMStorage.h"
#import "MWMTableViewController.h"
#import "MWMWhatsNewNavigationController.h"
@ -31,7 +32,6 @@
#import "UIColor+MapsMeColor.h"
#import "UIFont+MapsMeFonts.h"
#import "UIViewController+Navigation.h"
#import "MWMSettings.h"
#import "3party/Alohalytics/src/alohalytics_objc.h"
@ -171,9 +171,9 @@ BOOL gIsFirstMyPositionMode = YES;
df::TouchEvent e;
UITouch * touch = [allTouches objectAtIndex:0];
CGPoint const pt = [touch locationInView:v];
e.SetTouchType(type);
df::Touch t0;
t0.m_location = m2::PointD(pt.x * scaleFactor, pt.y * scaleFactor);
t0.m_id = reinterpret_cast<int64_t>(touch);
@ -185,7 +185,7 @@ BOOL gIsFirstMyPositionMode = YES;
{
UITouch * touch = [allTouches objectAtIndex:1];
CGPoint const pt = [touch locationInView:v];
df::Touch t1;
t1.m_location = m2::PointD(pt.x * scaleFactor, pt.y * scaleFactor);
t1.m_id = reinterpret_cast<int64_t>(touch);

View file

@ -14,13 +14,13 @@
#import "MWMLocationManager.h"
#import "MWMRouter.h"
#import "MWMRouterSavedState.h"
#import "MWMSettings.h"
#import "MWMStorage.h"
#import "MWMTextToSpeech.h"
#import "MapViewController.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "UIFont+MapsMeFonts.h"
#import "MWMSettings.h"
#import "3party/Alohalytics/src/alohalytics_objc.h"
@ -231,11 +231,7 @@ using namespace osm_auth_ios;
return ((EAGLView *)self.mapViewController.view).drapeEngineCreated;
}
- (BOOL)hasApiURL
{
return m_geoURL || m_mwmURL || m_fileURL;
}
- (BOOL)hasApiURL { return m_geoURL || m_mwmURL || m_fileURL; }
- (void)handleURLs
{
if (!self.isDrapeEngineCreated)

View file

@ -8,12 +8,12 @@
#import "MWMNavigationDashboardManager.h"
#import "MWMRouterSavedState.h"
#import "MWMSearch.h"
#import "MWMSettings.h"
#import "MWMStorage.h"
#import "MWMTextToSpeech.h"
#import "MapViewController.h"
#import "MapsAppDelegate.h"
#import "Statistics.h"
#import "MWMSettings.h"
#include "Framework.h"

View file

@ -1,16 +1,16 @@
#import "MWMMapDownloadDialog.h"
#import "Common.h"
#import "MapsAppDelegate.h"
#import "MapViewController.h"
#import "MWMAlertViewController.h"
#import "MWMCircularProgress.h"
#import "MWMFrameworkListener.h"
#import "MWMFrameworkObservers.h"
#import "MWMLocationManager.h"
#import "MWMMapDownloadDialog.h"
#import "MWMSettings.h"
#import "MWMStorage.h"
#import "MapViewController.h"
#import "MapsAppDelegate.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "MWMSettings.h"
#include "Framework.h"
@ -34,26 +34,25 @@ BOOL canAutoDownload(TCountryId const & countryId)
return NO;
return !platform::migrate::NeedMigrate();
}
} // namespace
} // namespace
using namespace storage;
@interface MWMMapDownloadDialog ()<MWMFrameworkStorageObserver,
MWMCircularProgressProtocol>
@property (weak, nonatomic) IBOutlet UILabel * parentNode;
@property (weak, nonatomic) IBOutlet UILabel * node;
@property (weak, nonatomic) IBOutlet UILabel * nodeSize;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint * nodeTopOffset;
@property (weak, nonatomic) IBOutlet UIButton * downloadButton;
@property (weak, nonatomic) IBOutlet UIView * progressWrapper;
@interface MWMMapDownloadDialog ()<MWMFrameworkStorageObserver, MWMCircularProgressProtocol>
@property(weak, nonatomic) IBOutlet UILabel * parentNode;
@property(weak, nonatomic) IBOutlet UILabel * node;
@property(weak, nonatomic) IBOutlet UILabel * nodeSize;
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * nodeTopOffset;
@property(weak, nonatomic) IBOutlet UIButton * downloadButton;
@property(weak, nonatomic) IBOutlet UIView * progressWrapper;
@property (weak, nonatomic) MapViewController * controller;
@property(weak, nonatomic) MapViewController * controller;
@property (nonatomic) MWMCircularProgress * progress;
@property(nonatomic) MWMCircularProgress * progress;
@property (nonatomic) NSMutableArray<NSDate *> * skipDownloadTimes;
@property(nonatomic) NSMutableArray<NSDate *> * skipDownloadTimes;
@property (nonatomic) BOOL isAutoDownloadCancelled;
@property(nonatomic) BOOL isAutoDownloadCancelled;
@end
@ -65,7 +64,8 @@ using namespace storage;
+ (instancetype)dialogForController:(MapViewController *)controller
{
MWMMapDownloadDialog * dialog = [[NSBundle mainBundle] loadNibNamed:[self className] owner:nil options:nil].firstObject;
MWMMapDownloadDialog * dialog =
[[NSBundle mainBundle] loadNibNamed:[self className] owner:nil options:nil].firstObject;
dialog.autoresizingMask = UIViewAutoresizingFlexibleHeight;
dialog.controller = controller;
dialog.size = kInitialDialogSize;
@ -76,15 +76,16 @@ using namespace storage;
{
UIView * superview = self.superview;
self.center = {superview.midX, superview.midY};
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
CGSize const newSize = [self systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
if (CGSizeEqualToSize(newSize, self.size))
return;
self.size = newSize;
self.center = {superview.midX, superview.midY};
[self layoutIfNeeded];
}];
[UIView animateWithDuration:kDefaultAnimationDuration
animations:^{
CGSize const newSize =
[self systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
if (CGSizeEqualToSize(newSize, self.size))
return;
self.size = newSize;
self.center = {superview.midX, superview.midY};
[self layoutIfNeeded];
}];
[super layoutSubviews];
if (isIOS7)
{
@ -110,7 +111,8 @@ using namespace storage;
BOOL const noParrent = (nodeAttrs.m_parentInfo[0].m_id == s.GetRootId());
BOOL const hideParent = (noParrent || isMultiParent);
self.parentNode.hidden = hideParent;
self.nodeTopOffset.priority = hideParent ? UILayoutPriorityDefaultHigh : UILayoutPriorityDefaultLow;
self.nodeTopOffset.priority =
hideParent ? UILayoutPriorityDefaultHigh : UILayoutPriorityDefaultLow;
if (!hideParent)
self.parentNode.text = @(nodeAttrs.m_topmostParentInfo[0].m_localName.c_str());
self.node.text = @(nodeAttrs.m_nodeLocalName.c_str());
@ -120,47 +122,47 @@ using namespace storage;
switch (nodeAttrs.m_status)
{
case NodeStatus::NotDownloaded:
case NodeStatus::Partly:
case NodeStatus::NotDownloaded:
case NodeStatus::Partly:
{
BOOL const isMapVisible =
[self.controller.navigationController.topViewController isEqual:self.controller];
if (isMapVisible && !self.isAutoDownloadCancelled && canAutoDownload(m_countryId))
{
BOOL const isMapVisible = [self.controller.navigationController.topViewController isEqual:self.controller];
if (isMapVisible && !self.isAutoDownloadCancelled && canAutoDownload(m_countryId))
{
[Statistics logEvent:kStatDownloaderMapAction
withParameters:@{
kStatAction : kStatDownload,
kStatIsAuto : kStatYes,
kStatFrom : kStatMap,
kStatScenario : kStatDownload
}];
m_autoDownloadCountryId = m_countryId;
[MWMStorage downloadNode:m_countryId
alertController:self.controller.alertController
onSuccess:^{ [self showInQueue]; }];
}
else
{
m_autoDownloadCountryId = kInvalidCountryId;
[self showDownloadRequest];
}
break;
[Statistics logEvent:kStatDownloaderMapAction
withParameters:@{
kStatAction : kStatDownload,
kStatIsAuto : kStatYes,
kStatFrom : kStatMap,
kStatScenario : kStatDownload
}];
m_autoDownloadCountryId = m_countryId;
[MWMStorage downloadNode:m_countryId
alertController:self.controller.alertController
onSuccess:^{
[self showInQueue];
}];
}
case NodeStatus::Downloading:
if (nodeAttrs.m_downloadingProgress.second != 0)
[self showDownloading:static_cast<CGFloat>(nodeAttrs.m_downloadingProgress.first) / nodeAttrs.m_downloadingProgress.second];
break;
case NodeStatus::InQueue:
[self showInQueue];
break;
case NodeStatus::Undefined:
case NodeStatus::Error:
if (p.IsAutoRetryDownloadFailed())
[self showError:nodeAttrs.m_error];
break;
case NodeStatus::OnDisk:
case NodeStatus::OnDiskOutOfDate:
[self removeFromSuperview];
break;
else
{
m_autoDownloadCountryId = kInvalidCountryId;
[self showDownloadRequest];
}
break;
}
case NodeStatus::Downloading:
if (nodeAttrs.m_downloadingProgress.second != 0)
[self showDownloading:static_cast<CGFloat>(nodeAttrs.m_downloadingProgress.first) /
nodeAttrs.m_downloadingProgress.second];
break;
case NodeStatus::InQueue: [self showInQueue]; break;
case NodeStatus::Undefined:
case NodeStatus::Error:
if (p.IsAutoRetryDownloadFailed())
[self showError:nodeAttrs.m_error];
break;
case NodeStatus::OnDisk:
case NodeStatus::OnDiskOutOfDate: [self removeFromSuperview]; break;
}
}
else
@ -198,8 +200,7 @@ using namespace storage;
self.progress.state = MWMCircularProgressStateFailed;
MWMAlertViewController * avc = self.controller.alertController;
[self addToSuperview];
auto const retryBlock = ^
{
auto const retryBlock = ^{
[Statistics logEvent:kStatDownloaderMapAction
withParameters:@{
kStatAction : kStatRetry,
@ -210,24 +211,20 @@ using namespace storage;
[self showInQueue];
[MWMStorage retryDownloadNode:self->m_countryId];
};
auto const cancelBlock = ^
{
auto const cancelBlock = ^{
[Statistics logEvent:kStatDownloaderDownloadCancel withParameters:@{kStatFrom : kStatMap}];
[MWMStorage cancelDownloadNode:self->m_countryId];
};
switch (errorCode)
{
case NodeErrorCode::NoError:
break;
case NodeErrorCode::UnknownError:
[avc presentDownloaderInternalErrorAlertWithOkBlock:retryBlock cancelBlock:cancelBlock];
break;
case NodeErrorCode::OutOfMemFailed:
[avc presentDownloaderNotEnoughSpaceAlert];
break;
case NodeErrorCode::NoInetConnection:
[avc presentDownloaderNoConnectionAlertWithOkBlock:retryBlock cancelBlock:cancelBlock];
break;
case NodeErrorCode::NoError: break;
case NodeErrorCode::UnknownError:
[avc presentDownloaderInternalErrorAlertWithOkBlock:retryBlock cancelBlock:cancelBlock];
break;
case NodeErrorCode::OutOfMemFailed: [avc presentDownloaderNotEnoughSpaceAlert]; break;
case NodeErrorCode::NoInetConnection:
[avc presentDownloaderNoConnectionAlertWithOkBlock:retryBlock cancelBlock:cancelBlock];
break;
}
}
@ -241,7 +238,8 @@ using namespace storage;
- (void)showDownloading:(CGFloat)progress
{
self.nodeSize.textColor = [UIColor blackSecondaryText];
self.nodeSize.text = [NSString stringWithFormat:@"%@ %@%%", L(@"downloader_downloading"), @(static_cast<NSUInteger>(progress * 100))];
self.nodeSize.text = [NSString stringWithFormat:@"%@ %@%%", L(@"downloader_downloading"),
@(static_cast<NSUInteger>(progress * 100))];
self.downloadButton.hidden = YES;
self.progressWrapper.hidden = NO;
self.progress.progress = progress;
@ -279,7 +277,8 @@ using namespace storage;
[self removeFromSuperview];
}
- (void)processCountry:(TCountryId const &)countryId progress:(MapFilesDownloader::TProgress const &)progress
- (void)processCountry:(TCountryId const &)countryId
progress:(MapFilesDownloader::TProgress const &)progress
{
if (self.superview && m_countryId == countryId)
[self showDownloading:static_cast<CGFloat>(progress.first) / progress.second];
@ -323,14 +322,16 @@ using namespace storage;
{
[Statistics logEvent:kStatDownloaderMapAction
withParameters:@{
kStatAction : kStatDownload,
kStatIsAuto : kStatNo,
kStatFrom : kStatMap,
kStatScenario : kStatDownload
}];
kStatAction : kStatDownload,
kStatIsAuto : kStatNo,
kStatFrom : kStatMap,
kStatScenario : kStatDownload
}];
[MWMStorage downloadNode:m_countryId
alertController:self.controller.alertController
onSuccess:^{ [self showInQueue]; }];
onSuccess:^{
[self showInQueue];
}];
}
}

View file

@ -1,9 +1,9 @@
#import "MWMAboutController.h"
#import <MessageUI/MFMailComposeViewController.h>
#import "AppInfo.h"
#import "LinkCell.h"
#import "Statistics.h"
#import <MessageUI/MFMailComposeViewController.h>
#import "WebViewController.h"
#import "AppInfo.h"
#import "3party/Alohalytics/src/alohalytics_objc.h"
@ -11,18 +11,18 @@
extern NSString * const kAlohalyticsTapEventKey;
@interface MWMAboutController () <MFMailComposeViewControllerDelegate>
@interface MWMAboutController ()<MFMailComposeViewControllerDelegate>
@property (weak, nonatomic) IBOutlet UILabel * versionLabel;
@property (weak, nonatomic) IBOutlet UILabel * dateLabel;
@property(weak, nonatomic) IBOutlet UILabel * versionLabel;
@property(weak, nonatomic) IBOutlet UILabel * dateLabel;
@property (weak, nonatomic) IBOutlet LinkCell * websiteCell;
@property (weak, nonatomic) IBOutlet LinkCell * blogCell;
@property (weak, nonatomic) IBOutlet LinkCell * facebookCell;
@property (weak, nonatomic) IBOutlet LinkCell * twitterCell;
@property (weak, nonatomic) IBOutlet LinkCell * subscribeCell;
@property (weak, nonatomic) IBOutlet LinkCell * rateCell;
@property (weak, nonatomic) IBOutlet LinkCell * copyrightCell;
@property(weak, nonatomic) IBOutlet LinkCell * websiteCell;
@property(weak, nonatomic) IBOutlet LinkCell * blogCell;
@property(weak, nonatomic) IBOutlet LinkCell * facebookCell;
@property(weak, nonatomic) IBOutlet LinkCell * twitterCell;
@property(weak, nonatomic) IBOutlet LinkCell * subscribeCell;
@property(weak, nonatomic) IBOutlet LinkCell * rateCell;
@property(weak, nonatomic) IBOutlet LinkCell * copyrightCell;
@end
@ -40,7 +40,8 @@ extern NSString * const kAlohalyticsTapEventKey;
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateStyle = NSDateFormatterShortStyle;
dateFormatter.timeStyle = NSDateFormatterNoStyle;
self.dateLabel.text = [NSString stringWithFormat:@"%@ %@", L(@"date"), [dateFormatter stringFromDate:appInfo.buildDate]];
self.dateLabel.text = [NSString
stringWithFormat:@"%@ %@", L(@"date"), [dateFormatter stringFromDate:appInfo.buildDate]];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
@ -70,7 +71,9 @@ extern NSString * const kAlohalyticsTapEventKey;
else if (cell == self.subscribeCell)
{
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"subscribeToNews"];
[self sendEmailWithText:L(@"subscribe_me_body") subject:L(@"subscribe_me_subject") toRecipient:@"subscribe@maps.me"];
[self sendEmailWithText:L(@"subscribe_me_body")
subject:L(@"subscribe_me_subject")
toRecipient:@"subscribe@maps.me"];
}
else if (cell == self.rateCell)
{
@ -86,7 +89,7 @@ extern NSString * const kAlohalyticsTapEventKey;
GetPlatform().GetReader("copyright.html")->ReadAsString(s);
NSString * text = [NSString stringWithFormat:@"%@\n%@", self.versionLabel.text, @(s.c_str())];
WebViewController * aboutViewController =
[[WebViewController alloc] initWithHtml:text baseUrl:nil andTitleOrNil:L(@"copyright")];
[[WebViewController alloc] initWithHtml:text baseUrl:nil andTitleOrNil:L(@"copyright")];
aboutViewController.openInSafari = YES;
[self.navigationController pushViewController:aboutViewController animated:YES];
}
@ -100,17 +103,23 @@ extern NSString * const kAlohalyticsTapEventKey;
vc.mailComposeDelegate = self;
[vc setSubject:subject];
[vc setMessageBody:text isHTML:NO];
[vc setToRecipients:@[email]];
[vc setToRecipients:@[ email ]];
[self presentViewController:vc animated:YES completion:nil];
}
else
{
NSString * text = [NSString stringWithFormat:L(@"email_error_body"), email];
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title") message:text delegate:nil cancelButtonTitle:L(@"ok") otherButtonTitles:nil] show];
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title")
message:text
delegate:nil
cancelButtonTitle:L(@"ok")
otherButtonTitles:nil] show];
}
}
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
- (void)mailComposeController:(MFMailComposeViewController *)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError *)error
{
[self dismissViewControllerAnimated:YES completion:nil];
}

View file

@ -1,10 +1,10 @@
#import "MWMHelpController.h"
#import "Common.h"
#import "WebViewController.h"
#import <MessageUI/MFMailComposeViewController.h>
#import "Statistics.h"
#import <sys/utsname.h>
#import "Common.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "WebViewController.h"
#import "3party/Alohalytics/src/alohalytics_objc.h"
@ -13,62 +13,62 @@
extern NSString * const kAlohalyticsTapEventKey;
extern NSString * const kLocaleUsedInSupportEmails = @"en_gb";
extern NSDictionary * const kDeviceNames = @{
@"i386" : @"Simulator",
@"iPad1,1" : @"iPad WiFi",
@"iPad1,2" : @"iPad GSM",
@"iPad2,1" : @"iPad 2 WiFi",
@"iPad2,2" : @"iPad 2 CDMA",
@"iPad2,2" : @"iPad 2 GSM",
@"iPad2,3" : @"iPad 2 GSM EV-DO",
@"iPad2,4" : @"iPad 2",
@"iPad2,5" : @"iPad Mini WiFi",
@"iPad2,6" : @"iPad Mini GSM",
@"iPad2,7" : @"iPad Mini CDMA",
@"iPad3,1" : @"iPad 3rd gen. WiFi",
@"iPad3,2" : @"iPad 3rd gen. GSM",
@"iPad3,3" : @"iPad 3rd gen. CDMA",
@"iPad3,4" : @"iPad 4th gen. WiFi",
@"iPad3,5" : @"iPad 4th gen. GSM",
@"iPad3,6" : @"iPad 4th gen. CDMA",
@"iPad4,1" : @"iPad Air WiFi",
@"iPad4,2" : @"iPad Air GSM",
@"iPad4,3" : @"iPad Air CDMA",
@"iPad4,4" : @"iPad Mini 2nd gen. WiFi",
@"iPad4,5" : @"iPad Mini 2nd gen. GSM",
@"iPad4,6" : @"iPad Mini 2nd gen. CDMA",
@"iPad5,3" : @"iPad Air 2 WiFi",
@"iPad5,4" : @"iPad Air 2 GSM",
@"iPad6,3" : @"iPad Pro (9.7 inch) WiFi",
@"iPad6,4" : @"iPad Pro (9.7 inch) GSM",
@"iPad6,7" : @"iPad Pro (12.9 inch) WiFi",
@"iPad6,8" : @"iPad Pro (12.9 inch) GSM",
@"iPhone1,1" : @"iPhone",
@"iPhone1,2" : @"iPhone 3G",
@"iPhone2,1" : @"iPhone 3GS",
@"iPhone3,1" : @"iPhone 4 GSM",
@"iPhone3,2" : @"iPhone 4 CDMA",
@"iPhone3,3" : @"iPhone 4 GSM EV-DO",
@"iPhone4,1" : @"iPhone 4S",
@"iPhone4,2" : @"iPhone 4S",
@"iPhone4,3" : @"iPhone 4S",
@"iPhone5,1" : @"iPhone 5",
@"iPhone5,2" : @"iPhone 5",
@"iPhone5,3" : @"iPhone 5c",
@"iPhone5,4" : @"iPhone 5c",
@"iPhone6,1" : @"iPhone 5s",
@"iPhone6,2" : @"iPhone 5s",
@"iPhone7,1" : @"iPhone 6 Plus",
@"iPhone7,2" : @"iPhone 6",
@"iPhone8,1" : @"iPhone 6s",
@"iPhone8,2" : @"iPhone 6s Plus",
@"iPhone8,4" : @"iPhone SE",
@"iPod1,1" : @"iPod Touch",
@"iPod2,1" : @"iPod Touch 2nd gen.",
@"iPod3,1" : @"iPod Touch 3rd gen.",
@"iPod4,1" : @"iPod Touch 4th gen.",
@"iPod5,1" : @"iPod Touch 5th gen.",
@"x86_64" : @"Simulator",
};
@"i386" : @"Simulator",
@"iPad1,1" : @"iPad WiFi",
@"iPad1,2" : @"iPad GSM",
@"iPad2,1" : @"iPad 2 WiFi",
@"iPad2,2" : @"iPad 2 CDMA",
@"iPad2,2" : @"iPad 2 GSM",
@"iPad2,3" : @"iPad 2 GSM EV-DO",
@"iPad2,4" : @"iPad 2",
@"iPad2,5" : @"iPad Mini WiFi",
@"iPad2,6" : @"iPad Mini GSM",
@"iPad2,7" : @"iPad Mini CDMA",
@"iPad3,1" : @"iPad 3rd gen. WiFi",
@"iPad3,2" : @"iPad 3rd gen. GSM",
@"iPad3,3" : @"iPad 3rd gen. CDMA",
@"iPad3,4" : @"iPad 4th gen. WiFi",
@"iPad3,5" : @"iPad 4th gen. GSM",
@"iPad3,6" : @"iPad 4th gen. CDMA",
@"iPad4,1" : @"iPad Air WiFi",
@"iPad4,2" : @"iPad Air GSM",
@"iPad4,3" : @"iPad Air CDMA",
@"iPad4,4" : @"iPad Mini 2nd gen. WiFi",
@"iPad4,5" : @"iPad Mini 2nd gen. GSM",
@"iPad4,6" : @"iPad Mini 2nd gen. CDMA",
@"iPad5,3" : @"iPad Air 2 WiFi",
@"iPad5,4" : @"iPad Air 2 GSM",
@"iPad6,3" : @"iPad Pro (9.7 inch) WiFi",
@"iPad6,4" : @"iPad Pro (9.7 inch) GSM",
@"iPad6,7" : @"iPad Pro (12.9 inch) WiFi",
@"iPad6,8" : @"iPad Pro (12.9 inch) GSM",
@"iPhone1,1" : @"iPhone",
@"iPhone1,2" : @"iPhone 3G",
@"iPhone2,1" : @"iPhone 3GS",
@"iPhone3,1" : @"iPhone 4 GSM",
@"iPhone3,2" : @"iPhone 4 CDMA",
@"iPhone3,3" : @"iPhone 4 GSM EV-DO",
@"iPhone4,1" : @"iPhone 4S",
@"iPhone4,2" : @"iPhone 4S",
@"iPhone4,3" : @"iPhone 4S",
@"iPhone5,1" : @"iPhone 5",
@"iPhone5,2" : @"iPhone 5",
@"iPhone5,3" : @"iPhone 5c",
@"iPhone5,4" : @"iPhone 5c",
@"iPhone6,1" : @"iPhone 5s",
@"iPhone6,2" : @"iPhone 5s",
@"iPhone7,1" : @"iPhone 6 Plus",
@"iPhone7,2" : @"iPhone 6",
@"iPhone8,1" : @"iPhone 6s",
@"iPhone8,2" : @"iPhone 6s Plus",
@"iPhone8,4" : @"iPhone SE",
@"iPod1,1" : @"iPod Touch",
@"iPod2,1" : @"iPod Touch 2nd gen.",
@"iPod3,1" : @"iPod Touch 3rd gen.",
@"iPod4,1" : @"iPod Touch 4th gen.",
@"iPod5,1" : @"iPod Touch 5th gen.",
@"x86_64" : @"Simulator",
};
namespace
{
@ -199,23 +199,23 @@ NSString * const kiOSEmail = @"ios@maps.me";
struct utsname systemInfo;
uname(&systemInfo);
NSString * machine =
[NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
[NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
NSString * device = kDeviceNames[machine];
if (!device)
device = machine;
NSString * languageCode = [[NSLocale preferredLanguages] firstObject];
NSString * language = [[NSLocale localeWithLocaleIdentifier:kLocaleUsedInSupportEmails]
displayNameForKey:NSLocaleLanguageCode
value:languageCode];
displayNameForKey:NSLocaleLanguageCode
value:languageCode];
NSString * locale = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
NSString * country = [[NSLocale localeWithLocaleIdentifier:kLocaleUsedInSupportEmails]
displayNameForKey:NSLocaleCountryCode
value:locale];
displayNameForKey:NSLocaleCountryCode
value:locale];
NSString * bundleVersion =
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
NSString * text = [NSString stringWithFormat:@"\n\n\n\n- %@ (%@)\n- MAPS.ME %@\n- %@/%@", device,
[UIDevice currentDevice].systemVersion,
bundleVersion, language, country];
[UIDevice currentDevice].systemVersion,
bundleVersion, language, country];
NSString * alohalyticsId = [Alohalytics installationId];
if (alohalyticsId)
text = [NSString stringWithFormat:@"%@\n- %@", text, alohalyticsId];
@ -232,18 +232,24 @@ NSString * const kiOSEmail = @"ios@maps.me";
vc.mailComposeDelegate = self;
[vc setSubject:subject];
[vc setMessageBody:text isHTML:NO];
[vc setToRecipients:@[email]];
[vc setToRecipients:@[ email ]];
[vc.navigationBar setTintColor:[UIColor whitePrimaryText]];
[self presentViewController:vc animated:YES completion:nil];
}
else
{
NSString * text = [NSString stringWithFormat:L(@"email_error_body"), email];
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title") message:text delegate:nil cancelButtonTitle:L(@"ok") otherButtonTitles:nil] show];
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title")
message:text
delegate:nil
cancelButtonTitle:L(@"ok")
otherButtonTitles:nil] show];
}
}
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
- (void)mailComposeController:(MFMailComposeViewController *)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError *)error
{
[self dismissViewControllerAnimated:YES completion:nil];
}

View file

@ -1,18 +1,18 @@
#import "MapsAppDelegate.h"
#import "MWMNightModeController.h"
#import "MWMSettings.h"
#import "MapsAppDelegate.h"
#import "SelectableCell.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "MWMSettings.h"
#include "Framework.h"
@interface MWMNightModeController ()
@property (weak, nonatomic) IBOutlet SelectableCell * autoSwitch;
@property (weak, nonatomic) IBOutlet SelectableCell * on;
@property (weak, nonatomic) IBOutlet SelectableCell * off;
@property (weak, nonatomic) SelectableCell * selectedCell;
@property(weak, nonatomic) IBOutlet SelectableCell * autoSwitch;
@property(weak, nonatomic) IBOutlet SelectableCell * on;
@property(weak, nonatomic) IBOutlet SelectableCell * off;
@property(weak, nonatomic) SelectableCell * selectedCell;
@end
@ -41,8 +41,7 @@
_selectedCell = self.off;
break;
case MapStyleMerged:
case MapStyleCount:
break;
case MapStyleCount: break;
}
}
@ -87,8 +86,7 @@
statValue = kStatValue;
}
[Statistics logEvent:kStatNightMode
withParameters:@{kStatValue : statValue}];
[Statistics logEvent:kStatNightMode withParameters:@{kStatValue : statValue}];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

View file

@ -7,14 +7,15 @@
extern char const * kStatisticsEnabledSettingsKey;
namespace {
char const * kAdForbiddenSettingsKey = "AdForbidden";
char const * kAdServerForbiddenKey = "AdServerForbidden";
char const * kAutoDownloadEnabledKey = "AutoDownloadEnabled";
char const * kZoomButtonsEnabledKey = "ZoomButtonsEnabled";
char const * kCompassCalibrationEnabledKey = "CompassCalibrationEnabled";
namespace
{
char const * kAdForbiddenSettingsKey = "AdForbidden";
char const * kAdServerForbiddenKey = "AdServerForbidden";
char const * kAutoDownloadEnabledKey = "AutoDownloadEnabled";
char const * kZoomButtonsEnabledKey = "ZoomButtonsEnabled";
char const * kCompassCalibrationEnabledKey = "CompassCalibrationEnabled";
NSString * const kUDAutoNightModeOff = @"AutoNightModeOff";
NSString * const kUDAutoNightModeOff = @"AutoNightModeOff";
} // namespace
@implementation MWMSettings

View file

@ -1,6 +1,7 @@
#import "MWMTableViewController.h"
#include "std/utility.hpp"
#include "std/string.hpp"
@interface MWMTTSSettingsViewController : MWMTableViewController

View file

@ -1,11 +1,11 @@
#import "MWMTTSSettingsViewController.h"
#import <AVFoundation/AVFoundation.h>
#import "LinkCell.h"
#import "MWMTextToSpeech.h"
#import "MWMTTSSettingsViewController.h"
#import "SelectableCell.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "WebViewController.h"
#import <AVFoundation/AVFoundation.h>
#include "LocaleTranslator.h"
@ -19,7 +19,7 @@ using namespace locale_translator;
vector<pair<string, string>> _languages;
}
@property (nonatomic) BOOL isLocaleLanguageAbsent;
@property(nonatomic) BOOL isLocaleLanguageAbsent;
@end
@ -73,21 +73,15 @@ using namespace locale_translator;
}
switch (size)
{
case 1:
_languages.push_back(_additionalTTSLanguage);
break;
case 2:
if (self.isLocaleLanguageAbsent)
_languages[size - 1] = _additionalTTSLanguage;
else
_languages.push_back(_additionalTTSLanguage);
break;
case 3:
case 1: _languages.push_back(_additionalTTSLanguage); break;
case 2:
if (self.isLocaleLanguageAbsent)
_languages[size - 1] = _additionalTTSLanguage;
break;
default:
NSAssert(false, @"Incorrect language's count");
break;
else
_languages.push_back(_additionalTTSLanguage);
break;
case 3: _languages[size - 1] = _additionalTTSLanguage; break;
default: NSAssert(false, @"Incorrect language's count"); break;
}
[self.tableView reloadData];
}
@ -100,11 +94,7 @@ using namespace locale_translator;
#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2; }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 0)
@ -113,7 +103,8 @@ using namespace locale_translator;
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
@ -130,24 +121,30 @@ using namespace locale_translator;
NSInteger const row = indexPath.row - 1;
if (row == _languages.size())
{
LinkCell * cell = (LinkCell *)[tableView dequeueReusableCellWithIdentifier:[LinkCell className]];
LinkCell * cell =
(LinkCell *)[tableView dequeueReusableCellWithIdentifier:[LinkCell className]];
cell.titleLabel.text = L(@"pref_tts_other_section_title");
return cell;
}
else
{
SelectableCell * cell = (SelectableCell *)[tableView dequeueReusableCellWithIdentifier:[SelectableCell className]];
SelectableCell * cell = (SelectableCell *)[tableView
dequeueReusableCellWithIdentifier:[SelectableCell className]];
pair<string, string> const p = _languages[row];
cell.titleLabel.text = @(p.second.c_str());
BOOL const isSelected = [@(p.first.c_str()) isEqualToString:[MWMTextToSpeech savedLanguage]];
cell.accessoryType = [MWMTextToSpeech isTTSEnabled] && isSelected ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
BOOL const isSelected =
[@(p.first.c_str()) isEqualToString:[MWMTextToSpeech savedLanguage]];
cell.accessoryType = [MWMTextToSpeech isTTSEnabled] && isSelected
? UITableViewCellAccessoryCheckmark
: UITableViewCellAccessoryNone;
return cell;
}
}
}
else
{
LinkCell * cell = (LinkCell *)[tableView dequeueReusableCellWithIdentifier:[LinkCell className]];
LinkCell * cell =
(LinkCell *)[tableView dequeueReusableCellWithIdentifier:[LinkCell className]];
cell.titleLabel.text = L(@"pref_tts_how_to_set_up_voice");
return cell;
}
@ -162,7 +159,8 @@ using namespace locale_translator;
[Statistics logEvent:kStatEventName(kStatSettings, kStatTTS)
withParameters:@{kStatValue : kStatOff}];
[MWMTextToSpeech setTTSEnabled:NO];
[tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
[tableView reloadSections:[NSIndexSet indexSetWithIndex:0]
withRowAnimation:UITableViewRowAnimationFade];
}
else
{
@ -179,17 +177,23 @@ using namespace locale_translator;
else
{
[[MWMTextToSpeech tts] setNotificationsLocale:@(_languages[row].first.c_str())];
[tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
[tableView reloadSections:[NSIndexSet indexSetWithIndex:0]
withRowAnimation:UITableViewRowAnimationFade];
}
}
}
else if (indexPath.section == 1)
{
[Statistics logEvent:kStatEventName(kStatTTSSettings, kStatHelp)];
NSString * path = [[NSBundle mainBundle] pathForResource:@"tts-how-to-set-up-voice" ofType:@"html"];
NSString * html = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
NSString * path =
[[NSBundle mainBundle] pathForResource:@"tts-how-to-set-up-voice" ofType:@"html"];
NSString * html =
[[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
NSURL * baseURL = [NSURL fileURLWithPath:path];
WebViewController * vc = [[WebViewController alloc] initWithHtml:html baseUrl:baseURL andTitleOrNil:L(@"pref_tts_how_to_set_up_voice")];
WebViewController * vc =
[[WebViewController alloc] initWithHtml:html
baseUrl:baseURL
andTitleOrNil:L(@"pref_tts_how_to_set_up_voice")];
[self.navigationController pushViewController:vc animated:YES];
}
}

View file

@ -78,7 +78,7 @@
<rect key="frame" x="0.0" y="99" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="yh8-cr-14c" id="MYm-HI-oOR">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Профиль" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="483" translatesAutoresizingMaskIntoConstraints="NO" id="8jb-wX-P4h">
@ -129,7 +129,7 @@
<rect key="frame" x="0.0" y="185" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Igk-BI-aHN" id="Qae-gb-v0B">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Единицы измерения" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="483" translatesAutoresizingMaskIntoConstraints="NO" id="RB1-Nr-K3T">
@ -176,7 +176,7 @@
<rect key="frame" x="0.0" y="229" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="LYi-oF-eGj" id="6SA-kx-JeG">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Кнопки масштаба" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" preferredMaxLayoutWidth="462" translatesAutoresizingMaskIntoConstraints="NO" id="OM9-RZ-sca">
@ -221,7 +221,7 @@
<rect key="frame" x="0.0" y="273" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0Lf-xU-P2U" id="3Q1-iE-5pP">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3D здания" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" preferredMaxLayoutWidth="462" translatesAutoresizingMaskIntoConstraints="NO" id="tU0-tQ-usy">
@ -266,7 +266,7 @@
<rect key="frame" x="0.0" y="317" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="eE4-OC-9uX" id="xJx-2K-AIP">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Автозагрузка" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" preferredMaxLayoutWidth="462" translatesAutoresizingMaskIntoConstraints="NO" id="6ZU-5V-v0J">
@ -311,7 +311,7 @@
<rect key="frame" x="0.0" y="361" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="VyW-Wh-2QX" id="ihq-PO-ic8">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Недавно пройденый путь" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="483" translatesAutoresizingMaskIntoConstraints="NO" id="3ew-eh-kVT">
@ -358,7 +358,7 @@
<rect key="frame" x="0.0" y="405" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="P5e-67-f4k" id="RlB-hW-A2l">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Калибровка компаса" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" preferredMaxLayoutWidth="462" translatesAutoresizingMaskIntoConstraints="NO" id="Xqo-QZ-3fd">
@ -403,7 +403,7 @@
<rect key="frame" x="0.0" y="449" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="NOt-bc-7ls" id="xdj-y5-zpk">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Сбор статистики" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" preferredMaxLayoutWidth="462" translatesAutoresizingMaskIntoConstraints="NO" id="K9e-I1-pZu">
@ -449,10 +449,10 @@
<tableViewSection headerTitle="НАВИГАЦИЯ" id="E4E-hs-9xW">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="LinkCell" id="QNt-XC-xma" customClass="LinkCell">
<rect key="frame" x="0.0" y="559" width="600" height="44"/>
<rect key="frame" x="0.0" y="560" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="QNt-XC-xma" id="fBV-aJ-Mo8">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Ночной режим" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="483" translatesAutoresizingMaskIntoConstraints="NO" id="q7P-cj-3tZ">
@ -496,10 +496,10 @@
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="SwitchCell" id="X5R-fv-yd7" customClass="SwitchCell">
<rect key="frame" x="0.0" y="603" width="600" height="44"/>
<rect key="frame" x="0.0" y="604" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="X5R-fv-yd7" id="s7y-Nu-Y01">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Перспективный вид" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" preferredMaxLayoutWidth="462" translatesAutoresizingMaskIntoConstraints="NO" id="tmn-CU-6EB">
@ -541,10 +541,10 @@
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="SwitchCell" id="veW-Fm-2Hl" customClass="SwitchCell">
<rect key="frame" x="0.0" y="647" width="600" height="44"/>
<rect key="frame" x="0.0" y="648" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="veW-Fm-2Hl" id="AP7-jd-F4b">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Автозум" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" preferredMaxLayoutWidth="462" translatesAutoresizingMaskIntoConstraints="NO" id="qL3-bA-5tn">
@ -586,10 +586,10 @@
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="LinkCell" id="nED-2n-gN6" customClass="LinkCell">
<rect key="frame" x="0.0" y="691" width="600" height="44"/>
<rect key="frame" x="0.0" y="692" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="nED-2n-gN6" id="2oQ-0g-poj">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Голосовые инструкции" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="185" translatesAutoresizingMaskIntoConstraints="NO" id="2v2-mU-aWi">
@ -637,10 +637,10 @@
<tableViewSection headerTitle="ИНФОРМАЦИЯ" id="i4H-WV-BaS">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="LinkCell" id="JTZ-K9-RVv" customClass="LinkCell">
<rect key="frame" x="0.0" y="777" width="600" height="44"/>
<rect key="frame" x="0.0" y="778" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="JTZ-K9-RVv" id="mHA-wn-hse">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Спавочный центр" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="535" translatesAutoresizingMaskIntoConstraints="NO" id="7ty-Jh-0Rp">
@ -670,10 +670,10 @@
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="LinkCell" id="Kv3-pO-jV5" customClass="LinkCell">
<rect key="frame" x="0.0" y="821" width="600" height="44"/>
<rect key="frame" x="0.0" y="822" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Kv3-pO-jV5" id="8mJ-wm-9uJ">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="О приложении" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="535" translatesAutoresizingMaskIntoConstraints="NO" id="cS1-Lw-pFx">
@ -755,7 +755,7 @@
<rect key="frame" x="0.0" y="35" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Hgm-jL-Gnn" id="LeE-yP-Eoi">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Auto" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="sHx-XL-o9h">
@ -788,7 +788,7 @@
<rect key="frame" x="0.0" y="79" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WyO-qs-a7i" id="q2k-AU-VdG">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="On" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="um4-D2-sR5">
@ -821,7 +821,7 @@
<rect key="frame" x="0.0" y="123" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="HHw-BT-UeJ" id="WD5-kW-BlC">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Off" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="abU-K0-dr3">
@ -883,7 +883,7 @@
<rect key="frame" x="0.0" y="35" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="HL5-jQ-yNK" id="DYw-KH-oDU">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="None" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="2i3-c9-tdU">
@ -916,7 +916,7 @@
<rect key="frame" x="0.0" y="79" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8Cq-dm-roX" id="62b-vT-xng">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1 hour" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="J1O-iW-GF3">
@ -949,7 +949,7 @@
<rect key="frame" x="0.0" y="123" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="DIL-q2-mUp" id="IqW-Xu-xVP">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 hours" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="55i-C3-b9S">
@ -982,7 +982,7 @@
<rect key="frame" x="0.0" y="167" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="1Mm-WA-eyt" id="lNb-wL-PFo">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="6 hours" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="QrP-xT-fcM">
@ -1015,7 +1015,7 @@
<rect key="frame" x="0.0" y="211" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="JLY-Qt-y88" id="jPr-Kt-mLi">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12 hours" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="HyC-if-zpD">
@ -1048,7 +1048,7 @@
<rect key="frame" x="0.0" y="255" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="mbv-1J-wSI" id="oPS-HW-hfW">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1 day" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="uhN-0k-BL7">
@ -1108,10 +1108,10 @@
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="checkmark" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="SelectableCell" id="79I-kz-hl4" customClass="SelectableCell">
<rect key="frame" x="0.0" y="49" width="600" height="44"/>
<rect key="frame" x="0.0" y="50" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="79I-kz-hl4" id="gBB-ji-big">
<rect key="frame" x="0.0" y="0.0" width="561" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="561" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Русский" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="FSn-fP-n3e">
@ -1140,10 +1140,10 @@
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="LinkCell" id="lO6-zb-qb8" customClass="LinkCell">
<rect key="frame" x="0.0" y="93" width="600" height="44"/>
<rect key="frame" x="0.0" y="94" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="lO6-zb-qb8" id="35k-Nb-XSD">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Other" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="483" translatesAutoresizingMaskIntoConstraints="NO" id="arm-Sx-diY">
@ -1233,10 +1233,10 @@
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="SelectableCell" id="6Px-TO-sMc" customClass="SelectableCell">
<rect key="frame" x="0.0" y="49" width="600" height="44"/>
<rect key="frame" x="0.0" y="50" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="6Px-TO-sMc" id="aqp-aV-B3y">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Русский" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="516" translatesAutoresizingMaskIntoConstraints="NO" id="wBg-nH-SXL">
@ -3165,7 +3165,7 @@
<rect key="frame" x="0.0" y="35" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="233-Ku-OFh" id="Tig-SC-0oN">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Километры" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="m0T-TK-aex">
@ -3195,7 +3195,7 @@
<rect key="frame" x="0.0" y="79" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="XGu-p4-IVy" id="c5A-yh-Pec">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Мили" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="xrt-1n-szu">
@ -3308,7 +3308,7 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="288"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="NuJ-GM-bcI" id="qiT-1S-zCI">
<rect key="frame" x="0.0" y="0.0" width="600" height="287"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="288"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="imgLogo" translatesAutoresizingMaskIntoConstraints="NO" id="Zod-2W-e52">
@ -3371,7 +3371,7 @@
<rect key="frame" x="0.0" y="288" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WfS-iR-EYh" id="pud-iP-cPv">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Веб-сайт" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="dRQ-jj-BMn">
@ -3401,7 +3401,7 @@
<rect key="frame" x="0.0" y="332" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="orf-4x-6qF" id="HLu-xY-s47">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Блог" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="Usf-eP-UhD">
@ -3431,7 +3431,7 @@
<rect key="frame" x="0.0" y="376" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="AwY-rw-AMm" id="AUp-Ql-usV">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Facebook" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="VRr-XH-vvX">
@ -3461,7 +3461,7 @@
<rect key="frame" x="0.0" y="420" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="PYl-5B-hBB" id="99g-g6-dgY">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Twitter" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="snB-CD-ffn">
@ -3491,7 +3491,7 @@
<rect key="frame" x="0.0" y="464" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="q9S-xP-Mmy" id="itl-Sl-h7g">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Подписаться на новости" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="1mC-fY-VIc">
@ -3522,7 +3522,7 @@
<rect key="frame" x="0.0" y="508" width="600" height="36"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ad4-no-N8I" id="oY2-Un-E4E">
<rect key="frame" x="0.0" y="0.0" width="600" height="35"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="36"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCellContentView>
@ -3537,7 +3537,7 @@
<rect key="frame" x="0.0" y="544" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="jhU-Ha-kE2" id="BJb-8F-OEp">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Оценить приложение" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="Spi-mD-g8U">
@ -3568,7 +3568,7 @@
<rect key="frame" x="0.0" y="588" width="600" height="36"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="fLn-sP-Mk4" id="cld-GE-cEX">
<rect key="frame" x="0.0" y="0.0" width="600" height="35"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="36"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCellContentView>
@ -3583,7 +3583,7 @@
<rect key="frame" x="0.0" y="624" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="VXa-CM-OXP" id="Vot-vJ-3MU">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="477" translatesAutoresizingMaskIntoConstraints="NO" id="uhV-at-6HM">
@ -3614,7 +3614,7 @@
<rect key="frame" x="0.0" y="668" width="600" height="36"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="R7v-I1-M6P" id="MVJ-em-dnd">
<rect key="frame" x="0.0" y="0.0" width="600" height="35"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="36"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCellContentView>

View file

@ -2,7 +2,7 @@
@interface LinkCell : MWMTableViewCell
@property (nonatomic) IBOutlet UILabel * titleLabel;
@property (nonatomic) IBOutlet UILabel * infoLabel;
@property(nonatomic) IBOutlet UILabel * titleLabel;
@property(nonatomic) IBOutlet UILabel * infoLabel;
@end

View file

@ -1,11 +1,11 @@
#import "MWMSettingsViewController.h"
#import "LinkCell.h"
#import "SwitchCell.h"
#import "LocaleTranslator.h"
#import "MWMAuthorizationCommon.h"
#import "MWMSettings.h"
#import "MWMTextToSpeech.h"
#import "LocaleTranslator.h"
#import "Statistics.h"
#import "SwitchCell.h"
#import "WebViewController.h"
#import "3party/Alohalytics/src/alohalytics_objc.h"
@ -16,25 +16,25 @@
extern NSString * const kAlohalyticsTapEventKey;
@interface MWMSettingsViewController () <SwitchCellDelegate>
@interface MWMSettingsViewController ()<SwitchCellDelegate>
@property (weak, nonatomic) IBOutlet LinkCell * profileCell;
@property(weak, nonatomic) IBOutlet LinkCell * profileCell;
@property (weak, nonatomic) IBOutlet LinkCell * unitsCell;
@property (weak, nonatomic) IBOutlet SwitchCell * zoomButtonsCell;
@property (weak, nonatomic) IBOutlet SwitchCell * is3dCell;
@property (weak, nonatomic) IBOutlet SwitchCell * autoDownloadCell;
@property (weak, nonatomic) IBOutlet LinkCell * recentTrackCell;
@property (weak, nonatomic) IBOutlet SwitchCell * compassCalibrationCell;
@property (weak, nonatomic) IBOutlet SwitchCell * statisticsCell;
@property(weak, nonatomic) IBOutlet LinkCell * unitsCell;
@property(weak, nonatomic) IBOutlet SwitchCell * zoomButtonsCell;
@property(weak, nonatomic) IBOutlet SwitchCell * is3dCell;
@property(weak, nonatomic) IBOutlet SwitchCell * autoDownloadCell;
@property(weak, nonatomic) IBOutlet LinkCell * recentTrackCell;
@property(weak, nonatomic) IBOutlet SwitchCell * compassCalibrationCell;
@property(weak, nonatomic) IBOutlet SwitchCell * statisticsCell;
@property (weak, nonatomic) IBOutlet LinkCell * nightModeCell;
@property (weak, nonatomic) IBOutlet SwitchCell * perspectiveViewCell;
@property (weak, nonatomic) IBOutlet SwitchCell * autoZoomCell;
@property (weak, nonatomic) IBOutlet LinkCell * voiceInstructionsCell;
@property(weak, nonatomic) IBOutlet LinkCell * nightModeCell;
@property(weak, nonatomic) IBOutlet SwitchCell * perspectiveViewCell;
@property(weak, nonatomic) IBOutlet SwitchCell * autoZoomCell;
@property(weak, nonatomic) IBOutlet LinkCell * voiceInstructionsCell;
@property (weak, nonatomic) IBOutlet LinkCell * helpCell;
@property (weak, nonatomic) IBOutlet LinkCell * aboutCell;
@property(weak, nonatomic) IBOutlet LinkCell * helpCell;
@property(weak, nonatomic) IBOutlet LinkCell * aboutCell;
@end
@ -63,19 +63,14 @@ extern NSString * const kAlohalyticsTapEventKey;
{
NSString * userName = osm_auth_ios::OSMUserName();
self.profileCell.infoLabel.text = userName.length != 0 ? userName : @"";
}
- (void)configCommonSection
{
switch ([MWMSettings measurementUnits])
{
case measurement_utils::Units::Metric:
self.unitsCell.infoLabel.text = L(@"kilometres");
break;
case measurement_utils::Units::Imperial:
self.unitsCell.infoLabel.text = L(@"miles");
break;
case measurement_utils::Units::Metric: self.unitsCell.infoLabel.text = L(@"kilometres"); break;
case measurement_utils::Units::Imperial: self.unitsCell.infoLabel.text = L(@"miles"); break;
}
self.zoomButtonsCell.switchButton.on = [MWMSettings zoomButtonsEnabled];
@ -97,12 +92,12 @@ extern NSString * const kAlohalyticsTapEventKey;
{
switch (GpsTracker::Instance().GetDuration().count())
{
case 1: self.recentTrackCell.infoLabel.text = L(@"duration_1_hour"); break;
case 2: self.recentTrackCell.infoLabel.text = L(@"duration_2_hours"); break;
case 6: self.recentTrackCell.infoLabel.text = L(@"duration_6_hours"); break;
case 12: self.recentTrackCell.infoLabel.text = L(@"duration_12_hours"); break;
case 24: self.recentTrackCell.infoLabel.text = L(@"duration_1_day"); break;
default: NSAssert(false, @"Incorrect hours value"); break;
case 1: self.recentTrackCell.infoLabel.text = L(@"duration_1_hour"); break;
case 2: self.recentTrackCell.infoLabel.text = L(@"duration_2_hours"); break;
case 6: self.recentTrackCell.infoLabel.text = L(@"duration_6_hours"); break;
case 12: self.recentTrackCell.infoLabel.text = L(@"duration_12_hours"); break;
case 24: self.recentTrackCell.infoLabel.text = L(@"duration_1_day"); break;
default: NSAssert(false, @"Incorrect hours value"); break;
}
}
@ -123,8 +118,8 @@ extern NSString * const kAlohalyticsTapEventKey;
{
switch (GetFramework().GetMapStyle())
{
case MapStyleDark: self.nightModeCell.infoLabel.text = L(@"pref_map_style_night"); break;
default: self.nightModeCell.infoLabel.text = L(@"pref_map_style_default"); break;
case MapStyleDark: self.nightModeCell.infoLabel.text = L(@"pref_map_style_night"); break;
default: self.nightModeCell.infoLabel.text = L(@"pref_map_style_default"); break;
}
}
@ -192,7 +187,10 @@ extern NSString * const kAlohalyticsTapEventKey;
else if (cell == self.statisticsCell)
{
[Statistics logEvent:kStatEventName(kStatSettings, kStatToggleStatistics)
withParameters: @{kStatAction : kStatToggleStatistics, kStatValue : (value ? kStatOn : kStatOff)}];
withParameters:@{
kStatAction : kStatToggleStatistics,
kStatValue : (value ? kStatOn : kStatOff)
}];
if (value)
[[Statistics instance] enableOnNextAppLaunch];
else
@ -272,10 +270,10 @@ extern NSString * const kAlohalyticsTapEventKey;
{
switch (section)
{
case 1: return L(@"general_settings");
case 2: return L(@"prefs_group_route");
case 3: return L(@"info");
default: return nil;
case 1: return L(@"general_settings");
case 2: return L(@"prefs_group_route");
case 3: return L(@"info");
default: return nil;
}
}
@ -283,8 +281,8 @@ extern NSString * const kAlohalyticsTapEventKey;
{
switch (section)
{
case 1: return L(@"allow_statistics_hint");
default: return nil;
case 1: return L(@"allow_statistics_hint");
default: return nil;
}
}

View file

@ -5,11 +5,11 @@
+ (instancetype)sharedInfo;
- (instancetype)init __attribute__((unavailable("init is not available")));
@property (nonatomic, readonly) NSString * countryCode;
@property (nonatomic, readonly) NSString * uniqueId;
@property (nonatomic, readonly) NSString * bundleVersion;
@property (nonatomic, readonly) NSUUID * advertisingId;
@property (nonatomic, readonly) NSString * languageId;
@property (nonatomic, readonly) NSDate * buildDate;
@property(nonatomic, readonly) NSString * countryCode;
@property(nonatomic, readonly) NSString * uniqueId;
@property(nonatomic, readonly) NSString * bundleVersion;
@property(nonatomic, readonly) NSUUID * advertisingId;
@property(nonatomic, readonly) NSString * languageId;
@property(nonatomic, readonly) NSDate * buildDate;
@end

View file

@ -1,8 +1,8 @@
#import "AppInfo.h"
#import <AdSupport/ASIdentifierManager.h>
#import <CoreTelephony/CTCarrier.h>
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <sys/utsname.h>
#import <AdSupport/ASIdentifierManager.h>
#include "platform/settings.hpp"
@ -10,15 +10,14 @@ extern string const kCountryCodeKey = "CountryCode";
extern string const kUniqueIdKey = "UniqueId";
extern string const kLanguageKey = "Language";
@interface AppInfo ()
@interface AppInfo()
@property (nonatomic) NSString * countryCode;
@property (nonatomic) NSString * uniqueId;
@property (nonatomic) NSString * bundleVersion;
@property (nonatomic) NSString * deviceInfo;
@property (nonatomic) NSUUID * advertisingId;
@property (nonatomic) NSDate * buildDate;
@property(nonatomic) NSString * countryCode;
@property(nonatomic) NSString * uniqueId;
@property(nonatomic) NSString * bundleVersion;
@property(nonatomic) NSString * deviceInfo;
@property(nonatomic) NSUUID * advertisingId;
@property(nonatomic) NSDate * buildDate;
@end
@ -28,8 +27,7 @@ extern string const kLanguageKey = "Language";
{
static AppInfo * appInfo;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^
{
dispatch_once(&onceToken, ^{
appInfo = [[self alloc] init];
});
return appInfo;
@ -49,23 +47,26 @@ extern string const kLanguageKey = "Language";
{
CTTelephonyNetworkInfo * networkInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier * carrier = networkInfo.subscriberCellularProvider;
if ([carrier.isoCountryCode length]) // if device can access sim card info
if ([carrier.isoCountryCode length]) // if device can access sim card info
_countryCode = [carrier.isoCountryCode uppercaseString];
else // else, getting system country code
else // else, getting system country code
_countryCode = [[[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] uppercaseString];
std::string codeString;
if (settings::Get(kCountryCodeKey, codeString)) // if country code stored in settings
if (settings::Get(kCountryCodeKey, codeString)) // if country code stored in settings
{
if (carrier.isoCountryCode) // if device can access sim card info
settings::Set(kCountryCodeKey, std::string([_countryCode UTF8String])); // then save new code instead
if (carrier.isoCountryCode) // if device can access sim card info
settings::Set(kCountryCodeKey,
std::string([_countryCode UTF8String])); // then save new code instead
else
_countryCode = @(codeString.c_str()); // if device can NOT access sim card info then using saved code
_countryCode =
@(codeString.c_str()); // if device can NOT access sim card info then using saved code
}
else
{
if (_countryCode)
settings::Set(kCountryCodeKey, std::string([_countryCode UTF8String])); // saving code first time
settings::Set(kCountryCodeKey,
std::string([_countryCode UTF8String])); // saving code first time
else
_countryCode = @"";
}
@ -78,14 +79,14 @@ extern string const kLanguageKey = "Language";
if (!_uniqueId)
{
string uniqueString;
if (settings::Get(kUniqueIdKey, uniqueString)) // if id stored in settings
if (settings::Get(kUniqueIdKey, uniqueString)) // if id stored in settings
{
_uniqueId = @(uniqueString.c_str());
}
else // if id not stored in settings
else // if id not stored in settings
{
_uniqueId = [[UIDevice currentDevice].identifierForVendor UUIDString];
if (_uniqueId) // then saving in settings
if (_uniqueId) // then saving in settings
settings::Set(kUniqueIdKey, std::string([_uniqueId UTF8String]));
}
}
@ -121,8 +122,8 @@ extern string const kLanguageKey = "Language";
if (!_buildDate)
{
NSString * dateStr =
[NSString stringWithFormat:@"%@ %@", [NSString stringWithUTF8String:__DATE__],
[NSString stringWithUTF8String:__TIME__]];
[NSString stringWithFormat:@"%@ %@", [NSString stringWithUTF8String:__DATE__],
[NSString stringWithUTF8String:__TIME__]];
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"LLL d yyyy HH:mm:ss"];