void ScrollForward(bool animated)
        {
            if (Type == CardType.AMEX)
            {
                ccPlaceHolderWidthConstraint.Constant = 178f;
            }
            else
            {
                ccPlaceHolderWidthConstraint.Constant = 198f;
            }
            expiryText.BecomeFirstResponder();
            if (creditCardImage != ccBackImage)
            {
                StatusHelpLabel.Text = "Please enter Expire Date";
            }
            float      width = widthToLastGroup;
            RectangleF frame = new RectangleF(ccText.Frame.Location, new SizeF((width) + textScroller.Frame.Size.Width, ccText.Frame.Size.Height));

            textScroller.ContentSize = new SizeF(frame.Size.Width, textScroller.ContentSize.Height);
            ccText.Frame             = frame;

            ccPlaceHolder.SetText(cardHelper.PromptStringForType(Type, false));

            textScroller.ScrollEnabled = true;
            if (textScroller.ContentOffset != new PointF(width, 0))
            {
                textScroller.SetContentOffset(new PointF(width, 0), animated);
            }

            UpdateCCimageWithTransitionTime(0.25f, true, true);
        }
        private void SetColorGrid()
        {
            var colorCount = _colors.Count;

            for (var i = 0; i < colorCount && i < _colors.Count; i++)
            {
                var color = _colors.ElementAt(i);

                var layer = new CALayer();
                layer.Name            = string.Format("Color_{0}", i);
                layer.CornerRadius    = 6f;
                layer.BackgroundColor = color.Value.CGColor;
                layer.Frame           = new RectangleF(0f, 0f, 70f, 40f);
                LayerHelper.SetupShadow(layer);

                var column = i % 4;
                var row    = i / 4;
                var frame  = new RectangleF((float)(8 + (column * 78)), (float)(8 + row * 48), 70f, 40f);
                var myView = new UIView(frame);
                myView.Tag = 99;
                myView.Layer.AddSublayer(layer);

                _paletteView.AddSubview(myView);
            }
        }
        public static void RepositionFormSheetForiPad(this UIView superview)
        {
            superview.Bounds = new RectangleF(0, 0, 320f, 460f);

            RectangleF frame = superview.Frame;

            frame.Location  = new PointF(frame.Location.X, 180f);
            superview.Frame = frame;
        }
        public void ColorBarTapped(UITapGestureRecognizer recognizer)
        {
            var point = recognizer.LocationInView(_colorBarView);
            var page  = (int)point.X / 25;

            var frame = new RectangleF(page * 320f, 0f, 320f, _paletteView.Frame.Size.Height);

            _paletteView.ScrollRectToVisible(frame, true);
        }
        public ColorPickerHSBView(RectangleF frame)
            : base(frame)
        {
            _hue        = 0f;
            _saturation = 1f;
            _brightness = 1f;

            SetCrosshairView();
            SetGestureRecognizer();
        }
        public ColorPickerHueCircleView(RectangleF frame)
            : base(frame)
        {
            _hue = 0f;

            SetCrosshairView();

            var gestureRecognizer = new UIPanGestureRecognizer(PanOrTapValue);

            this.AddGestureRecognizer(gestureRecognizer);
        }
        private void SetHueCircleView()
        {
            var w     = 320f - 80f;
            var h     = w;
            var frame = new RectangleF(40f, 10f, w, h);

            _hueCircleView = new ColorPickerHueCircleView(frame);
            _hueCircleView.Layer.MasksToBounds = true;
            _hueCircleView.Changed            += HueCircleView_ValueChanged;

            this.View.AddSubview(_hueCircleView);
        }
        private void SetHSLView()
        {
            var w     = 140f;
            var h     = 140f;
            var frame = new RectangleF(90f, 60f, w, h);

            _hsbView = new ColorPickerHSBView(frame);
            _hsbView.Layer.MasksToBounds = true;
            _hsbView.Changed            += HSLView_ValueChanged;

            this.View.AddSubview(_hsbView);
        }
		public LoadingOverlay(RectangleF frame, bool rounded = false)
            : base(frame)
        {
            // configurable bits
            BackgroundColor = UIColor.Gray;
            Alpha = 0.75f;
			AutoresizingMask = UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleTopMargin;

            nfloat labelHeight = 22;
            nfloat labelWidth = Frame.Width - 20;

            // derive the center x and y
            nfloat centerX = Frame.Width / 2;
            nfloat centerY = Frame.Height / 2;

            // create the activity spinner, center it horizontall and put it 5 points above center x
            activitySpinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
			activitySpinner.Frame = new RectangleF(
                centerX - (activitySpinner.Frame.Width / 2),
                centerY - activitySpinner.Frame.Height - 20,
                activitySpinner.Frame.Width,
                activitySpinner.Frame.Height);
            activitySpinner.AutoresizingMask = UIViewAutoresizing.All;
			if (rounded) {
				this.Layer.CornerRadius = 5f;
				this.Layer.MasksToBounds = true;
			}
            AddSubview(activitySpinner);
            activitySpinner.StartAnimating();

            // create and configure the "Loading Data" label
            loadingLabel = new UILabel(new RectangleF(
                centerX - (labelWidth / 2),
                centerY + 20,
                labelWidth,
                labelHeight
                ));
            loadingLabel.BackgroundColor = UIColor.Clear;
            loadingLabel.TextColor = UIColor.White;
		    loadingLabel.Text = "";//"Processing...";
            loadingLabel.TextAlignment = UITextAlignment.Center;
            loadingLabel.AutoresizingMask = UIViewAutoresizing.All;
            AddSubview(loadingLabel);

        }
Esempio n. 10
0
        public LoadingOverlay(RectangleF frame, bool rounded = false)
            : base(frame)
        {
            // configurable bits
            BackgroundColor  = UIColor.Gray;
            Alpha            = 0.75f;
            AutoresizingMask = UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleTopMargin;

            nfloat labelHeight = 22;
            nfloat labelWidth  = Frame.Width - 20;

            // derive the center x and y
            nfloat centerX = Frame.Width / 2;
            nfloat centerY = Frame.Height / 2;

            // create the activity spinner, center it horizontall and put it 5 points above center x
            activitySpinner       = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
            activitySpinner.Frame = new RectangleF(
                centerX - (activitySpinner.Frame.Width / 2),
                centerY - activitySpinner.Frame.Height - 20,
                activitySpinner.Frame.Width,
                activitySpinner.Frame.Height);
            activitySpinner.AutoresizingMask = UIViewAutoresizing.All;
            if (rounded)
            {
                this.Layer.CornerRadius  = 5f;
                this.Layer.MasksToBounds = true;
            }
            AddSubview(activitySpinner);
            activitySpinner.StartAnimating();

            // create and configure the "Loading Data" label
            loadingLabel = new UILabel(new RectangleF(
                                           centerX - (labelWidth / 2),
                                           centerY + 20,
                                           labelWidth,
                                           labelHeight
                                           ));
            loadingLabel.BackgroundColor  = UIColor.Clear;
            loadingLabel.TextColor        = UIColor.White;
            loadingLabel.Text             = "";//"Processing...";
            loadingLabel.TextAlignment    = UITextAlignment.Center;
            loadingLabel.AutoresizingMask = UIViewAutoresizing.All;
            AddSubview(loadingLabel);
        }
