Android - drawText invalidate
Question
I am drawing on Canvas about who is on turn now. I am using validate() twice to invalidate the screen and drawing text again. But with invalidate() I am redrawing all board, which last quite a long, is there any way how to invalidate just this part of Canvas?
Thanks
Hmyzak
Solution
Not really, no. You have two options:
Put the bit of UI you want to update into it's own child View and simply invalidate() that particular view when needed.
If drawing the other parts of your View is so expensive, that's a great reason to use the drawing cache. Check out
View.setDrawingCacheEnabled()
and friends.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow