Merge pull request #1426 from VladiMihaylenko/vm-master

Vm master
This commit is contained in:
igrechuhin 2016-01-15 18:38:32 +03:00
commit 48e3f770bd
3 changed files with 9 additions and 2 deletions

View file

@ -415,8 +415,8 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction)
- (void)refresh
{
// [super refresh];
[MapsAppDelegate customizeAppearance];
[self.navigationController.navigationBar refresh];
[self.controlsManager refresh];
}

View file

@ -260,6 +260,8 @@ void InitLocalizedStrings()
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
[ud setBool:on forKey:kUDAutoNightMode];
[ud synchronize];
if (!on)
[MapsAppDelegate.theApp stopMapStyleChecker];
}
+ (BOOL)isAutoNightMode
@ -270,7 +272,7 @@ void InitLocalizedStrings()
- (void)startMapStyleChecker
{
NSAssert([MapsAppDelegate isAutoNightMode], @"Invalid auto switcher's state");
self.mapStyleSwitchTimer = [NSTimer scheduledTimerWithTimeInterval:(1 * 60) target:[MapsAppDelegate class]
self.mapStyleSwitchTimer = [NSTimer scheduledTimerWithTimeInterval:(30 * 60) target:[MapsAppDelegate class]
selector:@selector(changeMapStyleIfNedeed) userInfo:nil
repeats:YES];
}

View file

@ -73,6 +73,11 @@
{
[MapsAppDelegate setAutoNightModeOn:YES];
[MapsAppDelegate changeMapStyleIfNedeed];
if (style == MapStyleClear || style == MapStyleLight)
return;
[UIColor setNightMode:NO];
f.SetMapStyle(MapStyleClear);
[self refresh];
}
}