Clans / FloatingActionButton

Android Floating Action Button based on Material Design specification
Apache License 2.0
5.23k stars 1.13k forks source link

Tint and srcCompat #437

Open dovahkiin98 opened 6 years ago

dovahkiin98 commented 6 years ago

Tint doesn't apply to icon and app:srcCompat isn't recognized

Croutonix commented 6 years ago

Yes, because FloatingActionButton extends android.widget.ImageButton and not the support library equivalent. The solution around this is to tint your own icons by code...

kolagit commented 4 years ago

As stated, this library is not supported any longer. To make it compatible with AndroidX, All you need to do is :

update ImageView to use "androidx.appcompat.widget.AppCompatImageView", update ImageButton to use "androidx.appcompat.widget.AppCompatImageButton" (You have to fix one of super class constructor as AppCompatImageButton constructor changed. getOpacity() method.) It fixed the AndroidX compatibility issue for me.