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
njectedBindingClass.java
njectedBindingClassField.java
njectedBindingClassMethod.java
njectedClass.java
njectedField.java
njectedMethod.java
odelAnalyzer.java
odelMethod.java
|
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
njectedBindingClass.java
njectedBindingClassField.java
njectedBindingClassMethod.java
odelAnalyzer.java
odelClass.java
odelMethod.java
nnotation/AnnotationAnalyzer.java
nnotation/AnnotationClass.java
nnotation/AnnotationMethod.java
|
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
allable.java
odelAnalyzer.java
odelClass.java
odelMethod.java
nnotation/AnnotationAnalyzer.java
nnotation/AnnotationClass.java
|
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
allable.java
odelClass.java
nnotation/AnnotationAnalyzer.java
nnotation/AnnotationMethod.java
|
4ba16229a40e9758db86d4fb1df5119fdcb8aa2a |
22-Dec-2015 |
Deepanshu Gupta <deepanshu@google.com> |
Change from commons-lang3 to guava Change-Id: I1a18e06af7bf2d65228f1491663b6e096a9538ed
odelClass.java
|
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
dkUtil.java
nnotation/AnnotationAnalyzer.java
|
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
allable.java
odelClass.java
|
f01c66d7aaafd713de64b499c568f5870855dcd5 |
30-Sep-2015 |
Yigit Boyar <yboyar@google.com> |
Load full SDK table When loading methods from the SDK, we would only load methods that have since > Application.minApi. This way, we would keep the hash very small. On the other hand, this algorithm break if a newer API version adds a method that has the same signature with a subclass. This case happened when we added setForeground to View at API 23 but it has been in FrameLayout since 1. Bug:24509802 Change-Id: I7ac7ca5d1aac142a9afe8cd57ab9497dfb649650
dkUtil.java
|
bd42d20f70b1f88e27e3b3c9c3a9c55ec155d128 |
25-Aug-2015 |
George Mount <mount@google.com> |
Support generics in conversion parameters. Bug 23490384 Change-Id: I691da60a671d15c73cf2753ff830f9effb360e96
odelClass.java
nnotation/AnnotationClass.java
|
23ad7265de1729abdcda4fc3dbae5f7e6818c6ac |
24-Aug-2015 |
George Mount <mount@google.com> |
Fix access to static field of generic object. Bug 23491360 Change-Id: I94c62b67dfa8f8bd4c7f9fb5ab1adff4a927f77b
nnotation/AnnotationClass.java
|
91beb3a1a89a58b1c0b6b874d889394a3be90b6c |
06-Aug-2015 |
George Mount <mount@google.com> |
Fix ternary operator with null assigned to listener. Bug 22907244 When finding a common type, null is an Object and the listener is an interface, so the types don't match. Change-Id: I0c5a88ec02230767b894b2feda17a1a1c8cef9f7
odelAnalyzer.java
|
793e979f25e190162eacf46d6a4efc3efc1d2f91 |
31-Jul-2015 |
George Mount <mount@google.com> |
Support different event handlers having different API levels. Bug 22957226 Change-Id: Ia08bcb857872eccad3340c14b8d10b78198b90a6
odelClass.java
|
2611838bffef5a009ca71e3e9e59a93f29b098ed |
24-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Remove guava from compiler This CL removes all dependency from guava and replaces it w/ either plain java or some utilities. Bug: 22047836 Change-Id: I94be54ed992ab6b5f27c47a8cf400ae60aef02f8
odelAnalyzer.java
dkUtil.java
nnotation/AnnotationAnalyzer.java
|
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
allable.java
odelClass.java
odelMethod.java
nnotation/AnnotationClass.java
nnotation/AnnotationMethod.java
|
924fa7c597694ebc433fc0379d0015785351d1b7 |
23-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Fix compiler tests Compiler tests were broken after the parcelable change. JavaClassLoader cannot access Parcelable when resolving ObservableXX from the library. Compiler tests do not need to resolve Observables so in this CL I override the related method to avoid trying to load them. I've also removed the requirement to deploy a libraryJar from the library. Instead, compiler will directly include the library sources when it is being compiled for tests.
odelAnalyzer.java
|
d37b47419005587c52ca4c099432327b7f06478d |
19-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Make observables parcelable We got some feedback where people want to keep their View presenter classes parcelable. This CL makes observables parcelable and their lists transient to allow this. Bug: 21785040 Change-Id: I76adc7d7ca3876c83fd8749f6dbcf02a926c97c2
odelAnalyzer.java
|
0cb9fbb96197af013f4f879ed6cddf2681b88fd6 |
16-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Move shared code between build and compiler to a separate project This CL encapsulates the shared code between build time and annotation processing into a separate project. This project has no dependency on kotlin so we can easily use it in gradle plugin. Bug: 21815393 Change-Id: I9fd2e88885d06ff5423121747817ffcd056e8c74
nnotation/AnnotationAnalyzer.java
|
0d6e2b8ac5e9e8635adf95c4166dd26441c51997 |
13-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Fix public field resolution This CL fixes a bug where if a field is prefixed w/ one of our private field conventions, we would not be able to find it because we would strip it. Now, when searching fields, we'll also look for exact match as we do for methods. Bug: 21807334
odelClass.java
|
ec2f3896c21a504b464bf591cdb45b62692b6760 |
10-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Improve static method / field handling Previously, we would allow access to static fields via instance variables but it would not work for methods. Moreover, the behavior was not exactly the same with how java handles it. In java, the instance can be null but our binding code would not evaluate it if instance is null. This CL fixes these bugs by adding static resolution support to methods and replacing their variable identifiers with static identifiers while the method is being resolved so that the rest of the system is still consistent. Bug: 20412284 Change-Id: Id97ce564c312b97d5a0e60d7d7a5bbd06b131071
odelClass.java
|
b9e4aa96812692a7dcf468445e64bc5b30d3c79a |
19-May-2015 |
George Mount <mount@google.com> |
Better handling of generics in BindingAdapters Bug 21277338 Handle <T> adapter(View, T value) Also test and fixes to support View<T> with multi-attribute adapters. Change-Id: I12bda5b235111762b55357fed7f163ccaf83838d
odelClass.java
nnotation/AnnotationAnalyzer.java
nnotation/AnnotationClass.java
|
91d538470c011e19fa4375cc3531b5dd9ae01d55 |
15-May-2015 |
George Mount <mount@google.com> |
Fix generic setter on generic View. When a View is generic (e.g. MyView<T>), and a setter takes a generic parameter, the setter parameter didn't match the argument. Change-Id: I115ace5582b847bda792d75cf7aaf57ffc8bd4cd
odelClass.java
nnotation/AnnotationClass.java
|
5f3aae011cc291c2abbb90215c2e6f89a5f2626d |
13-May-2015 |
George Mount <mount@google.com> |
Give an error if attribute is used when no setter is available. Bug 20979710 This only prevents invalid setter calls for Views, not for Bindings, such as used with includes.
odelClass.java
|
d33691a5725244f1bb5c4491af81b9fc67e0f39f |
28-Apr-2015 |
George Mount <mount@google.com> |
Support using aliased classes as outer classes. Bug 20350624
nnotation/AnnotationAnalyzer.java
|
d7adbdab48fb8f894cb59073b864da8f5bafb8a9 |
20-Apr-2015 |
George Mount <mount@google.com> |
Fix merge failure.
odelClass.java
|
11e3c78221d957e86be098255ccd0f8f28280cff |
20-Apr-2015 |
George Mount <mount@google.com> |
Merge changes If9ddfd09,I310535e6 * changes: Support array length. Added some missing expressions.
|
8ec9696461abb5ad0b95024edc3f3ccb9ace85be |
17-Apr-2015 |
George Mount <mount@google.com> |
Support array length. Change-Id: If9ddfd09d7becc504741b8dd4f91332de944bfe1
odelClass.java
|
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
allable.java
odelClass.java
|
ee7586713d68806b556a425cbebf007a56261ff3 |
17-Apr-2015 |
Yigit Boyar <yboyar@google.com> |
Add 3rd party licenses to fatJar This CL adds 3rd party licenses to compiler-fatJar so that we can use it in our build process w/o maven dependency. It also removes dependency on SDK folder for api level lookup by shipping versions.xml file with the bundle. It adds a new gradle task, preparePrebuilds, which bundsles all necessary builds to a prebuild folder which should be committed. These pre-builds will be used by the makefile to support make builds. Bug: 19945740 Change-Id: I0bba72bbb13770aba94317301217ddd842211e2d
odelClass.java
dkUtil.java
|
de38dd3ef0577d25b2d59863603abe5750d0c231 |
28-Mar-2015 |
George Mount <mount@google.com> |
Make ViewStub support binding variables like include. Bug 19969378
odelAnalyzer.java
odelClass.java
|
fead9ca09b117136b35bc5bf137340a754f9eddd |
23-Mar-2015 |
George Mount <mount@google.com> |
Move to package android.databinding.
allable.java
odelAnalyzer.java
odelClass.java
odelField.java
odelMethod.java
dkUtil.java
ypeUtil.java
nnotation/AnnotationAnalyzer.java
nnotation/AnnotationClass.java
nnotation/AnnotationField.java
nnotation/AnnotationMethod.java
nnotation/AnnotationTypeUtil.java
|