summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--library/main/res/values/styles.xml10
-rw-r--r--library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java28
-rw-r--r--library/test/instrumentation/src/com/android/setupwizardlib/test/GlifLayoutTest.java12
-rw-r--r--library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java28
4 files changed, 48 insertions, 30 deletions
diff --git a/library/main/res/values/styles.xml b/library/main/res/values/styles.xml
index 83b3574..0755cc8 100644
--- a/library/main/res/values/styles.xml
+++ b/library/main/res/values/styles.xml
@@ -19,7 +19,7 @@
<!-- General styles -->
- <style name="SuwThemeGlifPixel" parent="SuwThemeGlif">
+ <style name="SuwThemeGlifV2" parent="SuwThemeGlif">
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
<item name="suwBackgroundBaseColor">?android:attr/colorBackground</item>
@@ -28,7 +28,10 @@
<item name="suwScrollIndicators">top|bottom</item>
</style>
- <style name="SuwThemeGlifPixel.Light" parent="SuwThemeGlif.Light">
+ <!-- Deprecated. Use SuwThemeGlifV2 instead -->
+ <style name="SuwThemeGlifPixel" parent="SuwThemeGlifV2" />
+
+ <style name="SuwThemeGlifV2.Light" parent="SuwThemeGlif.Light">
<item name="android:windowLightStatusBar" tools:targetApi="m">true</item>
<item name="suwBackgroundBaseColor">?android:attr/colorBackground</item>
@@ -37,6 +40,9 @@
<item name="suwScrollIndicators">top|bottom</item>
</style>
+ <!-- Deprecated. Use SuwThemeGlifV2.Light instead -->
+ <style name="SuwThemeGlifPixel.Light" parent="SuwThemeGlifV2.Light" />
+
<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 cd04cf2..f25d646 100644
--- a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
+++ b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java
@@ -71,13 +71,25 @@ public class WizardManagerHelper {
* Passed in a setup wizard intent as {@link #EXTRA_THEME}. This is the dark variant of the
* theme used in setup wizard for O DR.
*/
- public static final String THEME_GLIF_PIXEL = "glif_pixel";
+ public static final String THEME_GLIF_V2 = "glif_v2";
+
+ /**
+ * @deprecated Use {@link #THEME_GLIF_V2} instead.
+ */
+ @Deprecated
+ public static final String THEME_GLIF_PIXEL = THEME_GLIF_V2;
/**
* Passed in a setup wizard intent as {@link #EXTRA_THEME}. This is the default theme used in
* setup wizard for O DR.
*/
- public static final String THEME_GLIF_PIXEL_LIGHT = "glif_pixel_light";
+ public static final String THEME_GLIF_V2_LIGHT = "glif_v2_light";
+
+ /**
+ * @deprecated Use {@link #THEME_GLIF_V2_LIGHT} instead.
+ */
+ @Deprecated
+ public static final String THEME_GLIF_PIXEL_LIGHT = THEME_GLIF_V2_LIGHT;
/**
* Get an intent that will invoke the next step of setup wizard.
@@ -208,10 +220,10 @@ 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_PIXEL_LIGHT.equals(theme)) {
+ || THEME_GLIF_LIGHT.equals(theme) || THEME_GLIF_V2_LIGHT.equals(theme)) {
return true;
} else if (THEME_HOLO.equals(theme) || THEME_MATERIAL.equals(theme)
- || THEME_GLIF.equals(theme) || THEME_GLIF_PIXEL.equals(theme)) {
+ || THEME_GLIF.equals(theme) || THEME_GLIF_V2.equals(theme)) {
return false;
} else {
return def;
@@ -256,10 +268,10 @@ public class WizardManagerHelper {
public static @StyleRes int getThemeRes(String theme, @StyleRes int defaultTheme) {
if (theme != null) {
switch (theme) {
- case THEME_GLIF_PIXEL_LIGHT:
- return R.style.SuwThemeGlifPixel_Light;
- case THEME_GLIF_PIXEL:
- return R.style.SuwThemeGlifPixel;
+ case THEME_GLIF_V2_LIGHT:
+ return R.style.SuwThemeGlifV2_Light;
+ case THEME_GLIF_V2:
+ return R.style.SuwThemeGlifV2;
case THEME_GLIF_LIGHT:
return R.style.SuwThemeGlif_Light;
case THEME_GLIF:
diff --git a/library/test/instrumentation/src/com/android/setupwizardlib/test/GlifLayoutTest.java b/library/test/instrumentation/src/com/android/setupwizardlib/test/GlifLayoutTest.java
index acb7fbb..cc59913 100644
--- a/library/test/instrumentation/src/com/android/setupwizardlib/test/GlifLayoutTest.java
+++ b/library/test/instrumentation/src/com/android/setupwizardlib/test/GlifLayoutTest.java
@@ -95,29 +95,29 @@ public class GlifLayoutTest {
}
@Test
- public void testGlifPixelTheme() {
+ public void testGlifV2Theme() {
mContext = new ContextThemeWrapper(InstrumentationRegistry.getContext(),
- R.style.SuwThemeGlifPixel_Light);
+ R.style.SuwThemeGlifV2_Light);
final GlifLayout glifLayout = new GlifLayout(mContext);
final TextView titleView = (TextView) glifLayout.findManagedViewById(R.id.suw_layout_title);
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {
assertEquals(View.TEXT_ALIGNMENT_GRAVITY, titleView.getTextAlignment());
}
- assertEquals("Title text should be center aligned on GLIF Pixel theme",
+ assertEquals("Title text should be center aligned on GLIF v2 theme",
Gravity.CENTER_HORIZONTAL, titleView.getGravity() & Gravity.CENTER_HORIZONTAL);
if (VERSION.SDK_INT >= VERSION_CODES.N) {
// LinearLayout.getGravity is only available on versions >= N
final View iconView = glifLayout.findManagedViewById(R.id.suw_layout_icon);
final LinearLayout parent = (LinearLayout) iconView.getParent();
- assertEquals("Icon should be center aligned on GLIF Pixel theme",
+ assertEquals("Icon should be center aligned on GLIF v2 theme",
Gravity.CENTER_HORIZONTAL, parent.getGravity() & Gravity.CENTER_HORIZONTAL);
}
- assertEquals("Status bar color should be white in GLIF Pixel theme",
+ assertEquals("Status bar color should be white in GLIF v2 theme",
"fffafafa",
Integer.toHexString(glifLayout.getBackgroundBaseColor().getDefaultColor()));
- assertFalse("GLIF Pixel theme shuold not have patterned background",
+ assertFalse("GLIF v2 theme shuold not have patterned background",
glifLayout.isBackgroundPatterned());
if (VERSION.SDK_INT >= VERSION_CODES.M) {
diff --git a/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java b/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java
index d518e08..00de17e 100644
--- a/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java
+++ b/library/test/robotest/src/com/android/setupwizardlib/util/WizardManagerHelperTest.java
@@ -140,22 +140,22 @@ public class WizardManagerHelperTest {
}
@Test
- public void testGlifPixelIsDarkTheme() {
+ public void testGlifV2IsDarkTheme() {
final Intent intent = new Intent();
- intent.putExtra("theme", "glif_pixel");
- assertFalse("Theme glif_pixel should be dark theme",
+ intent.putExtra("theme", "glif_v2");
+ assertFalse("Theme glif_v2 should be dark theme",
WizardManagerHelper.isLightTheme(intent, false));
- assertFalse("Theme glif_pixel should be dark theme",
+ assertFalse("Theme glif_v2 should be dark theme",
WizardManagerHelper.isLightTheme(intent, true));
}
@Test
- public void testGlifPixelLightIsLightTheme() {
+ public void testGlifV2LightIsLightTheme() {
final Intent intent = new Intent();
- intent.putExtra("theme", "glif_pixel_light");
- assertTrue("Theme glif_pixel_light should be light theme",
+ intent.putExtra("theme", "glif_v2_light");
+ assertTrue("Theme glif_v2_light should be light theme",
WizardManagerHelper.isLightTheme(intent, false));
- assertTrue("Theme glif_pixel_light should be light theme",
+ assertTrue("Theme glif_v2_light should be light theme",
WizardManagerHelper.isLightTheme(intent, true));
}
@@ -195,15 +195,15 @@ public class WizardManagerHelperTest {
}
@Test
- public void testGetThemeResGlifPixelLight() {
- assertEquals(R.style.SuwThemeGlifPixel_Light,
- WizardManagerHelper.getThemeRes("glif_pixel_light", 0));
+ public void testGetThemeResGlifV2Light() {
+ assertEquals(R.style.SuwThemeGlifV2_Light,
+ WizardManagerHelper.getThemeRes("glif_v2_light", 0));
}
@Test
- public void testGetThemeResGlifPixel() {
- assertEquals(R.style.SuwThemeGlifPixel,
- WizardManagerHelper.getThemeRes("glif_pixel", 0));
+ public void testGetThemeResGlifV2() {
+ assertEquals(R.style.SuwThemeGlifV2,
+ WizardManagerHelper.getThemeRes("glif_v2", 0));
}
@Test