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

Red Moon 
Red Moon is a simple screen filter app for night time phone use. It helps you sleep healthier by filtering out blue light, which can disrupt your sleep cycle (circadian rhythm). And when your phone's lowest brightness isn't low enough, Red Moon protects your eyes by making your screen even darker.
Features
- Use the default filters or create your own, with separate color, intensity and dim settings.
- Automatically turn Red Moon on while the sun is down, or set custom times.
- Switch between filters right in the notification, without leaving the app you're using.
- Turn Red Moon on and off without opening the app using:
- A widget or a shortcut on your home screen.
- A quick settings tile, like WiFi or Airplane mode (Android 7.0+).
- The notification (if Red Moon is on, or was recently on).
Screenshots
All help is welcome! Code is great and saves us work, but sometimes a comment that clarifies a design issue or a link to the relevant part of some documentation is just as helpful (and often more efficient, since you don't need to familiarize yourself with Red Moon's code base).
Bugs, feedback, and ideas
Issues are tagged with feedback wanted
, needs design
,
can't replicate
, or needs information
(this one's usually technical)
based on what needs to be done next. There are also tags about priorities:
planned
: The most important issues.help wanted
: These would beplanned
, but there's a question or problem that we're stuck on. We'd love help getting un-stuck!someday/maybe
: Worth adding, but not that important.
Translations
Weblate is the easiest way for most people. You can work in your browser instead of crawling through text files, and your translations will be automatically be merged into this repository. If you'd prefer to make a pull request, that's fine too, but if you're also changing code, please keep that in a separate PR.
Trust your judgement! If there is a loose translation that you think is simpler and clearer than the literal translation, go for it. We'll try not to use strings in multiple places, even if the English word could be reused.
Pull requests
Bugfixes are very safe PRs (likely to be merged), and a good way to learn the
code base, but often not as exciting as adding something new. Issues tagged
patches welcome
are also safe, since they have the design worked out. If
you have something else in mind, open a new issue about it first, especially
if it requires increasing Red Moon's complexity (ie, adding options).
Coding Style
Prioritize legibility over dogmatism. That said, consistency is nice, so here's a short list of what I've been doing.
- Try very hard to stay under 100 characters per line. Try less hard to stay under 80.
- Indent 4 spaces, (exception: 8 spaces for the second line of variable assignments that have to wrap)
- constants are
ALL_CAPS
, functions, vals, and short-lived vars arecamelCase
, persistent vars aremCamelCase
. - Form suggests function: Group and align similar actions, and don't do that for dissimmilar ones, even if you could.
- Good code is (mostly) self-documenting. If you're commenting frequently, consider:
- Refactoring into smaller functions with descriptive names
- Converting comments to logs. Code confusing enough to require comments will probably require good logs to debug, and debug output that includes variable contents forces you to keep it up to date.
- 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.
Building
To build the app on GNU+Linux, clone the repository and run
./gradlew build
in the root directory.
Use
./gradlew installDebug
to install the app on a connected device or running emulator.
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
Footnotes
* Google Play and the Google Play logo are trademarks of Google Inc.