From d3ffc713be68823409d5dc6d2d44bb21bde5bfd0 Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Tue, 28 Feb 2017 11:09:45 -0800 Subject: [PATCH] Add center alignment for 2017 themes Add "GLIF Pixel" theme that is a drop-in replacement for SuwThemeGlif, which will center align the header and description text. To use GLIF Pixel theme, simply set the activity theme (using android:theme or Activity#setTheme) to SuwThemeGlifPixel and use the GLIF layouts normally. Other theme attributes like status bar background will be done in a separate CL. Test: ./gradlew connectedAndroidTest test Bug: 35446596 Change-Id: I3edee9cf80c1c84018ed08f47f9859e51a3936e6 --- library/eclair-mr1/res/values/styles.xml | 2 + library/main/res/layout/suw_glif_header.xml | 1 + .../main/res/layout/suw_items_description.xml | 4 +- library/main/res/values/attrs.xml | 17 ++++ library/main/res/values/styles.xml | 20 +++++ .../util/FallbackThemeWrapper.java | 2 +- .../util/WizardManagerHelper.java | 20 ++++- library/platform/res/values-v23/styles.xml | 2 + .../setupwizardlib/test/GlifLayoutTest.java | 25 ++++++ .../setupwizardlib/items/ButtonItemTest.java | 4 +- .../util}/WizardManagerHelperTest.java | 84 ++++++++++++++----- 11 files changed, 149 insertions(+), 32 deletions(-) rename library/test/{instrumentation/src/com/android/setupwizardlib/test => robotest/src/com/android/setupwizardlib/util}/WizardManagerHelperTest.java (68%) diff --git a/library/eclair-mr1/res/values/styles.xml b/library/eclair-mr1/res/values/styles.xml index e25cbb6..11059bb 100644 --- a/library/eclair-mr1/res/values/styles.xml +++ b/library/eclair-mr1/res/values/styles.xml @@ -88,6 +88,7 @@ ?attr/suwMarginSides ?attr/colorPrimary @dimen/suw_items_glif_icon_divider_inset + start @style/SuwItemContainer.Description.Glif @color/suw_list_item_icon_color_dark @dimen/suw_glif_margin_sides @@ -116,6 +117,7 @@ ?attr/suwMarginSides ?attr/colorPrimary @dimen/suw_items_glif_icon_divider_inset + start @style/SuwItemContainer.Description.Glif @color/suw_list_item_icon_color_light @dimen/suw_glif_margin_sides diff --git a/library/main/res/layout/suw_glif_header.xml b/library/main/res/layout/suw_glif_header.xml index 8267a31..b090f79 100644 --- a/library/main/res/layout/suw_glif_header.xml +++ b/library/main/res/layout/suw_glif_header.xml @@ -16,6 +16,7 @@ --> diff --git a/library/main/res/layout/suw_items_description.xml b/library/main/res/layout/suw_items_description.xml index 391ed0e..26a604b 100644 --- a/library/main/res/layout/suw_items_description.xml +++ b/library/main/res/layout/suw_items_description.xml @@ -48,12 +48,10 @@ diff --git a/library/main/res/values/attrs.xml b/library/main/res/values/attrs.xml index 475f62b..afeb16c 100644 --- a/library/main/res/values/attrs.xml +++ b/library/main/res/values/attrs.xml @@ -21,6 +21,23 @@ + + + + + + + + + + + + + + + + diff --git a/library/main/res/values/styles.xml b/library/main/res/values/styles.xml index 52cc192..9a32c38 100644 --- a/library/main/res/values/styles.xml +++ b/library/main/res/values/styles.xml @@ -19,6 +19,14 @@ + + + + + + @@ -168,12 +183,17 @@ +