Difference between ColorDrawable and PaintDrawable

Just by looking at the Android developer documentation for PaintDrawable and ColorDrawable, I cannot distinguish the difference between the two. Hope someone can enlighten me with this ...

thanks artsylar

+4
source share
1 answer

ColorDrawable is a very simple view that just fills the canvas with color. You can set the ColorFilter to ColorDrawable, but it will be ignored. PaintDrawable is more complicated; it paints a color, but this operation can be changed using the ColorFilter, as well as with the Paint object. ColorDrawable is cheaper to use, but more limited in what you can use for it.

+7
source

Source: https://habr.com/ru/post/1347660/


All Articles