androidandroid-drawablecolorfilter

Which one is faster Color Filtering or use different drawables in android?


i'm using icons on recyclerview row items.And i'm changing icon's colors with Color Filter option in android but i'm wondering which one is faster and better?

I already use color filtering on white drawable but it sometimes does not appear in list row till refresh recyclerview so i just think about to use different drawables. thank you for your interest...


Solution

  • It is hard to say, but I would say that changing the drawable is faster, and this is why I think this:

    The thing is that flash storage on mobile devices is pretty fast too these days so I consider it's faster to load than tint images.

    BUT it depends on how you create the layout. If you load a image the Android system will recalculate the whole layout if other elements change position when you change the drawable. I don't think they wrote code to keep the layout the same if the new drawable has the same size as the last one, and this will involve more calculations than a simple tinting.