[Feature Request] Enabling Night Mode based on Time
TheCatCoder opened this issue · 0 comments
TheCatCoder commented
Because IOS 9 already has nightshift, I think that the biggest feature that sells this app is the night mode. I use every night. How hard would it be to add a toggle for activating/deactivating night mode based on the time of day (or night rather)? I looked at the code myself and it's very confusing knowing what to add, since I'm not at all familiar with objective C.
I was thinking of maybe pasting the night mode activation code that I've pasted below into whatever function turns on the "Low Temperature Bedtime Mode", but I don't know if that's really a plausible solution or not.
- (IBAction)darkroomButtonClicked {
BOOL darkroomEnabled = [groupDefaults boolForKey:@"darkroomEnabled"];
if (darkroomEnabled){
[groupDefaults setBool:NO forKey:@"enabled"];
[groupDefaults setBool:NO forKey:@"dimEnabled"];
[groupDefaults setBool:NO forKey:@"darkroomEnabled"];
[groupDefaults setBool:NO forKey:@"rgbEnabled"];
[groupDefaults setBool:NO forKey:@"whitePointEnabled"];
[groupDefaults setBool:NO forKey:@"manualOverride"];
[GammaController setDarkroomEnabled:NO];
[NSThread sleepForTimeInterval:0.1];
[GammaController autoChangeOrangenessIfNeededWithTransition:YES];
}
else{
[GammaController setDarkroomEnabled:YES];
[groupDefaults setBool:NO forKey:@"enabled"];
[groupDefaults setBool:NO forKey:@"dimEnabled"];
[groupDefaults setBool:NO forKey:@"rgbEnabled"];
[groupDefaults setBool:NO forKey:@"whitePointEnabled"];
[groupDefaults setBool:YES forKey:@"darkroomEnabled"];
[groupDefaults setBool:YES forKey:@"manualOverride"];
}
[self updateUI];
}