In Android, what's better for performance: setting a transparency on a view, or adding an overlay view over it? -


i've developed messaging app that's using recyclerview contact image every "row". new messages, want contact icon full color, old messages, want have icon faded. so, can either setting alpha on icon 0.5, or can have overlay image (that's semi-transparent png) on top of icon achieve pretty same effect. way more efficient , lead smoother scrolling through list?

i should mention app runs on api 14+, i'll need make sure whatever choose doesn't work worse on older apis compared lollipop (or vice versa). or, if there significant difference in way works better on different apis, i'll design layouts work differently each api.

thanks

try both , measure using systrace see how long frames take draw. http://developer.android.com/tools/help/systrace.html

a 3rd option might cache version .5 alpha, blended background (so final bitmap not need alpha). assuming people in conversation not many, may give best of both. again, measure , see yourself.


Popular posts from this blog