Ejemplo n.º 1
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);

        }
		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);
		}
Ejemplo n.º 3
0
		public SlideUpMenu (RectangleF frame) : base (frame)
		{
			this.Frame = frame;
		}
Ejemplo n.º 4
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);   
			}
		}
Ejemplo n.º 5
0
		public override void Draw (RectangleF rect)
		{
			base.Draw (rect);

		}
Ejemplo n.º 6
0
		public static nfloat CalculateArea(RectangleF rect) {

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

		}
Ejemplo n.º 7
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); 
		}
		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);
				}
			}
		}
 public UniversalView(RectangleF bounds)
     : base(bounds)
 {
     Initialize();
 }