In my custom-drawn view I use the Canvas.drawPaint(Paint)
method. But the preview in Android Studio displays this message:
The graphics preview in the layout editor may not be accurate:
- Canvas.drawPaint is not supported
It's easy to replace drawPaint
with drawRect
, but the javadoc to drawPaint
says: This is equivalent (but faster) to drawing an infinitely large rectangle with the specified paint.
My question is: can I check, if I'm drawing in preview mode, and conditionally use either method? Or some other workaround to make preview working and keep the performance?