diff options
4 files changed, 56 insertions, 6 deletions
diff --git a/library/main/res/layout/suw_glif_blank_template_card.xml b/library/main/res/layout/suw_glif_blank_template_card.xml index d120ab0..67c4280 100644 --- a/library/main/res/layout/suw_glif_blank_template_card.xml +++ b/library/main/res/layout/suw_glif_blank_template_card.xml @@ -31,11 +31,14 @@ android:visibility="invisible" /> <com.android.setupwizardlib.view.IntrinsicSizeFrameLayout - android:id="@+id/suw_layout_content" style="@style/SuwGlifCardContainer" android:layout_width="@dimen/suw_glif_card_width" android:layout_height="wrap_content" - android:height="@dimen/suw_glif_card_height" /> + android:height="@dimen/suw_glif_card_height"> + + <include layout="@layout/suw_glif_blank_template_content" /> + + </com.android.setupwizardlib.view.IntrinsicSizeFrameLayout> <View android:layout_width="0dp" diff --git a/library/main/res/layout/suw_glif_blank_template_compact.xml b/library/main/res/layout/suw_glif_blank_template_compact.xml index 7792cd1..fc9cfd4 100644 --- a/library/main/res/layout/suw_glif_blank_template_compact.xml +++ b/library/main/res/layout/suw_glif_blank_template_compact.xml @@ -21,9 +21,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - <FrameLayout - android:id="@+id/suw_layout_content" - android:layout_width="match_parent" - android:layout_height="match_parent" /> + <include layout="@layout/suw_glif_blank_template_content" /> </com.android.setupwizardlib.view.StatusBarBackgroundLayout> diff --git a/library/main/res/layout/suw_glif_blank_template_content.xml b/library/main/res/layout/suw_glif_blank_template_content.xml new file mode 100644 index 0000000..ed81126 --- /dev/null +++ b/library/main/res/layout/suw_glif_blank_template_content.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2017 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <FrameLayout + android:id="@+id/suw_layout_content" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> + + <ViewStub + android:id="@+id/suw_layout_footer" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + +</LinearLayout> diff --git a/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java b/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java index 8734f1d..d46409d 100644 --- a/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java +++ b/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java @@ -241,6 +241,21 @@ public class GlifLayoutTest { } @Test + public void testInflateFooterBlankTemplate() { + GlifLayout layout = new GlifLayout(mContext, R.layout.suw_glif_blank_template); + + final View view = layout.inflateFooter(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 testInflateFooterBlankTemplateTablet() { + testInflateFooterBlankTemplate(); + } + + @Test public void testFooterXml() { GlifLayout layout = new GlifLayout( mContext, |