File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
package/android/src/main/java/com/mrousavy/camera Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import com.facebook.react.module.annotations.ReactModule
9
9
import com.facebook.react.modules.core.PermissionAwareActivity
10
10
import com.facebook.react.modules.core.PermissionListener
11
11
import com.facebook.react.uimanager.UIManagerHelper
12
+ import com.facebook.react.uimanager.common.UIManagerType
12
13
import com.mrousavy.camera.core.CameraError
13
14
import com.mrousavy.camera.core.CameraQueues
14
15
import com.mrousavy.camera.core.ViewNotFoundError
@@ -53,12 +54,11 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
53
54
Log .d(TAG , " Finding view $viewId ..." )
54
55
val context = reactApplicationContext ? : throw Error (" React Context was null!" )
55
56
56
- val view = UIManagerHelper .getUIManager(
57
- context,
58
- viewId
59
- )?.resolveView(viewId) as CameraView ?
60
- Log .d(TAG , if (view != null ) " Found view $viewId !" else " Couldn't find view $viewId !" )
61
- if (view == null ) throw ViewNotFoundError (viewId)
57
+ val uiManagerType = if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) UIManagerType .FABRIC else UIManagerType .DEFAULT
58
+ val uiManager = UIManagerHelper .getUIManager(context, uiManagerType) ? : throw Error (" UIManager not found!" )
59
+
60
+ val view = uiManager.resolveView(viewId) as ? CameraView ? : throw ViewNotFoundError (viewId)
61
+ Log .d(TAG , " Found view $viewId !" )
62
62
return @runOnUiThreadAndWait view
63
63
}
64
64
You can’t perform that action at this time.
0 commit comments