[SuwLib] Add dark GLIF theme (placeholder)
Add placeholder for dark GLIF theme, which is an extension of the
dark system themes with same overlay values as the light variant.
The color values of the overlays will be updated as necessary.
Change-Id: If7aa2e4b849c26300d4d8ab606be7b74cc33620f
(cherry picked from commit 0c0f30d332afd782dd107ef11f7fa76fb2fdd165)
diff --git a/library/eclair-mr1/res/values/styles.xml b/library/eclair-mr1/res/values/styles.xml
index 3c3cb46..4517a07 100644
--- a/library/eclair-mr1/res/values/styles.xml
+++ b/library/eclair-mr1/res/values/styles.xml
@@ -61,6 +61,28 @@
<item name="textAppearanceListItemSmall">@style/TextAppearance.AppCompat.Body1</item>
</style>
+ <!-- Placeholder for GLIF dark theme, colors are not updated yet -->
+ <style name="SuwThemeGlif" parent="Theme.AppCompat.NoActionBar">
+ <item name="android:indeterminateTint" tools:ignore="NewApi">?attr/colorControlActivated</item>
+ <!-- Specify the indeterminateTintMode to work around a bug in Lollipop -->
+ <item name="android:indeterminateTintMode" tools:ignore="NewApi">src_in</item>
+ <item name="android:listPreferredItemHeight">@dimen/suw_items_preferred_height</item>
+ <item name="android:navigationBarColor" tools:ignore="NewApi">@android:color/black</item>
+ <item name="android:statusBarColor" tools:ignore="NewApi">@android:color/transparent</item>
+ <item name="android:textColorLink">@color/suw_link_color_light</item>
+ <item name="android:windowAnimationStyle">@style/Animation.SuwWindowAnimation</item>
+ <item name="android:windowDisablePreview">true</item>
+ <item name="android:windowSoftInputMode">adjustResize</item>
+
+ <item name="colorAccent">@color/suw_color_accent_light</item>
+ <item name="colorPrimary">@color/suw_color_accent_light</item>
+ <item name="listPreferredItemPaddingLeft">?attr/suwMarginSides</item>
+ <item name="listPreferredItemPaddingRight">?attr/suwMarginSides</item>
+ <item name="suwMarginSides">@dimen/suw_glif_margin_sides</item>
+ <item name="textAppearanceListItem">@style/TextAppearance.SuwGlifItemTitle</item>
+ <item name="textAppearanceListItemSmall">@style/TextAppearance.SuwGlifItemSummary</item>
+ </style>
+
<style name="SuwThemeGlif.Light" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:indeterminateTint" tools:ignore="NewApi">?attr/colorControlActivated</item>
<!-- Specify the indeterminateTintMode to work around a bug in Lollipop -->
diff --git a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
index 62339fc..7d98a90 100644
--- a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
+++ b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
@@ -65,6 +65,12 @@
public static final String THEME_MATERIAL_BLUE_LIGHT = "material_blue_light";
/**
+ * Passed in a setup wizard intent as {@link #EXTRA_THEME}. This is the dark variant of the
+ * theme used in setup wizard for NYC.
+ */
+ public static final String THEME_GLIF = "glif";
+
+ /**
* Passed in a setup wizard intent as {@link #EXTRA_THEME}. This is the default theme used in
* setup wizard for NYC.
*/
@@ -199,7 +205,7 @@
|| THEME_MATERIAL_BLUE_LIGHT.equals(theme) || THEME_GLIF_LIGHT.equals(theme)) {
return true;
} else if (THEME_HOLO.equals(theme) || THEME_MATERIAL.equals(theme)
- || THEME_MATERIAL_BLUE.equals(theme)) {
+ || THEME_MATERIAL_BLUE.equals(theme) || THEME_GLIF.equals(theme)) {
return false;
} else {
return def;
diff --git a/library/platform/res/values-v21/styles.xml b/library/platform/res/values-v21/styles.xml
index 42f89d1..f23b2cb 100644
--- a/library/platform/res/values-v21/styles.xml
+++ b/library/platform/res/values-v21/styles.xml
@@ -66,6 +66,28 @@
<item name="suwNavBarTheme">@style/SuwNavBarThemeLight</item>
</style>
+ <!-- Placeholder for GLIF dark theme, colors are not updated yet -->
+ <style name="SuwThemeGlif" parent="android:Theme.Material.NoActionBar">
+ <item name="android:colorAccent">@color/suw_color_accent_light</item>
+ <item name="android:colorPrimary">@color/suw_color_accent_light</item>
+ <item name="android:indeterminateTint">?android:attr/colorControlActivated</item>
+ <!-- Specify the indeterminateTintMode to work around a bug in Lollipop -->
+ <item name="android:indeterminateTintMode">src_in</item>
+ <item name="android:listPreferredItemHeight">@dimen/suw_items_preferred_height</item>
+ <item name="android:listPreferredItemPaddingEnd">?attr/suwMarginSides</item>
+ <item name="android:listPreferredItemPaddingStart">?attr/suwMarginSides</item>
+ <item name="android:navigationBarColor">@android:color/black</item>
+ <item name="android:statusBarColor">?android:attr/colorPrimary</item>
+ <item name="android:textAppearanceListItem">@style/TextAppearance.SuwGlifItemTitle</item>
+ <item name="android:textAppearanceListItemSmall">@style/TextAppearance.SuwGlifItemSummary</item>
+ <item name="android:textColorLink">@color/suw_link_color_light</item>
+ <item name="android:windowAnimationStyle">@style/Animation.SuwWindowAnimation</item>
+ <item name="android:windowDisablePreview">true</item>
+ <item name="android:windowSoftInputMode">adjustResize</item>
+
+ <item name="suwMarginSides">@dimen/suw_glif_margin_sides</item>
+ </style>
+
<style name="SuwThemeGlif.Light" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:colorAccent">@color/suw_color_accent_light</item>
<item name="android:colorPrimary">@color/suw_color_accent_light</item>
diff --git a/library/test/src/com/android/setupwizardlib/test/WizardManagerHelperTest.java b/library/test/src/com/android/setupwizardlib/test/WizardManagerHelperTest.java
index 01ba662..fb4601c 100644
--- a/library/test/src/com/android/setupwizardlib/test/WizardManagerHelperTest.java
+++ b/library/test/src/com/android/setupwizardlib/test/WizardManagerHelperTest.java
@@ -118,6 +118,16 @@
}
@SmallTest
+ public void testGlifIsDarkTheme() {
+ final Intent intent = new Intent();
+ intent.putExtra("theme", "glif");
+ assertFalse("Theme glif should be dark theme",
+ WizardManagerHelper.isLightTheme(intent, false));
+ assertFalse("Theme glif should be dark theme",
+ WizardManagerHelper.isLightTheme(intent, true));
+ }
+
+ @SmallTest
public void testGlifLightIsLightTheme() {
final Intent intent = new Intent();
intent.putExtra("theme", "glif_light");