summaryrefslogtreecommitdiff
path: root/library/test/robotest/src/com
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2018-01-02 20:45:07 -0800
committerMaurice Lam <yukl@google.com>2018-01-03 10:41:08 -0800
commit3a3d478a4b8805992f9558fa8128261970d2ee99 (patch)
treeee99a4f2df0366fee41495c8908452595e50ebae /library/test/robotest/src/com
parent5153bc0ae2fbe31e66a83cd014df0e7f7a7b436f (diff)
downloadsetupwizard-3a3d478a4b8805992f9558fa8128261970d2ee99.tar.gz
More app bar support in GlifLayout
- Add app:suwStickyHeader attribute to GlifLayout to specify a custom app bar layout, which can be a Toolbar. - Create indirection attribute ?attr/suwGlifIconStyle to allow apps to override the GLIF icon style. Test: ./gradlew test Bug: 68826871 Change-Id: I6384db970582c56431b6085bb172f6ca28099f9d
Diffstat (limited to 'library/test/robotest/src/com')
-rw-r--r--library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java b/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java
index 360dfe2..e07d5fa 100644
--- a/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java
+++ b/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java
@@ -267,6 +267,47 @@ public class GlifLayoutTest {
assertNotNull(layout.findViewById(android.R.id.text1));
}
+ @Test
+ public void inflateStickyHeader_shouldAddViewToLayout() {
+ GlifLayout layout = new GlifLayout(mContext);
+
+ final View view = layout.inflateStickyHeader(android.R.layout.simple_list_item_1);
+ assertEquals(android.R.id.text1, view.getId());
+ assertNotNull(layout.findViewById(android.R.id.text1));
+ }
+
+ @Config(qualifiers = "sw600dp")
+ @Test
+ public void inflateStickyHeader_whenOnTablets_shouldAddViewToLayout() {
+ inflateStickyHeader_shouldAddViewToLayout();
+ }
+
+ @Test
+ public void inflateStickyHeader_whenInXml_shouldAddViewToLayout() {
+ GlifLayout layout = new GlifLayout(
+ mContext,
+ Robolectric.buildAttributeSet()
+ .addAttribute(R.attr.suwStickyHeader, "@android:layout/simple_list_item_1")
+ .build());
+
+ assertNotNull(layout.findViewById(android.R.id.text1));
+ }
+
+ @Test
+ public void inflateStickyHeader_whenOnBlankTemplate_shouldAddViewToLayout() {
+ GlifLayout layout = new GlifLayout(mContext, R.layout.suw_glif_blank_template);
+
+ final View view = layout.inflateStickyHeader(android.R.layout.simple_list_item_1);
+ assertEquals(android.R.id.text1, view.getId());
+ assertNotNull(layout.findViewById(android.R.id.text1));
+ }
+
+ @Config(qualifiers = "sw600dp")
+ @Test
+ public void inflateStickyHeader_whenOnBlankTemplateTablet_shouldAddViewToLayout() {
+ inflateStickyHeader_whenOnBlankTemplate_shouldAddViewToLayout();
+ }
+
@Config(sdk = { VERSION_CODES.M, Config.NEWEST_SDK })
@Test
public void createFromXml_shouldSetLayoutFullscreen_whenLayoutFullscreenIsNotSet() {