diff options
author | Maurice Lam <yukl@google.com> | 2017-12-01 12:51:42 -0800 |
---|---|---|
committer | Maurice Lam <yukl@google.com> | 2017-12-01 12:51:42 -0800 |
commit | 8b52391bba333441da82aed544bd58fae9586f15 (patch) | |
tree | db882103738ee81997bf59d2baad2dfaba8d1ed6 /library/main | |
parent | e2d1593a5a52765e60094542141b75c4e9a0ca04 (diff) | |
download | setupwizard-8b52391bba333441da82aed544bd58fae9586f15.tar.gz |
Add GLIF v3 theme and make buttons Google Blue 600
Test: ./gradlew test
Bug: 69930196
Change-Id: Iba6be8daad2f27925647e43a6a1c5e19c03fb7bb
Diffstat (limited to 'library/main')
-rw-r--r-- | library/main/res/color-v23/suw_flat_button_highlight.xml | 2 | ||||
-rw-r--r-- | library/main/res/values/attrs.xml | 1 | ||||
-rw-r--r-- | library/main/res/values/colors.xml | 1 | ||||
-rw-r--r-- | library/main/res/values/styles.xml | 8 | ||||
-rw-r--r-- | library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java | 22 |
5 files changed, 31 insertions, 3 deletions
diff --git a/library/main/res/color-v23/suw_flat_button_highlight.xml b/library/main/res/color-v23/suw_flat_button_highlight.xml index c5be14f..4d90570 100644 --- a/library/main/res/color-v23/suw_flat_button_highlight.xml +++ b/library/main/res/color-v23/suw_flat_button_highlight.xml @@ -16,6 +16,6 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:color="?android:attr/colorAccent" + <item android:color="?attr/suwButtonColor" android:alpha="0.24" /> </selector> diff --git a/library/main/res/values/attrs.xml b/library/main/res/values/attrs.xml index d378bb0..ec21f87 100644 --- a/library/main/res/values/attrs.xml +++ b/library/main/res/values/attrs.xml @@ -20,6 +20,7 @@ <!-- Theme attributes --> <attr name="suwLayoutTheme" format="reference" /> <attr name="suwMarginSides" format="dimension|reference" /> + <attr name="suwButtonColor" format="color" /> <!-- Subset of values in "gravity" in frameworks/base/core/res/res/values/attrs.xml. Only horizontal values are listed here as the header does not support vertical gravity. --> diff --git a/library/main/res/values/colors.xml b/library/main/res/values/colors.xml index cd57a8a..525d1b2 100644 --- a/library/main/res/values/colors.xml +++ b/library/main/res/values/colors.xml @@ -42,5 +42,6 @@ <color name="suw_color_accent_glif_light">#ff4285f4</color> <color name="suw_glif_background_color_dark">#ff000000</color> <color name="suw_glif_background_color_light">#ffffffff</color> + <color name="suw_glif_v3_footer_button_color">#ff1a73e8</color> </resources> diff --git a/library/main/res/values/styles.xml b/library/main/res/values/styles.xml index bd3b60f..0e7685b 100644 --- a/library/main/res/values/styles.xml +++ b/library/main/res/values/styles.xml @@ -51,6 +51,14 @@ <!-- Deprecated. Use SuwThemeGlifV2.Light instead --> <style name="SuwThemeGlifPixel.Light" parent="SuwThemeGlifV2.Light" /> + <style name="SuwThemeGlifV3" parent="SuwThemeGlifV2"> + <item name="suwButtonColor">@color/suw_glif_v3_footer_button_color</item> + </style> + + <style name="SuwThemeGlifV3.Light" parent="SuwThemeGlifV2.Light"> + <item name="suwButtonColor">@color/suw_glif_v3_footer_button_color</item> + </style> + <style name="Animation.SuwWindowAnimation" parent="@android:style/Animation.Activity"> <item name="android:activityOpenEnterAnimation">@anim/suw_slide_next_in</item> <item name="android:activityOpenExitAnimation">@anim/suw_slide_next_out</item> diff --git a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java index 32929aa..f4bb8f5 100644 --- a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java +++ b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java @@ -98,6 +98,18 @@ public class WizardManagerHelper { public static final String THEME_GLIF_PIXEL_LIGHT = THEME_GLIF_V2_LIGHT; /** + * Passed in a setup wizard intent as {@link #EXTRA_THEME}. This is the dark variant of the + * theme used in setup wizard for P. + */ + public static final String THEME_GLIF_V3 = "glif_v3"; + + /** + * Passed in a setup wizard intent as {@link #EXTRA_THEME}. This is the default theme used in + * setup wizard for P. + */ + public static final String THEME_GLIF_V3_LIGHT = "glif_v3_light"; + + /** * Get an intent that will invoke the next step of setup wizard. * * @param originalIntent The original intent that was used to start the step, usually via @@ -253,10 +265,12 @@ public class WizardManagerHelper { */ public static boolean isLightTheme(String theme, boolean def) { if (THEME_HOLO_LIGHT.equals(theme) || THEME_MATERIAL_LIGHT.equals(theme) - || THEME_GLIF_LIGHT.equals(theme) || THEME_GLIF_V2_LIGHT.equals(theme)) { + || THEME_GLIF_LIGHT.equals(theme) || THEME_GLIF_V2_LIGHT.equals(theme) + || THEME_GLIF_V3_LIGHT.equals(theme)) { return true; } else if (THEME_HOLO.equals(theme) || THEME_MATERIAL.equals(theme) - || THEME_GLIF.equals(theme) || THEME_GLIF_V2.equals(theme)) { + || THEME_GLIF.equals(theme) || THEME_GLIF_V2.equals(theme) + || THEME_GLIF_V3.equals(theme)) { return false; } else { return def; @@ -301,6 +315,10 @@ public class WizardManagerHelper { public static @StyleRes int getThemeRes(String theme, @StyleRes int defaultTheme) { if (theme != null) { switch (theme) { + case THEME_GLIF_V3_LIGHT: + return R.style.SuwThemeGlifV3_Light; + case THEME_GLIF_V3: + return R.style.SuwThemeGlifV3; case THEME_GLIF_V2_LIGHT: return R.style.SuwThemeGlifV2_Light; case THEME_GLIF_V2: |