Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.graphics.Shader;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;

Expand Down Expand Up @@ -92,6 +93,22 @@ public ShimmerLayout(Context context, AttributeSet attrs, int defStyle) {
}
}

@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (changed) {
clearMask();
}
}

private void clearMask() {
maskRect = calculateBitmapMaskRect();
gradientTexturePaint = null;
maskBitmap = null;
localMaskBitmap = null;
canvasForShimmerMask = null;
}

@Override
protected void onDetachedFromWindow() {
resetShimmering();
Expand Down