summaryrefslogtreecommitdiff
path: root/integration-tests/TestApp/app
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2015-06-15 13:28:27 -0700
committerGeorge Mount <mount@google.com>2015-06-17 09:28:54 -0700
commit2ac58b34e5200a34b0ba63884c375a68c9a84303 (patch)
treed129c5dbeba5a9450ee95652723d192a3d5fbe98 /integration-tests/TestApp/app
parent6a62f1fff2a45c639b85c6cc12c00a1d8e9e98c9 (diff)
downloaddata-binding-2ac58b34e5200a34b0ba63884c375a68c9a84303.tar.gz
Fix bug where parent of include not being tagged.
Bug 21850030 Change-Id: I977ff4879d8bf2dff408a6ad7f7ba539d979cf60
Diffstat (limited to 'integration-tests/TestApp/app')
-rw-r--r--integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/IncludeTagTest.java4
-rw-r--r--integration-tests/TestApp/app/src/main/res/layout/layout_with_include.xml58
2 files changed, 33 insertions, 29 deletions
diff --git a/integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/IncludeTagTest.java b/integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/IncludeTagTest.java
index 28c4ea3a..f9ba6350 100644
--- a/integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/IncludeTagTest.java
+++ b/integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/IncludeTagTest.java
@@ -38,9 +38,9 @@ public class IncludeTagTest extends BaseDataBinderTest<LayoutWithIncludeBinding>
final TextView innerText = (TextView) mBinder.getRoot().findViewById(R.id.innerTextView);
assertEquals("modified 3a", innerText.getText().toString());
TextView textView1 = (TextView) mBinder.getRoot().findViewById(R.id.innerTextView1);
- assertEquals(mBinder.getRoot(), textView1.getParent());
+ assertEquals(mBinder.getRoot(), textView1.getParent().getParent());
TextView textView2 = (TextView) mBinder.getRoot().findViewById(R.id.innerTextView2);
- assertEquals(mBinder.getRoot(), textView2.getParent());
+ assertEquals(mBinder.getRoot(), textView2.getParent().getParent());
assertEquals("a hello 3a", textView1.getText().toString());
assertEquals("b hello 3a", textView2.getText().toString());
MergeLayoutBinding mergeLayoutBinding = mBinder.secondMerge;
diff --git a/integration-tests/TestApp/app/src/main/res/layout/layout_with_include.xml b/integration-tests/TestApp/app/src/main/res/layout/layout_with_include.xml
index c99aae2e..292db4f2 100644
--- a/integration-tests/TestApp/app/src/main/res/layout/layout_with_include.xml
+++ b/integration-tests/TestApp/app/src/main/res/layout/layout_with_include.xml
@@ -17,34 +17,38 @@
<data>
<variable name="outerObject" type="android.databinding.testapp.vo.NotBindableVo"/>
</data>
- <LinearLayout
- android:orientation="vertical"
+ <FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
- <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:id="@+id/outerTextView"
- android:text="@{outerObject.stringValue}"/>
- <!-- TODO test id collision-->
- <include layout="@layout/included_layout" android:id="@+id/includedLayout"
- bind:innerObject="@{outerObject}"
- bind:innerValue="@{`modified ` + outerObject.intValue}"
- />
- <!-- stick something in the middle that may mess with the tag IDs -->
- <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:text="@{`` + outerObject.intValue}"/>
- <include layout="@layout/plain_layout" android:id="@+id/plainLayout"/>
- <include layout="@layout/merge_layout"
- bind:innerObject="@{outerObject}"
- bind:innerValue="@{`hello ` + outerObject.intValue}"/>
- <include layout="@layout/merge_layout"
- android:id="@+id/secondMerge"
- bind:innerObject="@{outerObject}"
- bind:innerValue="@{`goodbye ` + outerObject.intValue}"/>
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
+ android:id="@+id/outerTextView"
+ android:text="@{outerObject.stringValue}"/>
+ <!-- TODO test id collision-->
+ <include layout="@layout/included_layout" android:id="@+id/includedLayout"
+ bind:innerObject="@{outerObject}"
+ bind:innerValue="@{`modified ` + outerObject.intValue}"
+ />
+ <!-- stick something in the middle that may mess with the tag IDs -->
+ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
+ android:text="@{`` + outerObject.intValue}"/>
+ <include layout="@layout/plain_layout" android:id="@+id/plainLayout"/>
+ <include layout="@layout/merge_layout"
+ bind:innerObject="@{outerObject}"
+ bind:innerValue="@{`hello ` + outerObject.intValue}"/>
+ <include layout="@layout/merge_layout"
+ android:id="@+id/secondMerge"
+ bind:innerObject="@{outerObject}"
+ bind:innerValue="@{`goodbye ` + outerObject.intValue}"/>
- <!-- now a merge within a merge -->
- <include layout="@layout/merge_containing_merge"
- android:id="@+id/thirdMerge"
- bind:innerObject="@{outerObject}"
- bind:innerValue="@{`third ` + outerObject.intValue}"/>
- </LinearLayout>
+ <!-- now a merge within a merge -->
+ <include layout="@layout/merge_containing_merge"
+ android:id="@+id/thirdMerge"
+ bind:innerObject="@{outerObject}"
+ bind:innerValue="@{`third ` + outerObject.intValue}"/>
+ </LinearLayout>
+ </FrameLayout>
</layout> \ No newline at end of file