Inheritance: FragmentActivity
Esempio n. 1
0
        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);
        }
Esempio n. 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();
        }
Esempio n. 3
0
        //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();
        }
Esempio n. 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();
		}
Esempio n. 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();
		}
Esempio n. 12
0
 public override void AutoFocus()
 {
     ZxingActivity.RequestAutoFocus();
 }
Esempio n. 13
0
 public override void Cancel()
 {
     ZxingActivity.RequestCancel();
 }
Esempio n. 14
0
 public override void ResumeAnalysis()
 {
     ZxingActivity.RequestResumeAnalysis();
 }
Esempio n. 15
0
 public override void PauseAnalysis()
 {
     ZxingActivity.RequestPauseAnalysis();
 }
Esempio n. 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();
		}
Esempio n. 17
0
 public override void Torch(bool on)
 {
     torch = on;
     ZxingActivity.RequestTorch(on);
 }