LibreShift / red-moon

Android screen filter app for night time phone use.
GNU General Public License v3.0
642 stars 80 forks source link

Add civil, nautical and astronomical dawn/dusk times to auto-enable filter #280

Open Totorrr opened 3 years ago

Totorrr commented 3 years ago

I would like to be able to use civil, nautical or astronomical dawn/dusk times, and not only sunrise/sunset times, to disable/enable the Red Moon filter.

Especially because the transition is not progressive at the moment, it would be particularly interesting to keep the screen unfiltered up to the nautical dusk ("sunset") time for example. Because natural light is usually still strong right after sunset. This is even more the case as your are close to a pole during your hemisphere's summer solstice.

Another option would be progressive transitioning, as described in #33. But it may be more complicated to implement. Sometimes, it is just more practical to make better rather than make best. :)

smichel17 commented 3 years ago

I would implement this as an additional setting, "Sunset type" with options civil/nautical/astronomical — although maybe there are other words that a layperson is more likely to understand that could be used instead.

I would be inclined to remove this setting if a gradual transition (#33), but since this is indeed easier to implement, I would accept a PR adding it. Probably these are the only lines of kotlin you'd need to touch (plus the xml to add the setting, of course)

https://github.com/LibreShift/red-moon/blob/a59dcef9a143f72f867efc5eee64fe48616f9513/app/src/main/java/com/jmstudios/redmoon/model/Config.kt#L166-L190