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
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.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
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.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
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
59229481aec5a284d322a2ca80dff836485feb0c |
|
30-Oct-2015 |
Yigit Boyar <yboyar@google.com> |
upgrade kotlin to 1.0-beta1 Change-Id: I62b77fd118e2715d272a16d96b9083d2347f5fb1
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
975c05c00dae9193a636c4775df81d8665fc6749 |
|
30-Sep-2015 |
George Mount <mount@google.com> |
Fix resolving listeners for multi-attribute binding adapters. Bug 24538724 Change-Id: I39a72fd701abf9d2368d2a0a7fc5a4c1ac63c0a0
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
a128d1c99ea98bb48c45d648906652e3d618d513 |
|
29-Sep-2015 |
George Mount <mount@google.com> |
Bring all instance BindingAdapters into Component. This also uses a non-arbitrary ordering for name clashes. Bug 24407912 Change-Id: Ibd96adfb979af86370889acb7b60c1b6953b190d
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
793e979f25e190162eacf46d6a4efc3efc1d2f91 |
|
31-Jul-2015 |
George Mount <mount@google.com> |
Support different event handlers having different API levels. Bug 22957226 Change-Id: Ia08bcb857872eccad3340c14b8d10b78198b90a6
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
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
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
e4cd38824a6627b9fef229c549c636e35ad63b5f |
|
07-Jul-2015 |
George Mount <mount@google.com> |
Support dependency injection. Bug 22389109 Change-Id: Iec63375c5412edc03b4808ee129a7596b61bf9e6
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
731b74f7f44e67312a1fc4161c4e0aae221b2417 |
|
25-Jun-2015 |
Yigit Boyar <yboyar@google.com> |
Introduce Scopes to track logical stack traces This CL introduces a static class called Scope, which is used the logical processing stack for data binding. These scopes are used to generate meaningful error messages when an error is detected. Bug: 21953001 Change-Id: I5470a8c4ad94401d34a140762baae9d53c5a0402
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.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
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
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
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
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
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
4d4979490e1fa374c0d7f3599fed0a9e83a579d0 |
|
08-Jun-2015 |
George Mount <mount@google.com> |
Support data binding for fragments. Bug 21667601 Change-Id: I636dec1bbb5567d70a996e115e6bf8322c3aa29d
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
e9b33bac04bb1ce1444d7f1744fcec1ecd3a57da |
|
30-Apr-2015 |
Yigit Boyar <yboyar@google.com> |
Support multi-param adapters in code generation Bug: 19800022 Change-Id: I40c4ac72f24f965db12fd1c7dec6591184160ae5
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
de38dd3ef0577d25b2d59863603abe5750d0c231 |
|
28-Mar-2015 |
George Mount <mount@google.com> |
Make ViewStub support binding variables like include. Bug 19969378
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|
fead9ca09b117136b35bc5bf137340a754f9eddd |
|
23-Mar-2015 |
George Mount <mount@google.com> |
Move to package android.databinding.
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/Binding.java
|