You can simply use android:src attribute instead compat attribute when you set vector resource by DataBinding. DataBinding library generates class that execute setImageResource method at runtime.
6608
11 May 2018 app:layout_constraintStart_toStartOf="parent". app:layout_constraintTop_toTopOf ="@id/imageView2". app:srcCompat="@drawable/ic_size_1"
In this post, I will explain about safely storing the credentials in android projects using gradle.properties file . Hello! For some reason when I set an icon using android:src on a FAB, it will force the icon to be black rather than whatever colour the (vector) icon actually is. The issue popped up once I upgraded from 1.0.0 to 1.1.0, and can be seen directly from the XML …
And you’ll most probably use the android: src to set a drawable as the content of the ImageView. The thing is, if it’s dynamic it means the content of the ImageView is going to change later. So there’s no point in adding a static drawable as the content of the ImageView as …
2021-2-18 · ImageView class is used to display any kind of image resource in the android application either it can be android.graphics.Bitmap or android.graphics.drawable.Drawable (it is a general abstraction for anything that can …
2021-4-17 · FloatingActionButton is a subclass of ImageButton, and is a descendant of ImageView, so you can set the Icon for it through the android:srcCompat attribute.