Reputation: 17753
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
Upvotes: 1
Views: 601
Reputation: 38707
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.
Upvotes: 1