Closed willstdueswissen closed 8 years ago
+1
You can't use IconDrawable
that way, but I think an IconTextView
would let you do exactly what you need.
No IconTextView can not be set to costome views with a simple canvas or on a FAB (Floating Action Button)
Ok I misunderstood you're first message. You can't use Iconify for this. A FAB is basically an imageview so you can't provide it text + images.
About your custom view, I obviously can't guess what class you're extending but consider extending a ViewGroup so that you can add an IconTextView in it.
but if you render with IconDrawable the text to image (you can also name it to: IconTextDrawable), you can use it on all views.
I'm not saying its not possible at all, I'm saying that Iconify won't support it. It would add unnecessary complexity to the lib for a not-so-common use case.
You can create an IconTextDrawable
in your project and rely on Iconify for its implementation though. I think you'd have to create an IconTextView
internally, set it's text, make sure it's measured properly, and then pass him the canvas of the Drawable like iconTextView.draw(canvas)
when you need to draw it.
TL;DR Iconify won't allow a IconDrawable
with both text and icons out of the box. An IconDrawable
is a single icon in a Drawable.
Simple Question: Is any stuff avaible to use new IconDrawable(this, "text {mdi-plus}")
Or is a chance avaible to create own view? I would have a FAB and some other stuff
Thank you!