Skip to content

feat: update android blurview to 2.0.2 #478

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
// From node_modules
implementation 'com.github.Dimezis:BlurView:version-1.6.6'

implementation 'com.github.Dimezis:BlurView:version-2.0.2'
}

if (isNewArchitectureEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
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.SimpleViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.annotations.ReactProp;

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 @@ -34,12 +37,17 @@ class BlurViewManager extends ViewGroupManager<BlurView> {
.getDecorView();
ViewGroup rootView = decorView.findViewById(android.R.id.content);
Drawable windowBackground = decorView.getBackground();
blurView
.setupWith(rootView)
.setFrameClearDrawable(windowBackground)
.setBlurAlgorithm(new RenderScriptBlur(ctx))
.setBlurRadius(defaultRadius)
.setHasFixedTransformationMatrix(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
blurView
.setupWith(rootView, new RenderEffectBlur())
.setFrameClearDrawable(windowBackground)
.setBlurRadius(defaultRadius);
} else {
blurView
.setupWith(rootView, new RenderScriptBlur(ctx))
.setFrameClearDrawable(windowBackground)
.setBlurRadius(defaultRadius);
}
return blurView;
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-community/blur",
"version": "4.0.0",
"version": "4.1.0",
"description": "React Native Blur component",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -148,4 +148,4 @@
]
]
}
}
}