forked from organicmaps/organicmaps
commit
48e3f770bd
3 changed files with 9 additions and 2 deletions
|
@ -415,8 +415,8 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction)
|
|||
|
||||
- (void)refresh
|
||||
{
|
||||
// [super refresh];
|
||||
[MapsAppDelegate customizeAppearance];
|
||||
[self.navigationController.navigationBar refresh];
|
||||
[self.controlsManager refresh];
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -73,6 +73,11 @@
|
|||
{
|
||||
[MapsAppDelegate setAutoNightModeOn:YES];
|
||||
[MapsAppDelegate changeMapStyleIfNedeed];
|
||||
if (style == MapStyleClear || style == MapStyleLight)
|
||||
return;
|
||||
[UIColor setNightMode:NO];
|
||||
f.SetMapStyle(MapStyleClear);
|
||||
[self refresh];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue