Status Update
Comments
sl...@google.com <sl...@google.com> #2
this would be nice but given Compose and all other priorities, we are not planning to make any big investments in data binding (support KSP is a very big task).
v....@gmail.com <v....@gmail.com> #3
Makes sense. And is there any way to trigger data binding without kapt plugin, assuming there are no custom binding adapters in given module?
ai...@gmail.com <ai...@gmail.com> #4
unfortunately no. data binding still needs to be able to read your code and annotation processing is the only API that allows us to do it :(
nk...@google.com <nk...@google.com>
ar...@gmail.com <ar...@gmail.com> #5
It's a very disappointing decision for many projects who heavily depend on data binding, which will never be able to get rid of all bindings code and especially rewrite all UI to Compose.
It means that bindings are essentially deprecated
nk...@google.com <nk...@google.com> #6
It does not mean data binding is deprecated unless KAPT is deprecated (if that happens, we would need to support KSP).Unfortunately, moving data binding to KSP is a large order so it makes more sense to keep focusing on KAPT than rewrite data binding.
We might re-consider this in the future based on KSP becoming stable, Compose adoption and KAPT stability but it is very unlikely to happen.
be...@gmail.com <be...@gmail.com> #8
Unfortunately this is still a NO for 2022 planning due to reasons mentioned in #2.
fr...@gmail.com <fr...@gmail.com> #9
kapt seems no longer adding new feature
kapt is in maintenance mode. We are keeping it up-to-date with recent Kotlin and Java releases but have no plans to implement new features. Please use the Kotlin Symbol Processing API (KSP) for annotation processing. See the list of libraries supported by KSP.
So this mean databinding will also deprecated or will be support KSP?
xa...@gmail.com <xa...@gmail.com> #10
We don't plan to support KSP nor recommend data binding usage at this stage since compose is our recommended UI solution.
vi...@gmail.com <vi...@gmail.com> #11
We don't plan to support KSP nor recommend data binding usage at this stage since compose is our recommended UI solution.
I have been waited this answer in several years.
Because it is an important basis to convince co-workers and for determining the technology stack of an app.
nk...@google.com <nk...@google.com> #12
Databinding is in maintenance mode as well.
We don't plan to support KSP nor recommend data binding usage at this stage since compose is our recommended UI solution.
A bit of a tangent here, but what about ViewBinding? Will that one stay going strong or will it fade along with DataBinding?
to...@gmail.com <to...@gmail.com> #13
So if you are using Views, ViewBinding will keep working.
It is the same for Data Binding as well though. The main difference is that if KAPT stops working, DataBinding will stop working whereas ViewBinding will keep working. Hopefully, any such situation will be far enough that no-one will care and everyone will be using Compose :)
jc...@gmail.com <jc...@gmail.com> #16
#14 Kapt will be supported on K2, there are no plans to stop supporting it in Kotlin
nk...@google.com <nk...@google.com> #17
nk...@google.com <nk...@google.com> #18
da...@gmail.com <da...@gmail.com> #19
- androidTestImplementation 'com.android.support.test:runner:1.0.2'
- androidTestImplementation 'com.android.support.test:rules:1.0.2'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Tests always passes individually.
Running the suite instead, they have an unpredictable behavior: sometimes they passes, sometimes do not.
gu...@gmail.com <gu...@gmail.com> #20
gu...@gmail.com <gu...@gmail.com> #21
//This is button enabled field update, each time when this MutableLiveData<Boolean> is called it prints this.toString()
PersonalViewModel@52cb180
PersonalViewModel@52cb180
PersonalViewModel@52cb180
PersonalViewModel@52cb180
PersonalViewModel@52cb180
PersonalViewModel@52cb180
//Second test start onStart() of ViewModel
START: PersonalViewModel@43321e0
PersonalViewModel@43321e0 //Calls button MutableLiveData<Boolean> for enabled property only ONCE
//Second test onPause() of ViewModel
PAUSE: PersonalViewModel@43321e0
//Third test start onStart() of ViewModel
START: PersonalViewModel@dc72c50
PersonalViewModel@dc72c50 //Calls button MutableLiveData<Boolean> for enabled property only ONCE
PAUSE: PersonalViewModel@dc72c50
When the second test starts it seems like it calls MutableLiveData<Boolean> property only once for button and then it fails to bind or something, because button is not updating anymore. Individually all tests work.
Description
Version used: 2.2.1
What steps will reproduce the problem?
1. Have atleast 3 tests
2. Log messages in activity onCreate and onDestroy
3. Observe onCreate -> onDestroy messages not going in order (onCreate -> onDestroy, onCreate -> onDestroy, onCreate -> onDestroy)
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
Android Studio 1.5.1
What is the expected output? What do you see instead?
Log messages going sequentially (onCreate -> onDestroy, onCreate -> onDestroy, onCreate -> onDestroy)
I am trying to use espresso and junit4. The problem seems to be that I have code that is statically initialized in activity.onCreate and deinitialized in activity.onDestroy to prevent leaks, etc.
Now when I run espresso, the tests seem to run in "parallel". I added log class to activity onCreate and onDestroy.
What I am seeing is
onCreate = example.package.MainActivity@ABC
onCreate = example.package.MainActivity@JKL
onDestroy = example.package.MainActivity@ABC
onCreate = example.package.MainActivity@XYZ
onDestroy = example.package.MainActivity@JKL
onDestroy = example.package.MainActivity@XYZ
**and ofcourse it fails on NPE in third test because the second test's onDestroy ran after third's onCreate (which null-ed out the static code)**
Is this behaviour normal? Can I force espresso to teardown activity instance first and only then start a new one? Thanks!