Skip to content

Commit

Permalink
fix(android): crash
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed Sep 23, 2023
1 parent fe9c7dc commit 12441d0
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.candlefinance.blurview

import android.os.Build
import android.view.View
import android.view.ViewGroup
import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
Expand All @@ -20,7 +19,7 @@ class BlurViewViewManager : SimpleViewManager<BlurView>() {
val blurView = BlurView(reactContext.baseContext).also {
it.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
val decorView = reactContext.currentActivity
val rootView = decorView?.findViewById<ViewGroup>(android.R.id.content)
val rootView = decorView?.findViewById<BlurView>(R.id.blurView)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (rootView != null) {
it.setupWith(rootView, RenderEffectBlur())
Expand Down

0 comments on commit 12441d0

Please sign in to comment.