Skip to content

Commit

Permalink
Add handler to fix duplicate view
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamal committed Aug 27, 2019
1 parent bf0c2dc commit 25a7de6
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,18 @@ private void removeBlurredView() {
}
}

/**
* Removed the duplicated blurred view from the view hierarchy.
*/
private void removedDuplicateBlurredView() {
if (mBlurredBackgroundView != null) {
ViewGroup parent = (ViewGroup) mBlurredBackgroundView.getParent();
if (parent != null) {
parent.removeView(mBlurredBackgroundView);
}
}
}

/**
* Async task used to process blur out of ui thread
*/
Expand Down Expand Up @@ -633,7 +645,7 @@ protected void onPostExecute(Void aVoid) {

mBackgroundView.destroyDrawingCache();
mBackgroundView.setDrawingCacheEnabled(false);
removeBlurredView();
removedDuplicateBlurredView();
mHoldingActivity.getWindow().addContentView(
mBlurredBackgroundView,
mBlurredBackgroundLayoutParams
Expand Down

0 comments on commit 25a7de6

Please sign in to comment.