diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2016-09-28 18:15:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-09-28 18:15:36 +0000 |
commit | 33c0fd970325ee1ba47a68842bc20bb26506ddab (patch) | |
tree | 786321963eb728405d534a2ce853c4f02402f84b /compiler/src/main/kotlin/android/databinding | |
parent | 4107ce1c0155548b8ade493dcd43005d34220990 (diff) | |
parent | 2dc087b58747f726413ac62bd0b6fd43c1835a8f (diff) | |
download | data-binding-33c0fd970325ee1ba47a68842bc20bb26506ddab.tar.gz |
Merge "Add support for dependent bindable properties." into studio-master-dev
Diffstat (limited to 'compiler/src/main/kotlin/android/databinding')
-rw-r--r-- | compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt | 5 |
1 files changed, 3 insertions, 2 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..2da9367d 100644 --- a/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt +++ b/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt @@ -749,14 +749,15 @@ class LayoutBinderWriter(val layoutBinder : LayoutBinder) { block("switch (fieldId)", { val accessedFields: List<FieldAccessExpr> = it.parents.filterIsInstance(FieldAccessExpr::class.java) accessedFields.filter { it.isUsed && it.hasBindableAnnotations() } - .groupBy { it.brName } + .flatMap { expr -> expr.dirtyingProperties.map { Pair(it, expr)} } + .groupBy { it.first } .forEach { // If two expressions look different but resolve to the same method, // we are not yet able to merge them. This is why we merge their // flags below. block("case ${it.key}:") { block("synchronized(this)") { - val flagSet = it.value.foldRight(FlagSet()) { l, r -> l.invalidateFlagSet.or(r) } + val flagSet = it.value.foldRight(FlagSet()) { l, r -> l.second.invalidateFlagSet.or(r) } mDirtyFlags.mapOr(flagSet) { suffix, index -> tab("${mDirtyFlags.localValue(index)} |= ${flagSet.localValue(index)};") |