Skip to content

Commit

Permalink
fix(android): bump blurview and use default setupWith (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
Titozzz authored May 1, 2023
1 parent 24b456b commit 77affab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ dependencies {
implementation "com.facebook.react:react-native:+"
// From node_modules

implementation 'com.github.Dimezis:BlurView:version-2.0.2'
implementation 'com.github.Dimezis:BlurView:version-2.0.3'
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package com.reactnativecommunity.blurview;

import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import com.facebook.react.uimanager.ThemedReactContext;

import eightbitlab.com.blurview.BlurView;
import eightbitlab.com.blurview.RenderEffectBlur;
import eightbitlab.com.blurview.RenderScriptBlur;

import java.util.Objects;
import javax.annotation.Nonnull;
Expand All @@ -27,19 +22,10 @@ class BlurViewManagerImpl {
.requireNonNull(ctx.getCurrentActivity())
.getWindow()
.getDecorView();
ViewGroup rootView = decorView.findViewById(android.R.id.content);
Drawable windowBackground = decorView.getBackground();
if (Build.VERSION.SDK_INT >= 31) {
blurView
.setupWith(rootView, new RenderEffectBlur())
.setFrameClearDrawable(windowBackground)
.setBlurRadius(defaultRadius);
} else {
blurView
.setupWith(rootView, new RenderScriptBlur(ctx))
.setFrameClearDrawable(windowBackground)
.setBlurRadius(defaultRadius);
}
blurView
.setupWith(decorView.findViewById(android.R.id.content))
.setFrameClearDrawable(decorView.getBackground())
.setBlurRadius(defaultRadius);
return blurView;
}

Expand Down

0 comments on commit 77affab

Please # to comment.