ZieIony / Carbon

Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.

Home Page:https://androidreclib.wordpress.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggest drawShadow add condition view.isDirty

opened this issue · comments

The shadow is drawn in the parent view, when a sibling view is invalidated, it will notify parent view to redraw, which will cause every shadow views to redraw the shadow. In view's onDraw, it will use isDirty() to avoid unnecessary redraw, but shadows don't have this condition. Especially when the whole layout have some timer view.

To be honest, I didn't know about this flag being public. Thanks!

I'll have to investigate, if this is viable, since shadows depend on many things.

Please don't close issues I'm working on. If you are not sure if you can close an issue, always leave it to the repository owner - it helps to manage tasks better.

After short investigation this doesn't seem to be viable. The isDirty flag is affected only by the view itself and shadows need to be drawn by the parent. Also, shadows are currently very cheap, so this shouldn't be a problem.