I have set a GradientDrawable as background. While doing some 3d transaction (especially at the Y axis) the GradientDrawable redraws it self and the famerate is not good.
- I cannot cache the view that the drawing is set as background because
i want other views on top of that to animate. - I cannot put another view just for the background and cache that view
cause then that view only beeing fullscreen will cause the same
problems. - I cannot use windowsDecorator for the background.
So what i want is a way to stop the GradientDrawable to try to redraw itself during the animation. I think jumpToCurrentState() does what i want but i want it to work on API level >= 8 and jumpToCurrentState() is only for API level >=11. Also i wish i knew what jumpToCurrentState does exactly to port it to the API lvl 8 but can’t find the function anywhere in the drawable(source not released?)
So is there any way to cache the drawable it self and not the view containing that Drawable?.
The last resort will be to not draw the background during animations but i really really want to avoid that.
I ended up creating a bitmap caching system for the GradientDrawable it self. (Didn’t want to cache the view that has this drawable as a background).
This gives a great speed boost for animations.