BarcodeTesting.Controllers.CameraOverLayView.SetArrows C# (CSharp) Method

SetArrows() public method

public SetArrows ( bool inRange, bool animated ) : void
inRange bool
animated bool
return void
        public void SetArrows(bool inRange, bool animated)
        {
            // already showing green bars
            if (inRange && _isGreen) return;

            // update flag
            _isGreen = inRange;

            if (_isGreen)
            {
                _textCue.Text =  "Hold still for scanning";
                _otherView1 = _whiteTopArrow;
                _otherView2 = _whiteBottomArrow;
                _focusView1 = _greenTopArrow;
                _focusView2 = _greenBottomArrow;
            }
            else
            {
                _textCue.Text =  "Adjust barcode according to arrows";
                _focusView1 = _whiteTopArrow;
                _focusView2 = _whiteBottomArrow;
                _otherView1 = _greenTopArrow;
                _otherView2 = _greenBottomArrow;
            }

            if (animated)
            {
                UIView.BeginAnimations("");
                UIView.SetAnimationDuration(0.15f);
                UIView.SetAnimationBeginsFromCurrentState(true);
            }

            _focusView1.Alpha = 1;
            _focusView2.Alpha = 1;

            _otherView1.Alpha = 0;
            _otherView2.Alpha = 0;

            if (animated) UIView.CommitAnimations();
        }

Usage Example

Example #1
0
 public void foundPossibleResultPoint(ResultPoint point)
 {
     if (point != null)
     {
         _view.SetArrows(true, true);
     }
     else
     {
         _view.SetArrows(false, true);
     }
 }