use of com.facebook.react.uimanager.NativeViewHierarchyManager in project react-native-camera by lwansbrough.
the class CameraModule method resumePreview.
@ReactMethod
public void resumePreview(final int viewTag) {
final ReactApplicationContext context = getReactApplicationContext();
UIManagerModule uiManager = context.getNativeModule(UIManagerModule.class);
uiManager.addUIBlock(new UIBlock() {
@Override
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
final RNCameraView cameraView;
try {
cameraView = (RNCameraView) nativeViewHierarchyManager.resolveView(viewTag);
if (cameraView.isCameraOpened()) {
cameraView.resumePreview();
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
Aggregations