diff options
author | George Mount <mount@google.com> | 2016-09-28 19:21:41 +0000 |
---|---|---|
committer | George Mount <mount@google.com> | 2016-09-28 12:48:34 -0700 |
commit | e468b817509c5c7dd657a0cbc997452e1106aed8 (patch) | |
tree | aa194fa6a5d607d7eda7d4e11dfc2578a7eec05b /compiler/src/main/kotlin/android/databinding | |
parent | 83bcfb874866a2f6f74f7700fe2c67f0af2a3c20 (diff) | |
download | data-binding-e468b817509c5c7dd657a0cbc997452e1106aed8.tar.gz |
Re-adds "Add support for dependent bindable properties."
This reverts commit 729298e98a96730a9fbcf8c1d2575a8f0da7cc70.
This also fixes the build break caused by the added abstract
methods in ModelMethod and ModelField.
Change-Id: I4d7d5085a1a2e02ede0662591d8ccd79770c5fb3
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)};") |