78dc9ae6d67ae94bf3f637eeea0848e4f700b7a3 |
21-Apr-2016 |
George Mount <mount@google.com> |
Fix problem where root View's style is used instead of bound View's Bug 27808662 Change-Id: I870b0db47e3ed970a3bd67e602e873e503610028
ynamicUtilWriter.kt
|
f58c3bd412f9bdc5ec589fdcfed470889abb6ea6 |
26-Mar-2016 |
Yigit Boyar <yboyar@google.com> |
Fix expression evaluation problem This CL fixes a bug in expression evaluator where we would elevate a conditional dependency by mistake when it is not read completely. This was caused by marking bit paths as read in the same cycle. There is still a potential bug in the code path where we detect a variable would've already been calculated for a dependency to be calculated (e.g. a ? a : b) but this change is a fairly safe compared to making a big change in that logic. Bug: 895468 Change-Id: I60a704a59c3b5b8e4f833f060c6233d356dab6c8
ayoutBinderWriter.kt
|
11df39c91611b9ff2d7c87a9a9829251a015bccf |
16-Mar-2016 |
George Mount <mount@google.com> |
Added simple inverted String conversion. When binding a primitive to an EditText, a common pattern is to use '@{"" + value}'. This, however, doesn't allow for a two-way data binding expressions. To mitigate the need for conversion functions, a simple inversion for this expression wsa implemented that just converts value from a String when possible. This CL also fixes a bug in which a method matching the first parameter was always chosen, reguardless of the second and further parameters. Change-Id: I36828d9f54d2073965358fceb140b2d5e6328919
ynamicUtilWriter.kt
|
c0c1dab0b6254e4d27f18c37a72a9e7952e958a0 |
02-Mar-2016 |
George Mount <mount@google.com> |
Support for java 8 method reference syntax. Bug 26937350 Our event handling syntax is obj.method, where java 8 uses the syntax obj::method. This adds support for the java 8 syntax and adds a deprecation warning for the old syntax. Change-Id: Ideb0570c2646f674da031f642ed3369e8c5fcd3b
ayoutBinderWriter.kt
|
bb4a033fcd5cd20e5be46ef8ead442dc7db2454d |
18-Feb-2016 |
George Mount <mount@google.com> |
Have two-way binding use localized variables to prevent NPE. Bug 26962999 Two-way binding was using the inverted expressions directly without localizing variables. That meant that if there was a variable set to null during evaluation, it may get a NullPointerException even though it checked for null on the value previously. This CL localizes the variables so that cannot happen. Change-Id: Ia55955ce0f1cb750e6a678e72e0cda03f0e3c9b6
ayoutBinderWriter.kt
|
6047998943beebd81e0ae1068df39c0cbee38628 |
02-Feb-2016 |
Yigit Boyar <yboyar@google.com> |
Lambda In da house This CL adds support for assigning callbacks to listeners using lambda expressions. These expressions can receive either 0 or N arguments where N is equal to the number of parameters in the callback function. These expressions are evaluated when the callback is invoked. In other words, they are independent from the rest of the ExprModel except the Identifier expressions. Since these are limited to 1 full expression and they don't have any invalidation flags; we use a verbose branching code generation mode where we calculate all possible execution paths, eliminate trivial ones and generate the code. This allows callbacks to be thread safe as well. See ExecutionPath class for details. It is not efficient but since these are rere occasions, should be OK. Callback expressions are still forced to be expressions that return value. To handle `void` case, I've added `void` and `Void` as acceptable symbols. Also, if the callback method returns void, the expression is free to return `void` or any other value. ¯\\_(ツ)_/¯ I've also moved kotlin to rc0. Although rc0 is unrelated to this task, it made more sense to upgrade here because most changes it will ask for were already done in this branch. Bug: 26849440 Change-Id: I805b3d470f85df9c2ce3f3ed5ca74925a08bb7a5
RWriter.kt
ataBinderWriter.kt
Code.kt
ayoutBinderWriter.kt
|
af146d6a8c0efcf5682d14047c06866a5548f78f |
22-Jan-2016 |
Yigit Boyar <yboyar@google.com> |
Update data binding to kotlin beta 4 I've also run some cleanup inspections to keep codebase more up to date. Bug: 26738574 Change-Id: I02aa43157cad858c0ea60dd41a22150e3cf2cfa1
ataBinderWriter.kt
Code.kt
ayoutBinderWriter.kt
|
39113ca579a3d4e1c24e204f102e6dc9b26125af |
20-Jan-2016 |
Tor Norbye <tnorbye@google.com> |
Update Kotlin code to be beta 4 compatible Change-Id: I96ab85fd9ec3d857929055b804fd094a4e3d245c
Code.kt
ayoutBinderWriter.kt
|
99d74030fe5856572bd4b569bc04d2a11258f202 |
14-Jan-2016 |
George Mount <mount@google.com> |
Fixed warning when using a color resource. Bug 26254496 Change-Id: Ied6b942fada3a99ec331ad59f2f5ee6e6c33a20b
ynamicUtilWriter.kt
|
d3f2b9229472c9dae9bf4ae8b3e2d653b5653b01 |
17-Sep-2015 |
George Mount <mount@google.com> |
Two-way binding Bug 1474349 Bug 22460238 This adds two-way data binding for those attributes on Views that also have event listeners for them. General use is also supported, but event listeners are required to notify when those properties change. Change-Id: Iedc66a604257930265f9d661f69658a0a0c3208b
Code.kt
ayoutBinderWriter.kt
|
4ba16229a40e9758db86d4fb1df5119fdcb8aa2a |
22-Dec-2015 |
Deepanshu Gupta <deepanshu@google.com> |
Change from commons-lang3 to guava Change-Id: I1a18e06af7bf2d65228f1491663b6e096a9538ed
RWriter.kt
Code.kt
|
0b6d118e6eeb3bc100fc6a6e66016ab812cb2783 |
04-Dec-2015 |
Yigit Boyar <yboyar@google.com> |
Avoid re-reading variables. This CL fixes a bad code generation where we would set a variable to itself, which breaks if you use a tool like ErrorProne. I've also updated gradle version and data binding versions. Bug: 25077399 Change-Id: I6620faf4cad5fa74dc7c35be03c46c4a76c9cfbc
ayoutBinderWriter.kt
|
90004de4330158be2351b9e26ba951f2ccbccfce |
14-Nov-2015 |
George Mount <mount@google.com> |
Don't use DynamicUtil now that 1.0-rc5 has been released. Change-Id: I017049ba3fb3c0d66982f504192d6a2814859f9a
ynamicUtilWriter.kt
|
59229481aec5a284d322a2ca80dff836485feb0c |
30-Oct-2015 |
Yigit Boyar <yboyar@google.com> |
upgrade kotlin to 1.0-beta1 Change-Id: I62b77fd118e2715d272a16d96b9083d2347f5fb1
RWriter.kt
ataBinderWriter.kt
Code.kt
ayoutBinderWriter.kt
|
83a8c9d56cba07985d611ce7df47346b94742336 |
23-Oct-2015 |
George Mount <mount@google.com> |
Add targetSdk check for DynamicUtil. Change-Id: I271b3fc364c2d8689f22e0555174a8ca30bc04b5
ynamicUtilWriter.kt
|
9784c9aaedeb863018f5fcaa0a598e8e2f8ed2f3 |
13-Oct-2015 |
Yigit Boyar <yboyar@google.com> |
Data binding as studio dep + java6 This CL gets rid of the gradle plugin and instead provides DataBindingBuilder for the gradle plugin to directly use. Now, everything that is deployed via SDK Manager (lib and adapters) are included as prebuilts so that we avoid accidently changing them w/o an SDK manager release. There is still work to do: > re-enable proguard for externel dependencies > release a batch to ensure everything works Bug: 22516688 Change-Id: I83ace15bd6d3d23bf5b4ad850f36453dd23ebd43
RWriter.kt
Code.kt
ayoutBinderWriter.kt
|
012f7781add1b38b28c0c68a94172715e635c00e |
23-Oct-2015 |
Yigit Boyar <yboyar@google.com> |
Avoid deprecation warnings in DynamicUtil Change-Id: I2c7b5321bdfc7e3932a691cf724b9bd79edff471
ynamicUtilWriter.kt
|
bdc7aa8269502b3fc3ce73c124e4f1b2092502c9 |
23-Oct-2015 |
George Mount <mount@google.com> |
Use a dynamically-generated class to relax requirement to upgrade. We may need some static methods between releases and instead of requiring a release, we can now supply the methods as a dynamically generated class, DynamicUtil Change-Id: I9d53ae99b4b5717cd4780efdcb7a3f85bfac8dd9
ynamicUtilWriter.kt
|
88ce44ccc65e74a8553244ca246cc9f4c48483e0 |
15-Oct-2015 |
Yigit Boyar <yboyar@google.com> |
Create BR id from Callable This CL fixes a bug where if an expression maps into a method with a different name, we would create the BR id from the expression instead of the referenced method. Bug: 24973950 Change-Id: Ia57c31d926a737c9fc84775780aeb5e617769d43
ayoutBinderWriter.kt
|
09aeb26073fc8a98263806f53e44819ebe5046c6 |
09-Oct-2015 |
Yigit Boyar <yboyar@google.com> |
Handle constant predicate in ternary If a ternary expressions's predicate is constant, we would never evaluate it which means we would never evaluate the ternary unless some other expression depends on it. This CL changes ExprModel to move such constant expressions into pending list so that they can be evaluated + necessary flags are set. We can actually avoid this process by replacing TernaryExpression with something else when this case is detected but that would be a bigger change and not safe shortly before the release. Hopefully, codegen logic will be refactored into a more well defined process. Bug: 24768154 Change-Id: I0918568414b64d64f070978f1f8e77cc3b6c85fd
ayoutBinderWriter.kt
|
d3dc1b70aa71e8343dbf5e05a2feeb72bb29b6ec |
08-Oct-2015 |
Yigit Boyar <yboyar@google.com> |
Fix tag check in data binding mapper This CL fixes a bug in data binding mapper where if the View's tag does not match one of the expected tags, it would fall through to the ext case statemet which would result in a meaningless error. This CL detects the case and throws an exception. This case should not happen since it is not a supported case but happened here due to another bug Bug: 24745000 Change-Id: Ic5c6d4ce2da6ad043fb6fe56cd0847c98ea2472d
ataBinderWriter.kt
|
cecfe2b01c96246ff05c40a43f5fc73b92382047 |
28-Sep-2015 |
Yigit Boyar <yboyar@google.com> |
Remove log method Change-Id: I92a80a21ef5f466e84b22c3bbf1132ea56819f4b
ayoutBinderWriter.kt
|
5d454e5f2397a3b160f081ce123b4ca7ff0fc356 |
19-Sep-2015 |
Yigit Boyar <yboyar@google.com> |
Upgrada kotlin to m13 Change-Id: Iec30be0e153f7354d4909970be4292fcf11988bf
Code.kt
ayoutBinderWriter.kt
|
eebcbdd5d35e56a2c8ef37feeb65df46130d001d |
26-Aug-2015 |
Yigit Boyar <yboyar@google.com> |
Fix the bug about marking expressions as read early @{obj4.text} @{obj4.useHello ? obj4.text : `hello`} This case was broken and would not re-read obj4.text if only obj4.useHello is invalidated. It was partially fixed in Change-Id: Id449c8819b8dc0301a7ab893002478914780d480 but but it was bringing it down to exact equality which would mean we could fail to mark sth as read. The coverage logic we use in expressions when marking them as read was giving false positives, which results in marking expressions as read before they are fully read. This CL fixes that bug. The safe fix introduces some false negatives when a conditional is behind another conditional. We can address this post v1. There was also another bug about setting conditional flags even though the ternary does not need to be calculated. @{obja.boolMethod(a)} @{a ? objb.boolMethod(b) : objc.boolMethod(c)} When obja is invalidated, it would re calculate the second binding expression too even though it is never used (because that expression is not invalidated). The re-calculation would happen because we would calculate the value of `a` and set the conditional flags w/o checking invalidation. This would result in unnecessary calculations. I've also fixed it for first degree where the ternary is not under another ternary. The proper fix would requires bigger effort, post V1. bug: 22957203 Change-Id: Ib73f31eac358f2ad7652395a021baaa93b79adf7
ayoutBinderWriter.kt
|
23910cf498c35704a03ba4f3889de2ab97ccbe21 |
25-Aug-2015 |
George Mount <mount@google.com> |
Make setVariable return true for declared variables. Bug 23518718 Change-Id: Ic147421aefe0adbf576285ca642334fcb907abfb
ayoutBinderWriter.kt
|
9e7a4ce47ae5f4428f7630fe03a7ad66d06177fb |
24-Aug-2015 |
George Mount <mount@google.com> |
Reduce updateRegistration calls on rebind. Change-Id: Icc9a38acb0398d6eb2c516e7edef506e46b9710b
ayoutBinderWriter.kt
|
92a428505b9102bc0560d2d5be1768da097909c2 |
06-Aug-2015 |
George Mount <mount@google.com> |
Support binding expressions in android:tag attribute. Bug 22972105 Also added error reporting for tags on root elements and tests. ICS+ supports tags on root elements. Change-Id: I1f3fe5e59b68a04fd80e3e2638a7b7743fac027d
ayoutBinderWriter.kt
|
793e979f25e190162eacf46d6a4efc3efc1d2f91 |
31-Jul-2015 |
George Mount <mount@google.com> |
Support different event handlers having different API levels. Bug 22957226 Change-Id: Ia08bcb857872eccad3340c14b8d10b78198b90a6
ayoutBinderWriter.kt
|
a0820baa03e731f274ef55c5541e9fc101bbaddb |
03-Aug-2015 |
George Mount <mount@google.com> |
Combine like conditions for efficiency. Bug 22957163 Change-Id: If35430c966900ff9af56375152441e28066a4c89
ayoutBinderWriter.kt
|
e52882df6130221462bf07f5f2b52de5c4b0f8de |
30-Jul-2015 |
George Mount <mount@google.com> |
Move toCode to Expr classes. It turns out that toCode as part of Java is just about as readable as in kotlin and it makes much more sense than using instanceof (equivalent). Change-Id: Ic2a0de5c4376dafa487d048e6a9420fab9e7f22a
odeGenUtil.kt
ayoutBinderWriter.kt
|
e4cd38824a6627b9fef229c549c636e35ad63b5f |
07-Jul-2015 |
George Mount <mount@google.com> |
Support dependency injection. Bug 22389109 Change-Id: Iec63375c5412edc03b4808ee129a7596b61bf9e6
ataBinderWriter.kt
ayoutBinderWriter.kt
|
4df4ba38a62b791bbbc25e923efe8d9c2f9a52e9 |
27-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Data binding startup improvement This CL replaces how we map tags(string) to layout ids in the generated DataBindingMapper class. Previously, we would create a hashmap which was some unnecessary work in startup. The alternative was using switch(string) but we did not want to require java 7. This CL does what java 7's switch(string) would do thanks to the well defined API of String.hashCode. This CL also adds a method to DataBindingUtil to convert BR.ids back to String for debugging purposes. Bug: 22108735 Change-Id: I4b8ef816f4aac99b2963793dd46519b056ce4a30
RWriter.kt
ataBinderWriter.kt
|
1b506ae96dc762ac027104248807ca3ae078711d |
30-Jun-2015 |
George Mount <mount@google.com> |
Merge "Fix bug preventing use of android IDs for Views." into mnc-dev
|
fdfbbcd5ecf37d77a4b9ab1cefdebd68de71ca2b |
30-Jun-2015 |
George Mount <mount@google.com> |
Fix bug preventing use of android IDs for Views. Bug 22160629 Change-Id: Ib0a2b6d5333e63e25045ccf39a5582e1d74494df
ayoutBinderWriter.kt
|
239e15adad52d3a7d77852953a5dd7eee82f7f2c |
26-Jun-2015 |
George Mount <mount@google.com> |
Don't use array of protected static classes in Binding classes. Bug 22097806 Because of bug 15719206, arrays of protected inner classes may not be used with multi-dex'd applications. The arrays were moved to the protected class. Change-Id: Icb030f2139c763238028ff73eab53502c74edb88
ayoutBinderWriter.kt
|
716ba89e7f459f49ea85070d4710c1d79d715298 |
18-Jun-2015 |
George Mount <mount@google.com> |
Support calling listener methods without interfaces. Bug 21594573 It is convenient to be able to assign event listeners by just referencing a method, similar to the way onClick="handler" works. This adds a whole lot of listeners for the framework. Additional listeners must be added for support library components. This isn't perfect in resolving listeners. Perfect resolution requires that each expression is evaluated in its own context within the binding statement. If, for example, the same method name is used for a listener and an accessor, we will assume that the listener is used always and there will be a compilation failure. Change-Id: If4705122b67a451430451b6e7d890eb813af1c5c
odeGenUtil.kt
ayoutBinderWriter.kt
|
8b1da958f181639d33dfaa907c0ee66add2decd6 |
23-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Don't generate inflators for libraries If a library project (A) depends on anohter library project (B), we would generate code that accesses R file of project B while compiling project A. Unfortunately, gradle does not generate that R file when compiling A, it only exists when compiling the app and B. This CL changes the base class generation to not to generate real code for base classes unless we are building the final app. Bug: 22001270 Change-Id: Ic107001ab58c94016f37f7f6fc0470a822db3aa7
ayoutBinderWriter.kt
|
20c7182163d99575d382e065f5a5fe45ed6b87e2 |
12-Jun-2015 |
George Mount <mount@google.com> |
Support old values in binding adapters. Bug 21594573 When a binding adapter takes old values, the old values are stored in the generated binding as fields. Change-Id: Ib163d74720a8199d70ff6884d59fbe4e0d17fece
ayoutBinderWriter.kt
|
d6527ee28cc3aa05818799af8def9593346f91bc |
15-Jun-2015 |
George Mount <mount@google.com> |
Remove fragment data binding. Fragment data binding is much more complex than the previous implementation supported. It may be that we don't want to support data binding to fragments because fragment life cycle differs from View life cycle, including back stack support. I made it so that fragments with IDs do not get public final fields on the generated data binding objects. Bug 21667601 Change-Id: Ief77972ea854f7ded5a93aa59822d76ef533fc21
ayoutBinderWriter.kt
|
2f64c44e4fa296cf658ca986c095eab62f82a31d |
11-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Request a rebind when invalidateAll is called Bug: 21785116 Change-Id: I79b886df1f016a8abe87723876502adfe1843897
ayoutBinderWriter.kt
|
81abdb7df8c6507e8246dd7c784e363b46fb9f5c |
11-Jun-2015 |
George Mount <mount@google.com> |
Merge "Support data binding for fragments." into mnc-dev
|
4d4979490e1fa374c0d7f3599fed0a9e83a579d0 |
08-Jun-2015 |
George Mount <mount@google.com> |
Support data binding for fragments. Bug 21667601 Change-Id: I636dec1bbb5567d70a996e115e6bf8322c3aa29d
ayoutBinderWriter.kt
|
fda1703c88eb22e9f166d957d6bda2cd8d645b8f |
11-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Upgrade kotlin to 0.12.412 Bug: 21756156
odeGenUtil.kt
Code.kt
ayoutBinderWriter.kt
|
c4a07bddb4dd5c3bfbecf4d87909c5b447ae56dc |
05-Jun-2015 |
George Mount <mount@google.com> |
Only create case statements for Bindable attributes. Bug: 21571818 Change-Id: Id03c7a7de6e39d7f59da6cda11d3311f072addd0
ayoutBinderWriter.kt
|
081ec223f1f2f801bd907ec6344b0c6aeee133e5 |
05-Jun-2015 |
George Mount <mount@google.com> |
Fix inflate() to support attachToRoot = true Bug 21660713
ayoutBinderWriter.kt
|
4a81aabc49f6c881d960cd541adda7de9625277a |
27-May-2015 |
Yigit Boyar <yboyar@google.com> |
Localize variables Generated sources should localize variables to avoid NPE's due to setting variable to null in a background thread. Bug:21447037
ayoutBinderWriter.kt
|
b1356339eaa6c8e967e4fc1dc283b82909a1208d |
22-May-2015 |
Yigit Boyar <yboyar@google.com> |
Merge projects for an easier release This CL merges annotation processor, xml grammer and grammer builder into compiler project. It also adds logic to pass gradle's --debug parameter to the annotation processor so that we can grab logs when necessary. Bug: 21327802 Change-Id: I1d07002519a6b95de3cdc0891bd00f461f73e8ea
ayoutBinderWriter.kt
|
7b07818f07c28c6dec34ca2a9ab5f61e86afb493 |
20-May-2015 |
Yigit Boyar <yboyar@google.com> |
Handle inter-expr dependencies properly We had a bug where we would never be able to solve a case if there are two expressions that trigger a circular dependency. a ? b : c b ? a : d We actually had some logic to partially elevate conditional dependencies but there were two issues with it: * LayoutInflator was caching shouldReadFlags permanently * There was a bug in how we resolve whether all potential evaluation paths are covered. (we were not using a cloned bitset but rather updating the original). I've fixed these two issues and added logic to partially elevate conditional expressions if they cannot be marked as fully read. Bug: 21324645 Change-Id: I779afb6dae48920196404d3cfbb5f8774686404d
ayoutBinderWriter.kt
|
8533f27db6c31b0c295ae62d314dbf07ea640571 |
19-May-2015 |
Yigit Boyar <yboyar@google.com> |
Properly handle constant binding expressions Previously, we would assign each binding expression a flag id even if it is constant. This was necessary to be able to implement invalidateAll. Later, we've changed how invalidateAll works and assigned it a separate flag. Unfortunately, we were still incrementing ids for such binding expressions, causing index out of bounds exceptions during code generation in certain situations. This CL fixes that bug and does not add flags to constant binding expressions anymore. Bug: 21284295 Change-Id: I114bf34520d0b246426ce7d45b8c511cf6709778
odeGenUtil.kt
|
4cc84854a6a5e8eca4ba1cfe574d5a8092b598d6 |
15-May-2015 |
George Mount <mount@google.com> |
Remove unused getId from DataBinderMapper and BR.java
ataBinderWriter.kt
|
b60b44478336f8e6bdd7650d19299ef73fee24ba |
13-May-2015 |
George Mount <mount@google.com> |
Merge "Fix bad arg to inflate."
|
f80b08430f11515ff944f89006799f21545602b9 |
13-May-2015 |
George Mount <mount@google.com> |
Fix bad arg to inflate.
ayoutBinderWriter.kt
|
447971abca811b11b8c1d8e7bfaa294856d03c16 |
09-May-2015 |
George Mount <mount@google.com> |
Block executePendingBindings when there are no changes. Change-Id: I427877749aa00a14c7c8b9363d6a9027ce48219e
ayoutBinderWriter.kt
|
e9b33bac04bb1ce1444d7f1744fcec1ecd3a57da |
30-Apr-2015 |
Yigit Boyar <yboyar@google.com> |
Support multi-param adapters in code generation Bug: 19800022 Change-Id: I40c4ac72f24f965db12fd1c7dec6591184160ae5
odeGenUtil.kt
ayoutBinderWriter.kt
|
ed6428586a939e00d9e66314d5cf1056ad48767e |
30-Apr-2015 |
George Mount <mount@google.com> |
Add static method to get ViewDataBinding for a View. Bug 20676836 Change-Id: I8690f64b395ceb06fd12daaadcb0f31d6629fc0b
ataBinderWriter.kt
ayoutBinderWriter.kt
|
9bdb2415487832e88a05c7bd19391b05440b468e |
29-Apr-2015 |
George Mount <mount@google.com> |
Change from using Context to LayoutInflater for inflate() When inflating, it is more efficient to use the LayoutInflater directly instead of getting it from the Context. I also changed DataBindingUtil.bindTo to bind to match the static method call in the Binding classes. Change-Id: I855297a4f081102c49ea477047c0ac81de1676f5
ayoutBinderWriter.kt
|
05196a205cdf3e074a452ba5a191c4e2a8e0b02f |
29-Apr-2015 |
Yigit Boyar <yboyar@google.com> |
Merge "Sync dirty flags"
|
e725f0d81e1b07e88f819be9a82181eeeb680dbf |
27-Apr-2015 |
George Mount <mount@google.com> |
Add listener to notify and disable rebinding. The OnRebindListener allows the developer to be notified when a reevaluation of the data binding is going to occur. It also allows the developer to stop the reevaluation and manually control when it will happen. Change-Id: Id6cba294dc5d354a885303cdcd72471ccc57f056
ayoutBinderWriter.kt
|
1c44adacab2c1baa937a604da136024f1e92a088 |
29-Apr-2015 |
Yigit Boyar <yboyar@google.com> |
Sync dirty flags This CL makes dirty flag tracking thread-safe Bug: 20664668
ayoutBinderWriter.kt
|
11e3c78221d957e86be098255ccd0f8f28280cff |
20-Apr-2015 |
George Mount <mount@google.com> |
Merge changes If9ddfd09,I310535e6 * changes: Support array length. Added some missing expressions.
|
c6bcb7bf9cab139b3141c4644e5b3267deed5213 |
20-Apr-2015 |
George Mount <mount@google.com> |
Added some missing expressions. unary: +/-/~/! shift: >>/>>>/<< logical: &&/|| bit: &/|/^ instanceof Change-Id: I310535e67c8fda2f067a62079e1b609a11bda741
ayoutBinderWriter.kt
|
019c36b97c7c172ac03997f6bf170e65b2ed7fe4 |
17-Apr-2015 |
Yigit Boyar <yboyar@google.com> |
Fix how final fields are handled There was a bug in Expression analyzer where if a field is final, it would return dynamic=false although its parent is dynamic. This CL changes that behavior such that if the parent of a field access is dynamic, then field access is dynamic unless it is static & final. If parent is not dynamic, (e.g. android.view.View) field is dynamic if an only if itself is dynamic. This CL also fixes another bug where if you have a bunch of expressions none of which can be invalidated, there would not be any flags to set thus we would not generate proper if statements. We were resolving tree properly but code-generation never worked in that situation. To overcome this issue, since there should always be a way to invalidate all bindings, I've added a flag to invalidate all, which is automatically included in each invalidate flag set. This does not bring any serious cost because we have flag inheritance in the generated code. I've also removed some code from LayoutBinderWriter that may create duplicate names. This was failing a test where a variable and View were given the same names. I changed these name uniqueness to be scope based so that we can create most readable w/o sacrificing correctness. Bug: 20341011 Change-Id: I0e98a5e28f250c36ae5de306f5ed99adffd20b59
ayoutBinderWriter.kt
|
7ff60c24c6de7ba0c674fe65a82ad4a88dab2e5d |
13-Apr-2015 |
George Mount <mount@google.com> |
Delay evaluating the View and Binding class names. Binding and View class names should be evaluated when processing the binding expressions, not during layout XML processing. Allow alternate binding class names as declared in layout XML. Use "binding_" as a prefix for binding tags instead of "bindingTag" Preparation steps for customized data binding classes. Change-Id: If08de28aad06401e8a5d461341b2616e17498aa1
ayoutBinderWriter.kt
|
96e1c821dd446d1ed78f8ae61131550588f60a24 |
10-Apr-2015 |
George Mount <mount@google.com> |
Support merge tags. This also drops the requirement for include tags to have an ID. Each root view tag is given a numeric suffix, starting with 0. Merge tags can have multiple roots, the first of which always is suffixed with 0. The remainder have tag identifiers that are interspersed with the tags used with expressions. The numeric suffix is used to identify the View in the mapBindings call. Include tag information now uses the tag of its parent so that its parent will search for the includes within it. When mapBindings is looking at the parent, it looks for all direct children with the appropriate tag of the format "layout*/name_0". Then it searches for all siblings with the same prefix and different numeric suffixes. Any that are found are considered part of the same merged include. If it finds another with _0, it knows that a new include was found. Change-Id: Idd1144d9037648193724667320744bd079791476
ataBinderWriter.kt
ayoutBinderWriter.kt
|
f3157e94d415c1723be2535eec830f19db6a65a9 |
07-Apr-2015 |
George Mount <mount@google.com> |
Fix merge error.
ayoutBinderWriter.kt
|
0390898cf7c4fcad255e8cfd6802f722b516cb2c |
03-Apr-2015 |
George Mount <mount@google.com> |
Use layout path for the tag on bound layout roots. Change-Id: I6bda5d5716e749251b27c112865da066ba908509
ataBinderWriter.kt
|
d8c8ec27ed2ec0b11fa37f476395ce27834471f0 |
05-Apr-2015 |
Yigit Boyar <yboyar@google.com> |
Fix ternary handling and generate better code This CL fixes an issue about ternary expressions where a ternary expression would be evaluated with its last evaluated dependency. This would create a problem where ternary expressions would not be evaluated if other branch of the conditional is chosen, This bug is fixed by checking outher flags such that we'll still calculate it together if all dependencies are behind the same flag vs we'll calculate it independently if its dependency flags are different. This CL also improves the generated code in two ways: - When there is an if inside if, we don't add flag check (the if) if all of its conditions are covered in the parent if. - I replaced flag names with binary values. This looks more readable then generated names. Bug: 20073197 Change-Id: I9d07868206a5393d6509ab0a205b30a796e11107
ayoutBinderWriter.kt
|
74f72d77b1db2b78ee6422da2ec94de12edcb6dc |
27-Mar-2015 |
Yigit Boyar <yboyar@google.com> |
Fix bugs related to how we handle Ternary ops This CL fixes two bugs. 1) When a Ternary operation was inside another operation, we were not handling dependecies properly and model would think that the container expression can be evaluated before Ternary is evaluated, eventually causing an exception in code-gen because Ternay is not calculated yet. 2) This also fixes another bug where when ?? is used, we would put ifTrue and ifFalse statements in wrong order and eventually evaluate !??. Bug: 19939148 Change-Id: I3e1d2bee172e47412bb8ef9e7c785aef47337155
ayoutBinderWriter.kt
|
e7c2a5e45d7651899790bd347da635875f9c73fb |
02-Apr-2015 |
George Mount <mount@google.com> |
Use setTag(id, val) when minSdk is ICS and later. setTag(id, val) leaks on versions before ICS. When the minimum SDK is before ICS, setTag(val) must be used for bindings. However, this prevents the developer from using the tag for his or her own purposes. Therefore, if the minimum SDK is ICS and greater, setTag(id, val) is used. Change-Id: I46327084bde4bafc05a64f82ad5ebcf710820ecc
ataBinderWriter.kt
|
125f08f32dbe73b457768aeca4accfbc44dd44b6 |
01-Apr-2015 |
George Mount <mount@google.com> |
Don't use reflection for DataBinderMapper. By having a concrete implementation of DataBinderMapper in the library and then stripping it out, the generated DataBinderMapper may be instantiated without reflection.
ataBinderWriter.kt
|
95d1b38adeb5963ec5337e7dd6177b4bb5a03619 |
01-Apr-2015 |
George Mount <mount@google.com> |
Capture views with IDs and no expressions in Binding. We want to get all Views with IDs in the Binding to save the developer effort in calling findViewById. Change-Id: Ib7dd85ae9ecc0fd31b235364c0eadc2303dd1780
ayoutBinderWriter.kt
|
dea555cf42dc3583604699c8c018d22681f56166 |
30-Mar-2015 |
George Mount <mount@google.com> |
Merge implementation into base class for single implementations. Bug 19933646 Change-Id: Ifc947d929b5275e32598e8d40f0122504a99d7f8
ataBinderWriter.kt
ayoutBinderWriter.kt
|
61630faa88ee4817834d47294a0e17f19d8e1c51 |
30-Mar-2015 |
George Mount <mount@google.com> |
Require only one pass to make BR.java file. Bug 19985005 Because the generation of Binding files created @Bindable annotations, the BR file generation had to wait until a second annotation pass. This caused errors to be generated that were later cleared, causing confusion. I moved the BR file generation to the same annotation processing stage that generates the Binding files to clear up the error generation. TODO: merge the annotation processing stages so that there is less cross-talk between annotation processors.
ayoutBinderWriter.kt
|
de38dd3ef0577d25b2d59863603abe5750d0c231 |
28-Mar-2015 |
George Mount <mount@google.com> |
Make ViewStub support binding variables like include. Bug 19969378
ayoutBinderWriter.kt
|
34a18e6a231f3b64726bd93e7e097a0d5a75995d |
26-Mar-2015 |
George Mount <mount@google.com> |
Move to public final fields instead of getters for Views. Bug 19933644
ayoutBinderWriter.kt
|
fead9ca09b117136b35bc5bf137340a754f9eddd |
23-Mar-2015 |
George Mount <mount@google.com> |
Move to package android.databinding.
ataBinderWriter.kt
Code.kt
ayoutBinderWriter.kt
|