Esempio n. 11
0
        public void DrawBevel(RectangleF rect)
        {
            using (CGContext context = UIGraphics.GetCurrentContext()) {
                context.SetLineWidth(1);
                UIColor.Black.SetFill();
                UIColor.Black.SetStroke();
                var currentPath = new CGPath();

                currentPath.AddLines(new PointF[] {
                    new PointF(10, 20),
                    new PointF(16, 10),
                    new PointF(22, 20)
                });
                currentPath.CloseSubpath();
                context.AddPath(currentPath);
                context.DrawPath(CGPathDrawingMode.FillStroke);
            }
        }
		public LoadingOverlay (RectangleF frame) : base (frame)
		{
			// configurable bits
			BackgroundColor = UIColor.Black;
			Alpha = 0.75f;
			AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;

			nfloat labelHeight = 22;
			nfloat labelWidth = Frame.Width - 20;

			// derive the center x and y
			nfloat centerX = Frame.Width / 2;
			nfloat centerY = Frame.Height / 2;

			// create the activity spinner, center it horizontall and put it 5 points above center x
			activitySpinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
			activitySpinner.Frame = new RectangleF (
				centerX - (activitySpinner.Frame.Width / 2) ,
				centerY - activitySpinner.Frame.Height - 20 ,
				activitySpinner.Frame.Width ,
				activitySpinner.Frame.Height);
			activitySpinner.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
			AddSubview (activitySpinner);
			activitySpinner.StartAnimating ();

			// create and configure the "Loading Data" label
			loadingLabel = new UILabel(new RectangleF (
				centerX - (labelWidth / 2),
				centerY + 20 ,
				labelWidth ,
				labelHeight
				));
			loadingLabel.BackgroundColor = UIColor.Clear;
			loadingLabel.TextColor = UIColor.White;
			loadingLabel.Text = "loading...";
			loadingLabel.TextAlignment = UITextAlignment.Center;
			loadingLabel.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
			AddSubview (loadingLabel);
		}
Esempio n. 13
0
        public LoadingOverlay(RectangleF frame) : base(frame)
        {
            // configurable bits
            BackgroundColor  = UIColor.Black;
            Alpha            = 0.75f;
            AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;

            nfloat labelHeight = 22;
            nfloat labelWidth  = Frame.Width - 20;

            // derive the center x and y
            nfloat centerX = Frame.Width / 2;
            nfloat centerY = Frame.Height / 2;

            // create the activity spinner, center it horizontall and put it 5 points above center x
            activitySpinner       = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
            activitySpinner.Frame = new RectangleF(
                centerX - (activitySpinner.Frame.Width / 2),
                centerY - activitySpinner.Frame.Height - 20,
                activitySpinner.Frame.Width,
                activitySpinner.Frame.Height);
            activitySpinner.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
            AddSubview(activitySpinner);
            activitySpinner.StartAnimating();

            // create and configure the "Loading Data" label
            loadingLabel = new UILabel(new RectangleF(
                                           centerX - (labelWidth / 2),
                                           centerY + 20,
                                           labelWidth,
                                           labelHeight
                                           ));
            loadingLabel.BackgroundColor  = UIColor.Clear;
            loadingLabel.TextColor        = UIColor.White;
            loadingLabel.Text             = "loading...";
            loadingLabel.TextAlignment    = UITextAlignment.Center;
            loadingLabel.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
            AddSubview(loadingLabel);
        }
        public void HandleLongPressGesture(UILongPressGestureRecognizer recognizer)
        {
            var point = recognizer.LocationInView(_paletteView);

            switch (recognizer.State)
            {
            case UIGestureRecognizerState.Began:
            {
                if (_currentView == null)
                {
                    var touchedView = _paletteView.HitTest(point, null);

                    if (!touchedView.Equals(_paletteView))
                    {
                        UIView.Animate(0.5, () =>
                            {
                                _previousDeleteViewFrame = _deleteView.Frame;
                                var frame = _deleteView.Frame;
                                frame.Y   = frame.Y - 190f;

                                _deleteView.Frame = frame;
                                _paletteView.BringSubviewToFront(_deleteView);
                            });

                        _paletteView.BringSubviewToFront(touchedView);
                        _currentView   = touchedView;
                        _previousView  = touchedView;
                        _previousPoint = touchedView.Center;
                    }
                }
            }
            break;

            case UIGestureRecognizerState.Changed:
            {
                if (_currentView != null)
                {
                    var center = _currentView.Center;
                    center.X += point.X - _previousView.Center.X;
                    center.Y += point.Y - _previousView.Center.Y;

                    _currentView.Center = center;
                }
            }
            break;

            case UIGestureRecognizerState.Ended:
            {
                if (_currentView != null)
                {
                    var deletePoint = recognizer.LocationInView(_deleteView);

                    if (_deleteView.Bounds.Contains(deletePoint))
                    {
                        var temp  = _currentView.Layer.Sublayers.First().Name.Split(new char[] { '_' });
                        var index = int.Parse(temp[1]);
                        var color = _colors.ElementAt(index);
                        _colors.Remove(color.Key);

                        _favoriteColorManager.Delete(color.Key);

                        ClearColorGrid();
                        SetColorGrid();
                    }

                    _currentView.Center = _previousPoint;
                    _currentView        = null;

                    UIView.Animate(0.5, () =>
                        {
                            _deleteView.Frame = _previousDeleteViewFrame;
                        });
                }
            }
            break;
            }
        }
 public UniversalView(RectangleF bounds)
     : base(bounds)
 {
     Initialize();
 }
