I needed days to figure out why invalidate(Rect dirty)
doesn't set the correct clip on newer devices.
The problem is that hardwareAccelerated="true"
is set by default.
When I set this hardwareAccelerated="false"
,
I get my right clip in my onDraw
.
Now my question is:
What is better for performance:
Use hardwareAccelerated="false"
and draw only the part of my view which is dirty and run only the code in my onDraw that is needed for this
OR
allow hardwareAcceleration
and let android draw my entire view over and over again?
I guess this question may be answered for every application individually so I add a screenshot of my app.
As you can see I draw a calendar and each time a user clicks a entry this should get a red border.
Can you give me any suggestions whats best for this requirement?
Cheers, Stefan