Inheritance: FragmentActivity
        public override void ScanContinuously(MobileBarcodeScanningOptions options, Action <Result> scanHandler)
        {
            var scanIntent = new Intent(lifecycleListener.Context, typeof(ZxingActivity));

            scanIntent.AddFlags(ActivityFlags.NewTask);

            ZxingActivity.UseCustomOverlayView = this.UseCustomOverlay;
            ZxingActivity.CustomOverlayView    = this.CustomOverlay;
            ZxingActivity.ScanningOptions      = options;
            ZxingActivity.ScanContinuously     = true;
            ZxingActivity.TopText    = TopText;
            ZxingActivity.BottomText = BottomText;

            ZxingActivity.OnCanceled += () =>
            {
                ZxingActivity.RequestCancel();
            };

            ZxingActivity.OnScanCompleted += (Result result) =>
            {
                if (scanHandler != null)
                {
                    scanHandler(result);
                }
            };

            lifecycleListener.Context.StartActivity(scanIntent);
        }
Example #2
0
        //BarcodeReader reader;

        public ZxingSurfaceView(ZxingActivity activity)
            : base(activity)
        {
            this.activity = activity;

            screenResolution = new Size(this.activity.WindowManager.DefaultDisplay.Width, this.activity.WindowManager.DefaultDisplay.Height);

            this.surface_holder = Holder;
            this.surface_holder.AddCallback(this);
            this.surface_holder.SetType(SurfaceType.PushBuffers);

            this.tokenSource = new System.Threading.CancellationTokenSource();
        }
        //int width, height;
        //MultiFormatReader reader;
        //BarcodeReader reader;

        public ZxingSurfaceView(ZxingActivity activity, MobileBarcodeScanningOptions options)
            : base(activity)
        {
            this.activity = activity;

            screenResolution = new Size(this.activity.WindowManager.DefaultDisplay.Width, this.activity.WindowManager.DefaultDisplay.Height);

            this.options        = options;
            lastPreviewAnalysis = DateTime.Now.AddMilliseconds(options.InitialDelayBeforeAnalyzingFrames);

            //this.reader = this.options.BuildMultiFormatReader();

            this.surface_holder = Holder;
            this.surface_holder.AddCallback(this);
            this.surface_holder.SetType(SurfaceType.PushBuffers);

            this.tokenSource = new System.Threading.CancellationTokenSource();
        }
Example #4
0
        //BarcodeReader reader;

        public ZxingSurfaceView(ZxingActivity activity, MobileBarcodeScanningOptions options)
            : base(activity)
        {
            this.activity = activity;

            screenResolution = new Size(this.activity.WindowManager.DefaultDisplay.Width, this.activity.WindowManager.DefaultDisplay.Height);

            this.options = options;


            this.reader = this.options.BuildMultiFormatReader();

            this.surface_holder = Holder;
            this.surface_holder.AddCallback(this);
            this.surface_holder.SetType(SurfaceType.PushBuffers);



            this.tokenSource = new System.Threading.CancellationTokenSource();
        }
 internal void PlatformAutoFocus()
 => ZxingActivity.RequestAutoFocus();
 internal void PlatformCancel()
 => ZxingActivity.RequestCancel();
 internal void PlatformResumeAnalysis()
 => ZxingActivity.RequestResumeAnalysis();
 internal void PlatformPauseAnalysis()
 => ZxingActivity.RequestPauseAnalysis();
 internal void PlatformTorch(bool on)
 {
     torch = on;
     ZxingActivity.RequestTorch(on);
 }
		//int width, height;
		//MultiFormatReader reader;
		//BarcodeReader reader;

		public ZxingSurfaceView (ZxingActivity activity, MobileBarcodeScanningOptions options)
			: base (activity)
		{
			this.activity = activity;

			screenResolution = new Size(this.activity.WindowManager.DefaultDisplay.Width, this.activity.WindowManager.DefaultDisplay.Height);

			this.options = options;
			lastPreviewAnalysis = DateTime.Now.AddMilliseconds(options.InitialDelayBeforeAnalyzingFrames);

			//this.reader = this.options.BuildMultiFormatReader();

			this.surface_holder = Holder;
			this.surface_holder.AddCallback (this);
			this.surface_holder.SetType (SurfaceType.PushBuffers);
			
			this.tokenSource = new System.Threading.CancellationTokenSource();
		}
Example #11
0
		//BarcodeReader reader;

		public ZxingSurfaceView(ZxingActivity activity)
			: base(activity)
		{
			this.activity = activity;

			screenResolution = new Size(this.activity.WindowManager.DefaultDisplay.Width, this.activity.WindowManager.DefaultDisplay.Height);

			this.surface_holder = Holder;
			this.surface_holder.AddCallback(this);
			this.surface_holder.SetType(SurfaceType.PushBuffers);

			this.tokenSource = new System.Threading.CancellationTokenSource();
		}
Example #12
0
 public override void AutoFocus()
 {
     ZxingActivity.RequestAutoFocus();
 }
Example #13
0
 public override void Cancel()
 {
     ZxingActivity.RequestCancel();
 }
Example #14
0
 public override void ResumeAnalysis()
 {
     ZxingActivity.RequestResumeAnalysis();
 }
Example #15
0
 public override void PauseAnalysis()
 {
     ZxingActivity.RequestPauseAnalysis();
 }
Example #16
0
		//BarcodeReader reader;

		public ZxingSurfaceView (ZxingActivity activity, MobileBarcodeScanningOptions options)
			: base (activity)
		{
			this.activity = activity;

			screenResolution = new Size(this.activity.WindowManager.DefaultDisplay.Width, this.activity.WindowManager.DefaultDisplay.Height);

			this.options = options;


			this.reader = this.options.BuildMultiFormatReader();

			this.surface_holder = Holder;
			this.surface_holder.AddCallback (this);
			this.surface_holder.SetType (SurfaceType.PushBuffers);



			this.tokenSource = new System.Threading.CancellationTokenSource();
		}
Example #17
0
 public override void Torch(bool on)
 {
     torch = on;
     ZxingActivity.RequestTorch(on);
 }