Add footer stubs to blank template

Test: ./gradlew test
Bug: 38043070
Change-Id: I91aae8667f1eef37f8c3cccb879871afefb90823
This commit is contained in:
Maurice Lam 2017-05-08 11:26:22 -07:00
parent d3b18ba144
commit af3208e2c3
4 changed files with 56 additions and 6 deletions

View file

@ -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"

View file

@ -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>

View file

@ -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>

View file

@ -240,6 +240,21 @@ public class GlifLayoutTest {
testInflateFooter();
}
@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(