android-floating-action-button icon indicating copy to clipboard operation
android-floating-action-button copied to clipboard

How do I set a circular image as one of the sub item

Open Shanto16 opened this issue 8 years ago • 1 comments

Hello , I want to show a fully filled imageView(User's profile pic) in one of the sub items. but it is giving me an exception :

android.view.InflateException: Binary XML file line #140: de.hdodenhof.circleimageview.CircleImageView cannot be cast to com.github.clans.fab.FloatingActionButton

How do I do that ?

Shanto16 avatar Apr 02 '17 21:04 Shanto16

FloatingActionButton extends ImageView from the Android framework so it cannot be casted to de.hdodenhof.circleimageview.CircleImageView, which in fact the exception message actually says.

If you want to set a circular image to one of FloatingActionButton in the menu, you should use some sort of CircularImageDrawable which will perform rounding of the associated bitmap when drawing it and set that drawable to the desired FAB.

albedinsky avatar Jan 04 '18 13:01 albedinsky