summaryrefslogtreecommitdiff
path: root/compiler/src/main/kotlin/android/databinding/tool
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2016-10-07 15:24:08 -0700
committerGeorge Mount <mount@google.com>2016-10-07 15:24:08 -0700
commita3609f862d55f63ce610a8cd34f23f2e9ce3491a (patch)
tree83164ecf25fd56d741b80edcc22c503706006f92 /compiler/src/main/kotlin/android/databinding/tool
parent83bcfb874866a2f6f74f7700fe2c67f0af2a3c20 (diff)
downloaddata-binding-a3609f862d55f63ce610a8cd34f23f2e9ce3491a.tar.gz
Get tag resources from field instead of root.
Bug 32025490 Previously, root.getResources() was being used to get the tag strings from resources. With merge tags, root is an array, not a View. So, instead, the value is pulled from the View's getResources(), which should work better for styles as well. Change-Id: I03863609151a1242c034f1b353860368332883a4
Diffstat (limited to 'compiler/src/main/kotlin/android/databinding/tool')
-rw-r--r--compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt b/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt
index 3820084d..342b6de8 100644
--- a/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt
+++ b/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt
@@ -545,7 +545,7 @@ class LayoutBinderWriter(val layoutBinder : LayoutBinder) {
}
val slashIndex = originalTag.indexOf('/')
val resourceId = originalTag.substring(slashIndex + 1)
- tagValue = "root.getResources().getString($packageName.R.string.$resourceId)"
+ tagValue = "this.${it.fieldName}.getResources().getString($packageName.R.string.$resourceId)"
}
}
tab("this.${it.fieldName}.setTag($tagValue);")