Issue I have an issue with getBinding. My BaseFragment implementation here: private var _binding: T? = null protected val binding get() = _binding!! override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { _binding = inflate(inflater, container, false)
Continue readingTag: android-databinding
Android Kotlin ImageView inside RecyclerView.Adapter doesn't update as expected
Issue After finally implementing icons for device types in my server, I replaced the temporary drawables I previously used with the icons from the server and load them using coil. The ImageView for them is inside an adapter btw. On
Continue readingBindingAdapter with lambda as argument
Issue With Android databinding, I can do the following: <View android:layout_width=”match_parent” android:layout_height=”wrap_content” android:onClick=”@{() -> viewModel.onClick()}” /> My ViewModel does not have to implement OnClickListener, but just have a method: public void onClick() { } What it passes to the onClick
Continue readingAndroid Data Binding using include tag
Issue Update note: The above example works properly, because release 1.0-rc4 fixed the issue of needing the unnecessary variable. Original question: I do exactly as it is described in the documentation and it does not work: main.xml: <layout xmlns:andr… <data>
Continue readingandroid: data binding error: cannot find symbol class
Issue I am getting started for using DataBinding feature. I am facing problem with it. Error:(21, 9) error: cannot find symbol class ContactListActivityBinding build.gradle(Module: app) apply plugin: ‘com.android.application’ android { compileSdkVersion 23 buildToolsVersion “23.0.2” defaultConfig { applicationId “com.letsnurture.ln_202.databindingdemo” minSdkVersion 15
Continue readingFailed to instantiate one or more classes: java.lang.ClassNotFoundException: androidx.databinding.DataBinderMapperImpl
Issue I’ve created a multi-module project. I’ve created a custom view using data binding in one of its library modules. Problem: The custom view is not showing in the layout editor but it’s OK on the device. This is the
Continue readingNoSuchMethodError: No interface method getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Ljava/util/Map;
Issue I’ve got the crash on Meizu device with Android 5.0. This crash doesn’t appear on most of the devices. The error is: java.lang.NoSuchMethodError: No interface method getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Ljava/util/Map; or its super classes (declaration of ‘java.util.Map’ appears in
Continue readingDo we still need to include `kapt com.android.databinding:compiler`
Issue I remember Kotlin mentioning in their docs that we need to include kapt com.android.databinding:compiler:version in our build.gradle. However I can no longer see this mentioned anywhere, except in some medium articles or stack overflow questions. So do we still
Continue readingHow to set Image resource to ImageView using DataBinding
Issue How can we use data binding in android to put image resource in an ImageView? <ImageView android:id=”@+id/is_synced” android:src=”@{model.pending ? @mipmap/pending: @mipmap/synced}” android:layout_width=”wrap_content” android:layout_height=”wrap_content” /> I want an image if pending is true and another image if pending is false.
Continue readingData-Binding fails with "couldn't make a guess"
Issue Since the update to Android Studio 3.2.0 I face the following issue: Execution failed for task ‘:mobile:dataBindingGenBaseClassesDebug’. > couldn’t make a guess for com.ACME.database.model.Order also seen this answer, which hints for that "package-names must start with a lower-case letter".
Continue reading