Add support for user-selectable night mode

Adds a Material theme that automatically selects light or dark UI based
on the night mode resource qualifier.

Removes restriction that night mode only works when car mode is enabled
or the device is docked, which was applied inconsistently anyway and
only actually worked when in car mode (regardless of docked state).
Night mode is now always applied according to the system preference.

Change-Id: I526807c907eb29a2ab588d15932afe3e6ab180c2
This commit is contained in:
Alan Viverette
2015-02-12 11:01:06 -08:00
parent 5e789f03b2
commit 4cc1e9e707
10 changed files with 311 additions and 42 deletions

View File

@@ -219,10 +219,9 @@ public class UiModeManager {
}
/**
* Returns the currently configured night mode.
*
* @return {@link #MODE_NIGHT_NO}, {@link #MODE_NIGHT_YES}, or
* {@link #MODE_NIGHT_AUTO}. When an error occurred -1 is returned.
* @return the currently configured night mode. May be one of
* {@link #MODE_NIGHT_NO}, {@link #MODE_NIGHT_YES},
* {@link #MODE_NIGHT_AUTO}, or -1 on error.
*/
public int getNightMode() {
if (mService != null) {