1
1
package com .reactnativecommunity .blurview ;
2
2
3
- import android .graphics .drawable .Drawable ;
4
- import android .os .Build ;
5
3
import android .view .View ;
6
- import android .view .ViewGroup ;
7
4
import com .facebook .react .uimanager .ThemedReactContext ;
8
5
9
6
import eightbitlab .com .blurview .BlurView ;
10
- import eightbitlab .com .blurview .RenderEffectBlur ;
11
- import eightbitlab .com .blurview .RenderScriptBlur ;
12
7
13
8
import java .util .Objects ;
14
9
import javax .annotation .Nonnull ;
@@ -27,19 +22,10 @@ class BlurViewManagerImpl {
27
22
.requireNonNull (ctx .getCurrentActivity ())
28
23
.getWindow ()
29
24
.getDecorView ();
30
- ViewGroup rootView = decorView .findViewById (android .R .id .content );
31
- Drawable windowBackground = decorView .getBackground ();
32
- if (Build .VERSION .SDK_INT >= 31 ) {
33
- blurView
34
- .setupWith (rootView , new RenderEffectBlur ())
35
- .setFrameClearDrawable (windowBackground )
36
- .setBlurRadius (defaultRadius );
37
- } else {
38
- blurView
39
- .setupWith (rootView , new RenderScriptBlur (ctx ))
40
- .setFrameClearDrawable (windowBackground )
41
- .setBlurRadius (defaultRadius );
42
- }
25
+ blurView
26
+ .setupWith (decorView .findViewById (android .R .id .content ))
27
+ .setFrameClearDrawable (decorView .getBackground ())
28
+ .setBlurRadius (defaultRadius );
43
29
return blurView ;
44
30
}
45
31
0 commit comments