android-databinding

Handling DataBinding errors when switching Git branch

折月煮酒 提交于 2020-08-06 20:44:27
问题 I have a lot of issues with DataBinding when switching between Git branches where a databinding layout has been changed/removed. I regularly get build errors like this when a file is removed when switching Git branch: <path>/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug/out/com/some/package/databinding/SomeLayoutBinding.java:38: error: cannot find symbol public final SomeOtherLayoutBinding variable; ...and try every combination of Clean Project .

Handling DataBinding errors when switching Git branch

眉间皱痕 提交于 2020-08-06 20:42:10
问题 I have a lot of issues with DataBinding when switching between Git branches where a databinding layout has been changed/removed. I regularly get build errors like this when a file is removed when switching Git branch: <path>/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug/out/com/some/package/databinding/SomeLayoutBinding.java:38: error: cannot find symbol public final SomeOtherLayoutBinding variable; ...and try every combination of Clean Project .

Handling DataBinding errors when switching Git branch

橙三吉。 提交于 2020-08-06 20:40:53
问题 I have a lot of issues with DataBinding when switching between Git branches where a databinding layout has been changed/removed. I regularly get build errors like this when a file is removed when switching Git branch: <path>/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug/out/com/some/package/databinding/SomeLayoutBinding.java:38: error: cannot find symbol public final SomeOtherLayoutBinding variable; ...and try every combination of Clean Project .

Android two-way databinding, textview not updating

半腔热情 提交于 2020-07-21 07:24:49
问题 I am trying to use MVVM pattern with android databinding. I have an edittext and a textview that should show the same text when I type in the edittext field by binding to the model via the observablefield with a LocationType model object. From testing both fields are set to "hello" when I start the app, as expected. But when I type in the edittextfield the textview does not update, even tough the model object gets updated correctly as can be seen with by debug. When I use an: observablefield

Android data binding - cannot find getter for <> that accepts parameter type 'long'

て烟熏妆下的殇ゞ 提交于 2020-06-28 02:51:17
问题 I have been using data binding for the past few weeks and now am trying to use a two way data binding for a custom view with a 'value' attribute. My problem is that I get the following error when building. Cannot find a getter for <com.twisthenry8gmail.dragline.DraglineView app:value> that accepts parameter type 'long' Now it was my understanding that the binding library will automatically use my public setters and getters however the most confusing part is adding a redundant inverse binding

What is the use of binding adapter in Android?

时间秒杀一切 提交于 2020-06-27 16:29:39
问题 I have been reading articles about binding adapter in Android, but I don't seem to understand it. When is a binding adapter used? Can someone explain it with a simple example? An article I read had a binding adapter in the Main Activity. The binding Adapter had a parameter "toastMessage", and apparently, the method annotated with this binding adapter was said to be called whenever the "toastMessage" (which was an attribute in viewModel class) changed. I don't understand why we need to do this