Skip to content

Commit

Permalink
Merge pull request #95 from Dimezis/v1.6.1
Browse files Browse the repository at this point in the history
Fix rendering issue on API 21 emulator.
  • Loading branch information
Dimezis authored Apr 20, 2019
2 parents 2ec51db + fb0b82b commit aed9dec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public boolean onPreDraw() {
}
};

private boolean blurEnabled = true;
private boolean blurEnabled = false;

@Nullable
private Drawable frameClearDrawable;
Expand Down Expand Up @@ -272,7 +272,8 @@ public BlurViewFacade setFrameClearDrawable(@Nullable Drawable frameClearDrawabl
return this;
}

private void setBlurEnabledInternal(boolean enabled) {
@SuppressWarnings("WeakerAccess")
void setBlurEnabledInternal(boolean enabled) {
this.blurEnabled = enabled;
setBlurAutoUpdateInternal(enabled);
blurView.invalidate();
Expand All @@ -289,7 +290,8 @@ public void run() {
return this;
}

private void setBlurAutoUpdateInternal(boolean enabled) {
@SuppressWarnings("WeakerAccess")
void setBlurAutoUpdateInternal(boolean enabled) {
blurView.getViewTreeObserver().removeOnPreDrawListener(drawListener);
if (enabled) {
blurView.getViewTreeObserver().addOnPreDrawListener(drawListener);
Expand All @@ -300,7 +302,7 @@ public BlurViewFacade setBlurAutoUpdate(final boolean enabled) {
blurView.post(new Runnable() {
@Override
public void run() {
setBlurEnabledInternal(enabled);
setBlurAutoUpdateInternal(enabled);
}
});
return this;
Expand Down
4 changes: 0 additions & 4 deletions library/src/main/java/eightbitlab/com/blurview/BlurView.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ public BlurViewFacade setupWith(@NonNull ViewGroup rootView) {
this.blurController.destroy();
this.blurController = blurController;

if (!isHardwareAccelerated()) {
blurController.setBlurAutoUpdate(false);
}

return blurController;
}

Expand Down

0 comments on commit aed9dec

Please sign in to comment.