Skip to content

Commit

Permalink
Guard against adding backgroundView to blurView when it already has a…
Browse files Browse the repository at this point in the history
… parent leading to IllegalStateException.
  • Loading branch information
tttcowan committed Jun 1, 2022
1 parent ce85a46 commit 6b4e8a4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public void onGlobalLayout() {
ViewGroup.LayoutParams.MATCH_PARENT,
blurView.getMeasuredHeight()
);
if (backgroundView.getParent() != null) {
((ViewGroup)backgroundView.getParent()).removeView(backgroundView);
}
blurView.addView(backgroundView, 0, params);
}
});
Expand Down

0 comments on commit 6b4e8a4

Please sign in to comment.