I have a custom view (a Waveform) that needs to be synchronized with a media player progress. The problem is that I'm having a different behavior when using invalidate(Rect) Here is the code that makes the update in my custom view:
public void setProgress(int currentDuration) {
// ... Some code to calculate the dirty width
invalidate(mDirtyWidth,0,mDirtyWidth+ mDirtyWidthRegion, viewHeight);
}
This is working perfectly on a Samsung Galaxy 4 (Android 4.4.2). Screenshot with "Show GPU view updates" enabled
But in a Nexus 7 (Android 5.1), the whole view gets invalidated each time: