Skip to content

Commit

Permalink
feat: update android blurview to 2.0.2 (#478)
Browse files Browse the repository at this point in the history
* feat: update android blurview to 2.0.2

* chore: release 4.1.0
  • Loading branch information
Titozzz committed Jul 22, 2022
1 parent 359231e commit af4974a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
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 @@
]
]
}
}
}

0 comments on commit af4974a

Please sign in to comment.