Esempio n. 16
0
		public SlideUpMenu (RectangleF frame) : base (frame)
		{
			this.Frame = frame;
		}
Esempio n. 17
0
		public void DrawBevel (RectangleF rect)
		{
			using (CGContext context = UIGraphics.GetCurrentContext ()) {

				context.SetLineWidth (1);
				UIColor.Black.SetFill ();
				UIColor.Black.SetStroke ();
				var currentPath = new CGPath ();
	
				currentPath.AddLines (new PointF[] {
					new PointF (10, 20),
					new PointF (16, 10), 
					new PointF (22, 20)
				});
				currentPath.CloseSubpath ();
				context.AddPath (currentPath);    
				context.DrawPath (CGPathDrawingMode.FillStroke);   
			}
		}
Esempio n. 18
0
		public override void Draw (RectangleF rect)
		{
			base.Draw (rect);

		}
		public override void Draw (RectangleF rect)
		{
			RectangleF r = Offset;

			string clearText = Text.Substring (0, ShowTextOffset);
			string grayText = Text.Substring (ShowTextOffset, Text.Length - ShowTextOffset);

			CGContext context = UIGraphics.GetCurrentContext ();

			CGColor clearColor = UIColor.Clear.CGColor;
			context.SetStrokeColor(clearColor);
			context.SetFillColor(clearColor);
			context.FillRect(rect);

			if (clearText.Length !=0) 
			{
				r.Location = new PointF(r.Location.X+ clearText.DrawString (Offset.Location, Font).Width,r.Location.Y);
			}

			CSRange charsToDraw = new CSRange(0, grayText.Length);

			if (charsToDraw.Length !=0) 
			{
				CGColor grayColor = UIColor.LightGray.CGColor;

				context.SetStrokeColor (grayColor);
				context.SetFillColor (grayColor);

				var chars = grayText.ToCharArray();
				int i;
				for (i = 0; i < chars.Length; i++) 
				{
					char character = chars[i];
					if (character == ' ') {
						r.Location= new PointF(r.Location.X+  Offset.Size.Width, r.Location.Y);
						continue;
					}
					if (character == 'X') {
						#if LED_FONT
						RectangleF box = rect.Inset(2, 1);
						#else
						CGRect box = rect.Inset (3, 3);
						#endif
						nfloat radius = 3;
						context.BeginPath ();
						context.MoveTo (box.GetMinX () + radius, box.GetMinY ());
						var mask = "0";
						UIFont drawFont = JudoSDKManager.FIXED_WIDTH_FONT_SIZE_20;
						mask.DrawString(box, drawFont);
						r.Location= new PointF(r.Location.X+  Offset.Size.Width, r.Location.Y);
						continue;
					}
					break;
				}

				charsToDraw.Location += i;
				charsToDraw.Length -= i;
				if (charsToDraw.Length != 0) 
				{					
					grayText.Substring((int)charsToDraw.Location, (int)charsToDraw.Length).DrawString (r.Location, JudoSDKManager.FIXED_WIDTH_FONT_SIZE_20);
				}
			}
		}
Esempio n. 20
0
        void SetupPlaceViews()
        {
            ccText.Text = "11112222333344445555";

            UITextPosition start     = ccText.BeginningOfDocument;
            UITextPosition end       = ccText.GetPosition(start, 20);
            UITextRange    range     = ccText.GetTextRange(start, end);
            RectangleF     r         = ccText.GetFirstRectForRange(range);
            SizeF          frameRect = r.Size;

            frameRect.Width = (r.Size.Width / 24.0f);
            ccText.Font     = JudoSDKManager.FIXED_WIDTH_FONT_SIZE_20;
            r.Size          = frameRect;
            ccText.Text     = "";


            RectangleF frame = ccPlaceHolder.Frame;

            ccPlaceHolder.Font = JudoSDKManager.FIXED_WIDTH_FONT_SIZE_20;
            ccPlaceHolder.Text = "0000 0000 0000 0000";

            ccPlaceHolder.SetShowTextOffSet(0);
            ccPlaceHolder.Offset = r;

            ccPlaceHolder.BackgroundColor = UIColor.Clear;
            textScroller.InsertSubview(ccPlaceHolder, 0);

            /////////

            expiryText.Text = "MM/YY";

            UITextPosition exStart     = expiryText.BeginningOfDocument;
            UITextPosition exEnd       = expiryText.GetPosition(exStart, 5);
            UITextRange    exRange     = expiryText.GetTextRange(exStart, exEnd);
            RectangleF     exR         = expiryText.GetFirstRectForRange(exRange);
            SizeF          exFrameRect = exR.Size;

            exFrameRect.Width = (exR.Size.Width / 24.0f);
            expiryText.Font   = JudoSDKManager.FIXED_WIDTH_FONT_SIZE_20;
            exR.Size          = exFrameRect;
            expiryText.Text   = "";



            RectangleF expiryFrame = expiryPlaceHolder.Frame;

            expiryPlaceHolder.Font = expiryText.Font;
            expiryPlaceHolder.Text = "MM/YY";

            expiryPlaceHolder.SetShowTextOffSet(0);
            expiryPlaceHolder.Offset = exR;

            expiryPlaceHolder.BackgroundColor = UIColor.Clear;
            textScroller.InsertSubview(expiryPlaceHolder, 1);

            ////

            cvTwoText.Text = "CV2";

            UITextPosition cvStart     = cvTwoText.BeginningOfDocument;
            UITextPosition cvEnd       = cvTwoText.GetPosition(cvStart, 3);
            UITextRange    cvRange     = cvTwoText.GetTextRange(cvStart, cvEnd);
            RectangleF     cvR         = cvTwoText.GetFirstRectForRange(cvRange);
            SizeF          cvFrameRect = cvR.Size;

            cvFrameRect.Width = (cvR.Size.Width / 24.0f);
            cvTwoText.Font    = JudoSDKManager.FIXED_WIDTH_FONT_SIZE_20;
            cvR.Size          = cvFrameRect;
            cvTwoText.Text    = "";

            RectangleF cvTwoFrame = cvTwoPlaceHolder.Frame;

            cvTwoPlaceHolder.Font = cvTwoText.Font;
            cvTwoPlaceHolder.Text = "CV2";

            cvTwoPlaceHolder.SetShowTextOffSet(0);
            cvTwoPlaceHolder.Offset = cvR;

            cvTwoPlaceHolder.BackgroundColor = UIColor.Clear;
            textScroller.InsertSubview(cvTwoPlaceHolder, 2);
        }
Esempio n. 21
0
 public SlideUpMenu(RectangleF frame) : base(frame)
 {
     this.Frame = frame;
 }
Esempio n. 22
0
 public override void Draw(RectangleF rect)
 #endif
 {
     DrawHueCircle();
     DrawBlankMiddleCircle();
 }
Esempio n. 23
0
 public override void Draw(RectangleF rect)
 #endif
 {
     DrawColorSqure();
 }
Esempio n. 24
0
 public static RectangleF ToRectangleF(this global::CoreGraphics.CGRect r)
 {
     return(new RectangleF((float)r.X, (float)r.Y, (float)r.Width, (float)r.Height));
 }
Esempio n. 25
0
 public static nfloat CalculateArea(RectangleF rect)
 {
     // Calculate area...
     return(rect.Width * rect.Height);
 }
Esempio n. 26
0
        public override void Draw(RectangleF rect)
        {
            RectangleF r = Offset;

            string clearText = Text.Substring(0, ShowTextOffset);
            string grayText  = Text.Substring(ShowTextOffset, Text.Length - ShowTextOffset);

            CGContext context = UIGraphics.GetCurrentContext();

            CGColor clearColor = UIColor.Clear.CGColor;

            context.SetStrokeColor(clearColor);
            context.SetFillColor(clearColor);
            context.FillRect(rect);

            if (clearText.Length != 0)
            {
                r.Location = new PointF(r.Location.X + clearText.DrawString(Offset.Location, Font).Width, r.Location.Y);
            }

            CSRange charsToDraw = new CSRange(0, grayText.Length);

            if (charsToDraw.Length != 0)
            {
                CGColor grayColor = UIColor.LightGray.CGColor;

                context.SetStrokeColor(grayColor);
                context.SetFillColor(grayColor);

                var chars = grayText.ToCharArray();
                int i;
                for (i = 0; i < chars.Length; i++)
                {
                    char character = chars [i];
                    if (character == ' ')
                    {
                        r.Location = new PointF(r.Location.X + Offset.Size.Width, r.Location.Y);
                        continue;
                    }
                    if (character == 'X')
                    {
                        #if LED_FONT
                        RectangleF box = rect.Inset(2, 1);
                        #else
                        CGRect box = rect.Inset(3, 3);
                        #endif
                        nfloat radius = 3;
                        context.BeginPath();
                        context.MoveTo(box.GetMinX() + radius, box.GetMinY());
                        var    mask     = "0";
                        UIFont drawFont = JudoSDKManager.FIXED_WIDTH_FONT_SIZE_20;
                        mask.DrawString(box, drawFont);
                        r.Location = new PointF(r.Location.X + Offset.Size.Width, r.Location.Y);
                        continue;
                    }
                    break;
                }

                charsToDraw.Location += i;
                charsToDraw.Length   -= i;
                if (charsToDraw.Length != 0)
                {
                    grayText.Substring((int)charsToDraw.Location, (int)charsToDraw.Length).DrawString(r.Location, JudoSDKManager.FIXED_WIDTH_FONT_SIZE_20);
                }
            }
        }
Esempio n. 27
0
		public static nfloat CalculateArea(RectangleF rect) {

			// Calculate area...
			return (rect.Width * rect.Height);

		}
Esempio n. 28
0
		void ScrollForward (bool animated)
		{

			if(Type== CardType.AMEX)
            {
				ccPlaceHolderWidthConstraint.Constant = 178f;

			} else {
				ccPlaceHolderWidthConstraint.Constant = 198f;
			}
			expiryText.BecomeFirstResponder ();
			if (creditCardImage != ccBackImage) {
				StatusHelpLabel.Text = "Please enter Expire Date";
			}
			float width = widthToLastGroup;
			RectangleF frame = new RectangleF (ccText.Frame.Location, new SizeF ((width) + textScroller.Frame.Size.Width, ccText.Frame.Size.Height));
			textScroller.ContentSize = new SizeF (frame.Size.Width, textScroller.ContentSize.Height);
			ccText.Frame = frame;

			ccPlaceHolder.SetText (cardHelper.PromptStringForType (Type, false));

			textScroller.ScrollEnabled = true;
			if (textScroller.ContentOffset != new PointF (width, 0)) {

				textScroller.SetContentOffset (new PointF (width, 0), animated);

			}

			UpdateCCimageWithTransitionTime (0.25f, true, true); 
		}
Esempio n. 29
0
 public override void ScrollRectToVisible(RectangleF rect, bool animated)
 {
 }