Skip to content

Commit 0a5a71f

Browse files
fix: Mask flicker while navigating on Android (#171)
1 parent 8c7ec78 commit 0a5a71f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

android/src/main/java/org/reactnative/maskedview/RNCMaskedView.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,14 @@ protected void onAttachedToWindow() {
7777
}
7878

7979
private void updateBitmapMask() {
80-
if (this.mBitmapMask != null) {
81-
this.mBitmapMask.recycle();
82-
}
83-
8480
View maskView = getChildAt(0);
8581
if (maskView != null) {
8682
maskView.setVisibility(View.VISIBLE);
83+
if (this.mBitmapMask != null) {
84+
this.mBitmapMask.recycle();
85+
}
8786
this.mBitmapMask = getBitmapFromView(maskView);
8887
maskView.setVisibility(View.INVISIBLE);
89-
} else{
90-
this.mBitmapMask = null;
9188
}
9289
}
9390

0 commit comments

Comments
 (0)