YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.settings.ThemeChoice Class Reference

The "Theme" setting: follow the system, always dark or always light. More...

Collaboration diagram for de.yaacc.settings.ThemeChoice:
Collaboration graph

Static Public Member Functions

static int nightMode (String storedValue)
 
static String fromLegacyDarkMode (boolean darkMode)
 The value the former check box maps to: on was "always dark", off was "use the system settings".
 
static boolean migrateLegacyDarkMode (SharedPreferences preferences, String legacyKey, String key)
 To be called once at app start, after the preference defaults were applied: an install updated from a version with the check box has no value under the new key and keeps the look it had.
 

Static Public Attributes

static final String STORED_SYSTEM = "system"
 Follow the system setting.
 
static final String STORED_DARK = "dark"
 Always dark.
 
static final String STORED_LIGHT = "light"
 Always light.
 
static final String DEFAULT_STORED_VALUE = STORED_DARK
 What a fresh install gets (the former check box was on by default); also the fallback for unknown values.
 

Detailed Description

The "Theme" setting: follow the system, always dark or always light.

Replaces the former on/off "Dark mode" check box (stored under another key as a boolean).

Member Function Documentation

◆ migrateLegacyDarkMode()

static boolean de.yaacc.settings.ThemeChoice.migrateLegacyDarkMode ( SharedPreferences preferences,
String legacyKey,
String key )
static

To be called once at app start, after the preference defaults were applied: an install updated from a version with the check box has no value under the new key and keeps the look it had.

Returns
true if a value was migrated
Here is the call graph for this function:

◆ nightMode()

static int de.yaacc.settings.ThemeChoice.nightMode ( String storedValue)
static
Parameters
storedValuethe stored value, may be null
Returns
the AppCompatDelegate night mode for it; null and unknown values give the mode of DEFAULT_STORED_VALUE

The documentation for this class was generated from the following file: