summaryrefslogtreecommitdiff
path: root/library/main/src/com/android
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2015-11-11 17:59:06 -0800
committerMaurice Lam <yukl@google.com>2015-11-12 23:51:09 +0000
commitc3a4e07feacd7e9cff6d0fc6ddbe86c90d6f7087 (patch)
tree3705c179b634e644ec95078878e02efb1965d09d /library/main/src/com/android
parenta4b92021cb7100daed79df590027182332061c88 (diff)
downloadsetupwizard-c3a4e07feacd7e9cff6d0fc6ddbe86c90d6f7087.tar.gz
[SuwLib] Add isLightTheme for strings
Add isLightTheme method to be able to directly tell whether a string represents a light or dark theme. Change-Id: Ib49cdcbb9047e235189a451b42f20b5cba5eb42a
Diffstat (limited to 'library/main/src/com/android')
-rw-r--r--library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
index d203ef6..183015f 100644
--- a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
+++ b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
@@ -195,6 +195,18 @@ public class WizardManagerHelper {
*/
public static boolean isLightTheme(Intent intent, boolean def) {
final String theme = intent.getStringExtra(EXTRA_THEME);
+ return isLightTheme(theme, def);
+ }
+
+ /**
+ * Checks whether {@code theme} represents a light or dark theme. If the theme specified is
+ * unknown, the value def will be returned.
+ *
+ * @param theme The theme as specified from an intent sent from setup wizard.
+ * @param def The default value if the theme is not known.
+ * @return True if {@code theme} represents a light theme.
+ */
+ public static boolean isLightTheme(String theme, boolean def) {
if (THEME_HOLO_LIGHT.equals(theme) || THEME_MATERIAL_LIGHT.equals(theme)
|| THEME_MATERIAL_BLUE_LIGHT.equals(theme)) {
return true;