From 039a55c144bc968ca9e242640ea107df10ac2867 Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Fri, 3 Mar 2017 12:22:53 -0800 Subject: [PATCH] Add scroll indicators to GLIF Pixel theme Add the scroll indicators to clearly indicate the divide between status bar, content area, and footer, even though they all have the same background color. The scroll indicator will only be shown if there are content beyond the fold. Test: ./gradlew connectedAndroidTest test Bug: 35446596 Change-Id: I5419e4f443a2414f8c983241b8fc61cadb48ef68 --- library/eclair-mr1/res/values/styles.xml | 2 ++ .../suw_glif_recycler_template_content.xml | 7 ++++++- .../layout/suw_glif_list_template_content.xml | 7 ++++++- .../res/layout/suw_glif_template_content.xml | 7 ++++++- library/main/res/values/attrs.xml | 20 +++++++++++++++++++ library/main/res/values/styles.xml | 2 ++ library/platform/res/values-v23/styles.xml | 2 ++ .../setupwizardlib/test/GlifLayoutTest.java | 6 ++++++ 8 files changed, 50 insertions(+), 3 deletions(-) diff --git a/library/eclair-mr1/res/values/styles.xml b/library/eclair-mr1/res/values/styles.xml index 11059bb..4ff6ffd 100644 --- a/library/eclair-mr1/res/values/styles.xml +++ b/library/eclair-mr1/res/values/styles.xml @@ -92,6 +92,7 @@ @style/SuwItemContainer.Description.Glif @color/suw_list_item_icon_color_dark @dimen/suw_glif_margin_sides + none @style/TextAppearance.SuwGlifItemTitle @style/TextAppearance.SuwGlifItemSummary @@ -121,6 +122,7 @@ @style/SuwItemContainer.Description.Glif @color/suw_list_item_icon_color_light @dimen/suw_glif_margin_sides + none @style/TextAppearance.SuwGlifItemTitle @style/TextAppearance.SuwGlifItemSummary diff --git a/library/full-support/res/layout/suw_glif_recycler_template_content.xml b/library/full-support/res/layout/suw_glif_recycler_template_content.xml index 13da5db..e8d209b 100644 --- a/library/full-support/res/layout/suw_glif_recycler_template_content.xml +++ b/library/full-support/res/layout/suw_glif_recycler_template_content.xml @@ -18,17 +18,22 @@ + + android:scrollIndicators="?attr/suwScrollIndicators" + app:suwHeader="@layout/suw_glif_header" + tools:ignore="UnusedAttribute" /> + + android:scrollIndicators="?attr/suwScrollIndicators" + app:suwHeader="@layout/suw_glif_header" + tools:ignore="UnusedAttribute" /> + + android:fillViewport="true" + android:scrollIndicators="?attr/suwScrollIndicators" + tools:ignore="UnusedAttribute"> + + + + + + + + + + + + + + + + + + diff --git a/library/main/res/values/styles.xml b/library/main/res/values/styles.xml index 93720eb..5a42a03 100644 --- a/library/main/res/values/styles.xml +++ b/library/main/res/values/styles.xml @@ -25,6 +25,7 @@ ?android:attr/colorBackground false center_horizontal + top|bottom 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 ae3a0b9..22c2f1d 100644 --- a/library/test/instrumentation/src/com/android/setupwizardlib/test/GlifLayoutTest.java +++ b/library/test/instrumentation/src/com/android/setupwizardlib/test/GlifLayoutTest.java @@ -106,6 +106,12 @@ public class GlifLayoutTest { Integer.toHexString(glifLayout.getBackgroundBaseColor().getDefaultColor())); assertFalse("GLIF Pixel theme shuold not have patterned background", glifLayout.isBackgroundPatterned()); + + if (VERSION.SDK_INT >= VERSION_CODES.M) { + // Scroll indicators are only available on versions >= M + assertEquals(View.SCROLL_INDICATOR_TOP | View.SCROLL_INDICATOR_BOTTOM, + glifLayout.getScrollView().getScrollIndicators()); + } } private void assertDefaultTemplateInflated(GlifLayout layout) {