![]() |
||
---|---|---|
app | ||
art | ||
gradle/wrapper | ||
.gitignore | ||
.travis.yml | ||
COPYING | ||
COPYING.GPL | ||
COPYING.MIT | ||
LICENSE.spdx | ||
README.md | ||
build.gradle | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
settings.gradle |
README.md

Red Moon 
Blue light can suppress the production of melatonin, the sleep hormone. Red Moon filters out blue light and dims your screen below the normal minimum, so you can use your phone comfortably at night. It is simple and flexible:
- Set the timer to automatically turn on at night, or at custom times.
- Use the default filters, or fine-tune your own with separate color, intensity and dim levels.
- The notification, tile (Android 7.0+), and widget let you start, stop, and switch filters without opening the app.
Get involved
All help is equally welcome!
The easiest way is to report bugs and give feedback in an issue or the #redmoon chat room on irc (freenode) or matrix.
Weblate is the simplest way for most people to translate. It's entirely in your browser, and your changes will be automatically merged. If you'd prefer to make a pull request, please keep code and translations in separate PRs.
Most strings will only be used in one place.
This way, if you want to tweak the phrasing in one particular place, you don't need to worry about accidentally changing another place in the app.
PRs for issues tagged with bug
or patches welcome
are welcome at any time.
Otherwise, please open a new issue or comment on the existing one first. We don't
want to waste your time on something we might not merge! We have some loose coding
style guidelines below.
Screenshots
Building
To build the app on GNU+Linux, clone the repository and run
./gradlew build
in the root directory.
To install the app on a connected device or running emulator, run
./gradlew installFdroidDebug
or ./gradlew installPlaystoreDebug
Coding Style
Prioritize legibility over dogmatism. That said, consistency is nice, so here's a short list of what I've been doing.
- 100 characters per line; 80 if you can.
- Indent 4 spaces normally; 8 spaces if a variable assignment needs to wrap.
- Constants use
ALL_CAPS
, persistent vars usemCamelCase
, everything else usescamelCase
. - Form suggests function: Group and align similar actions, and don't do that for dissimmilar ones, even if you could.
- Good comments explain why something is done; if you find yourself describing what the code does, consider:
- Refactoring into smaller functions with descriptive names
- Converting comments to logs. Code that requires comments probably also requires good logs to debug.
- Always use brackets with
if
, with one exception: one-liners with anelse
branch (x = if (p) q else r
)- note: I (@smichel17) used to prefer omitting parenthesis from one-liners; some code still uses that style.
Again, prioritize legibility over dogmatism.
License
"Red Moon" is a derivative of "Shades" by Chris Nguyen used under the MIT License. "Red Moon" is licensed under the GNU General Public License version 3, or (at your option) any later version by the contributors.
All used artwork is released into the public domain. Some of the icons use cliparts from openclipart.org, which are all released in the public domain, namely:
- https://openclipart.org/detail/121903/full-moon
- https://openclipart.org/detail/219211/option-button-symbol-minimal-svg-markup
- https://openclipart.org/detail/20806/wolf-head-howl-1
- https://openclipart.org/detail/213998/nexus-5-flat
- https://openclipart.org/detail/192689/press-button
* Google Play and the Google Play logo are trademarks of Google Inc.