示例#1
0
        public void DropCameraForView(CaptureElement view)
        {
            var viewTag = view.GetTag();
            var camera  = GetCameraForView(viewTag);

            if (camera != null)
            {
                _cameras.Remove(viewTag);
                var reactContext = view.GetReactContext();
                reactContext.RemoveLifecycleEventListener(camera);
            }
        }
示例#2
0
        public CameraForView GetOrCreateCameraForView(CaptureElement view)
        {
            var           viewTag      = view.GetTag();
            var           reactContext = view.GetReactContext();
            CameraForView result;

            if (!_cameras.TryGetValue(viewTag, out result))
            {
                result = new CameraForView(view);
                _cameras.Add(viewTag, result);
                reactContext.AddLifecycleEventListener(result);
            }

            return(result);
        }