Ejemplo n.º 1
0
		public GameboardView (int d,float width,float padding,float radius, UIColor backgroundColor, UIColor foregroundColor)
		{
			if (d > 0) {

			} else
				throw new Exception ();
		}
Ejemplo n.º 2
0
		public virtual bool WillFinishLaunching (UIApplication application, MonoTouch.Foundation.NSDictionary launchOptions){
			UIViewController leftSideDrawerViewController = new MMExampleLeftSideDrawerViewController ();
			UIViewController centerViewController = new MMExampleCenterTableViewController ();
			UIViewController rightSideDrawerViewController = new UIViewController ();// new MMExampleRightSideDrawerViewController ();

			UINavigationController navigationController = new MMNavigationController ();
			navigationController.ViewControllers = new UIViewController[]{ centerViewController };
			navigationController.RestorationIdentifier = "MMExampleCenterNavigationControllerRestorationKey";

			UINavigationController leftSideNavController = new MMNavigationController ();
			leftSideNavController.ViewControllers = new UIViewController[]{ leftSideDrawerViewController };
			leftSideNavController.RestorationIdentifier = "MMExampleLeftNavigationControllerRestorationKey";

			this.DrawerController = new MMDrawerController.MMDrawerController ();
			DrawerController.CenterViewController = navigationController;
			DrawerController.LeftDrawerViewController = leftSideNavController;

			DrawerController.RestorationIdentifier = "MMDrawer";
			DrawerController.MaximumRightDrawerWidth = 200.0F;
			DrawerController.OpenDrawerGestureModeMask = MMOpenDrawerGestureMode.BezelPanningCenterView;
			DrawerController.CloseDrawerGestureModeMask = MMCloseDrawerGestureMode.BezelPanningCenterView;

			//DrawerController.DrawerVisualStateBlock = new Action (DrawerAction (DrawerController, new MMDrawerSide(), 100F));

			this.Window = new UIWindow (UIScreen.MainScreen.Bounds);
			UIColor tintColor = new UIColor (29.0F / 255.0F, 173.0F / 255.0F, 234.0F / 255.0F, 1.0F);
			this.Window.TintColor = tintColor;

			this.Window.RootViewController = this.DrawerController;

			return true;
		}
        public static UIView CreateToolbarTextImageIcon(string label, EventHandler action, UIImage iconImage, UIColor textColor, float width = 60)
        {
            float height = 30;
            float iconSize = 20;
            float iconMargin = 5;

            UILabel lb = new UILabel() {
                Font = UIFont.SystemFontOfSize(14),
                TextColor = textColor,
                Text = label,
                BackgroundColor = UIColor.Clear,
                TextAlignment = UITextAlignment.Left
            };
            lb.SizeToFit();
            int x = (int)(iconSize + (iconMargin * 2));
            int y = (int)((height - lb.Frame.Height) / 2);
            lb.Frame = new RectangleF (x, y, width-y, lb.Frame.Height);

            UIButton btn = new UIButton(UIButtonType.Custom);
            btn.Frame = new RectangleF(0, 0, width, height);
            if (action != null)
                btn.TouchUpInside += action;

            UIImageView iv = new UIImageView(iconImage);
            iv.Frame = new RectangleF(iconMargin, iconMargin, iconSize, iconSize);

            UIView container = new UIView(new RectangleF(0, 0, width, height));
            container.Add(iv);
            container.Add(btn);
            container.Add(lb);
            return container;
        }
		public override void ViewDidLoad(){
			this.TableView = new UITableView (this.View.Bounds, UITableViewStyle.Grouped);
			base.ViewDidLoad ();
			this.View.AddSubview (this.TableView);

			UITapGestureRecognizer doubleTap = new UITapGestureRecognizer ();
			doubleTap.NumberOfTapsRequired = 2;
			this.View.AddGestureRecognizer (doubleTap);

			UITapGestureRecognizer twoFingerDoubleTap = new UITapGestureRecognizer ();
			twoFingerDoubleTap.NumberOfTapsRequired = 2;
			twoFingerDoubleTap.NumberOfTouchesRequired = 2;
			this.View.AddGestureRecognizer (twoFingerDoubleTap);

			this.SetupLeftButton ();
			this.SetupRightButton ();

			UIColor barColor = new UIColor (247.0F / 255.0F, 249.0F / 255.0F, 250.0F / 255.0F, 1.0F);
			this.NavigationController.NavigationBar.BarTintColor = barColor;

			MMLogoView logo = new MMLogoView (new RectangleF (0F, 0F, 29F, 31F));
			this.NavigationItem.TitleView = logo;
			this.NavigationController.View.Layer.CornerRadius = 10.0F;

			UIView backView = new UIView ();
			backView.BackgroundColor = new UIColor (208.0F / 255.0F, 208.0F / 255.0F, 208.0F / 255.0F, 1.0F);
			this.TableView.BackgroundView = backView;
		}
 /// <summary>
 /// Creates a new instance of the GlassButton using the specified dimensions
 /// </summary>
 public GlassButton(RectangleF frame)
     : base(frame)
 {
     NormalColor = new UIColor (0.55f, 0.04f, 0.02f, 1);
     HighlightedColor = UIColor.Black;
     DisabledColor = UIColor.Gray;
 }
Ejemplo n.º 6
0
		public static UIImage ButtonImage (UIColor color, float cornerRadius, UIColor shadowColor, UIEdgeInsets shadowInsets)
		{

			UIImage topImage = ImageWithColor (color, cornerRadius);
			UIImage bottomImage = ImageWithColor (shadowColor, cornerRadius);

			float totalHeight = EdgeSizeFromCornerRadius (cornerRadius) + shadowInsets.Top + shadowInsets.Bottom;
			float totalWidth = EdgeSizeFromCornerRadius (cornerRadius) + shadowInsets.Left + shadowInsets.Right;
			float topWidth = EdgeSizeFromCornerRadius (cornerRadius);
			float topHeight = EdgeSizeFromCornerRadius (cornerRadius);
			RectangleF topRect = new RectangleF (shadowInsets.Left, shadowInsets.Top, topWidth, topHeight);
			RectangleF bottomRect = new RectangleF (0, 0, totalWidth, totalHeight);

			UIGraphics.BeginImageContextWithOptions (new SizeF (totalWidth, totalHeight), false, 0.0f);

			if (!RectangleF.Equals (bottomRect, topRect)) {
				bottomImage.Draw (bottomRect);
			}
			topImage.Draw (topRect);

			UIImage buttonImage = UIGraphics.GetImageFromCurrentImageContext ();
			UIGraphics.EndImageContext ();
			UIEdgeInsets resizeableInsets = new UIEdgeInsets (cornerRadius + shadowInsets.Top,
			                                                  cornerRadius + shadowInsets.Left,
			                                                  cornerRadius + shadowInsets.Bottom,
			                                                  cornerRadius + shadowInsets.Right);
			return buttonImage.CreateResizableImage (resizeableInsets);
		}
Ejemplo n.º 7
0
        public static UIImage AddText(this UIImage image, string text, PointF point, UIFont font, UIColor color, UITextAlignment alignment = UITextAlignment.Left)
        {
            //var labelRect = new RectangleF(point, new SizeF(image.Size.Width - point.X, image.Size.Height - point.Y));
            var h = text.StringHeight(font, image.Size.Width);
            var labelRect = new RectangleF(point, new SizeF(image.Size.Width - point.X, h));

            var label = new UILabel(labelRect)
            { 
                Font = font, 
                Text = text,
                TextColor = color,
                TextAlignment = alignment,
                BackgroundColor = UIColor.Clear
            };

            var labelImage = label.ToNativeImage();
            

            using (var context = image.Size.ToBitmapContext())
            {
                var rect = new RectangleF(new PointF(0, 0), image.Size);
                context.DrawImage(rect, image.CGImage);
                context.DrawImage(labelRect, labelImage.CGImage);
                context.StrokePath();
                return UIImage.FromImage(context.ToImage());
            }
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			TableView = new UITableView (this.View.Frame, UITableViewStyle.Grouped);
			TableView.Delegate = this.TableView.Delegate;
			TableView.DataSource = this.TableView.DataSource;
			this.View.AddSubview (this.TableView);
			TableView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

			UIColor tableViewBackgroundColor = new UIColor (110.0F / 255.0F, 113.0F / 255.0F, 115.0F / 255.0F, 1.0F);
			UIColor barColor = new UIColor (161.0F / 255.0F, 164.0F / 255.0F, 166.0F / 255.0F, 1.0F);

			this.TableView.BackgroundColor = tableViewBackgroundColor;
			this.TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
			this.View.BackgroundColor = new UIColor (161.0F / 255.0F, 164.0F / 255.0F, 166.0F / 255.0F, 1.0F);
			//if(this.NavigationController.NavigationBar RespondsToSelector(UIAppearance.SelectorAppearance)){
			this.NavigationController.NavigationBar.BarTintColor = barColor;

			UIColor titleColor = new UIColor (55.0F / 255.0F, 70.0F / 255.0F, 77.0F / 255.0F, 1.0F);

			this.NavigationController.NavigationBar.SetTitleTextAttributes (new UITextAttributes (){ TextColor = titleColor });

			this.DrawerWidths = NSArray.FromStrings (new string[] { "160", "200", "240", "280", "320" });
			SizeF logoSize = new SizeF (58F, 62F);
			MMLogoView logo = new MMLogoView (this.View.Frame);
			logo.Frame = new RectangleF (this.TableView.Bounds.GetMidX () - logoSize.Width / 2.0F, -logoSize.Height - logoSize.Height / 4.0F, logoSize.Width, logoSize.Height);
			logo.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
			this.TableView.AddSubview (logo);
			this.View.BackgroundColor = UIColor.Clear;
		}
Ejemplo n.º 9
0
 public int Add(string title, UIColor color, Action action)
 {
     var index = AddButton (title);
     dict.Add (index, action);
     colors.Add(index,color);
     return index;
 }
Ejemplo n.º 10
0
 void init()
 {
     TitleColor = TintColor;
     BorderWidth = .5f;
     CornerRadius = 5f;
     TitleLabel.AddObserver (this,new MonoTouch.Foundation.NSString("text"), MonoTouch.Foundation.NSKeyValueObservingOptions.Old | MonoTouch.Foundation.NSKeyValueObservingOptions.New,IntPtr.Zero);
 }
Ejemplo n.º 11
0
		public RefreshTableHeaderView (RectangleF rect) : base (rect)
		{
			this.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
			
			BackgroundColor = new UIColor (0.88f, 0.9f, 0.92f, 1);
			CreateViews ();
		}
Ejemplo n.º 12
0
		public static UIColor ToUIColor(this Color sourceColor)
		{
			UIColor uiColor = new UIColor();
			Type UIColorType = typeof(UIColor);
			var color = UIColorType.GetProperties().SingleOrDefault((p)=>p.Name == sourceColor.ToString());
			return color.GetValue(uiColor, null) as UIColor;
		}
Ejemplo n.º 13
0
            public string AddButton(string name, double left, double top, double width, double height, UIColor color, string command = "", string parent = "HUD/Overlay", string closeUi = "")
            {
                name = name + RandomString();

                ui.Add(new Dictionary<string, object> {
                    {"name", name},
                    {"parent", parent},
                    {"components",
                        new List<object> {
                            new Dictionary<string, string> {
                                {"type", "UnityEngine.UI.Button"},
                                {"close", closeUi},
                                {"command", command},
                                {"color", color.ToString()},
                                {"imagetype", "Tiled"}
                            },

                            new Dictionary<string, string> {
                                {"type", "RectTransform"},
                                {"anchormin", $"{left.ToString()} {((1 - top) - height).ToString()}"},
                                {"anchormax", $"{(left + width).ToString()} {(1 - top).ToString()}"}
                            }
                        }
                    }
                });

                objectList.Add(name);
                return name;
            }
Ejemplo n.º 14
0
		/// <summary>
		/// Creates a new instance of the ImageButton using the specified dimensions
		/// </summary>
		public ImageButton (RectangleF frame) : base (frame)
		{
			NormalColor = new UIColor (0.55f, 0.04f, 0.02f, 1);
			HighlightedColor = UIColor.Black;
			DisabledColor = UIColor.Gray;
			_DrawImage = false;
		}
		public LoadMoreElement (string normalCaption, string loadingCaption, Action<LoadMoreElement> tapped, UIFont font, UIColor textColor) : base ("")
		{
			this.NormalCaption = normalCaption;
			this.LoadingCaption = loadingCaption;
			this.tapped = tapped;
			this.font = font;
			
			cell = new UITableViewCell (UITableViewCellStyle.Default, "loadMoreElement");
			
			activityIndicator = new UIActivityIndicatorView () {
				ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray,
				Hidden = true
			};
			activityIndicator.StopAnimating ();
			
			caption = new UILabel () {
				Font = font,
				Text = this.NormalCaption,
				TextColor = textColor,
				BackgroundColor = UIColor.Clear,
				TextAlignment = UITextAlignment.Center,
				AdjustsFontSizeToFitWidth = false,
			};
			
			Layout ();
			
			cell.ContentView.AddSubview (caption);
			cell.ContentView.AddSubview (activityIndicator);
		}
Ejemplo n.º 16
0
		/// <summary>
		/// Initializes a new instance of the <see cref="RoundedRectView"/> class.
		/// </summary>
		/// <param name='rect'>Rectangle of the view</param>
		/// <param name='oBackgroundColor'>background color</param>
		/// <param name='eCornerFlags'>rounded corners</param>
		public RoundedRectView (RectangleF rect, UIColor oBackgroundColor, UIRectCorner eCornerFlags) : base(rect)
		{
			this.fCornerRadius = CORNER_RADIUS;
			this.eRoundedCorners = eCornerFlags;
			this.BackgroundColor = oBackgroundColor;
			this.UpdateMask();
		}
Ejemplo n.º 17
0
		/// <summary>
		/// Initializes a new instance of the <see cref="RoundedRectView"/> class.
		/// </summary>
		/// <param name='rect'>Rectangle of the view</param>
		/// <param name='oBackgroundColor'>background color</param>
		public RoundedRectView (RectangleF rect, UIColor oBackgroundColor, float cornerRadius) : base(rect)
		{
			this.fCornerRadius = cornerRadius;
			this.eRoundedCorners = UIRectCorner.AllCorners;
			this.BackgroundColor = oBackgroundColor;
			this.UpdateMask ();
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			Title = "Picker";
			greaterThanSeven = UIDevice.CurrentDevice.CheckSystemVersion (7, 0);
			backgroundColor = greaterThanSeven ? UIColor.White : UIColor.Clear;
			labelTextColor = greaterThanSeven ? UIColor.Black : UIColor.White;

			NavigationController.NavigationBar.Translucent = false;
			NavigationController.NavigationBar.BackgroundColor = backgroundColor;
			View.BackgroundColor = greaterThanSeven ? UIColor.White : UIColor.Black;
			CreatePicker ();
			CreateDatePicker ();
			CreateCustomPicker ();
	
			// Colors
			buttonBarSegmentedControl.TintColor = UIColor.DarkGray;
			pickerStyleSegmentedControl.TintColor = UIColor.DarkGray;
	
			label = new UILabel (new RectangleF (20f, myPickerView.Frame.Y - 30f, View.Bounds.Width - 40f, 30f)){
				Font = UIFont.SystemFontOfSize (14),
				TextAlignment = UITextAlignment.Center,
				TextColor = labelTextColor,
				BackgroundColor = UIColor.Clear
			};
			View.AddSubview (label);
			buttonBarSegmentedControl.SelectedSegment = 0;
			datePickerView.Mode = UIDatePickerMode.Date;
		}
 public static void AddUtilityButton(this List<UIButton> list,  string title, UIColor color)
 {
     var button = new UIButton (UIButtonType.Custom);
     button.BackgroundColor = color;
     button.SetTitle (title, UIControlState.Normal);
     button.SetTitleColor (UIColor.White, UIControlState.Normal);
     list.Add (button);
 }
Ejemplo n.º 20
0
 public CustomButton(RectangleF frame, UIColor color)
     : base(frame)
 {
     this.Layer.CornerRadius = 14.0f;
     this.Layer.MasksToBounds = true;
     this.TitleLabel.Font = UIFont.BoldSystemFontOfSize(14.0f);
     this.BackgroundColor = color;
 }
Ejemplo n.º 21
0
 public MultilinedElement(string caption)
     : base(UITableViewCellStyle.Default, "multilinedelement")
 {
     Caption = caption;
     CaptionFont = UIFont.BoldSystemFontOfSize(15f);
     ValueFont = UIFont.SystemFontOfSize(14f);
     CaptionColor = ValueColor = UIColor.FromRGB(41, 41, 41);
 }
Ejemplo n.º 22
0
		public LoadMoreElement (string normalCaption, string loadingCaption, Action<LoadMoreElement> tapped, UIFont font, UIColor textColor) : base ("")
		{
			NormalCaption = normalCaption;
			LoadingCaption = loadingCaption;
			Tapped += tapped;
			Font = font;
			TextColor = textColor;
		}
 public MetroActivityIndicatorView(RectangleF frame,UIColor color=null)
     : base(frame)
 {
     if (color==null)
         CommonInit (kDefaultColor);
     else
         CommonInit (color);
 }
Ejemplo n.º 24
0
 public TestView(RectangleF rect,string text,UIColor backColor)
     : base(rect)
 {
     this.BackgroundColor = backColor;
     label = new UILabel(rect);
     label.Text = text;
     label.BackgroundColor = backColor;
     AddSubview(label);
 }
Ejemplo n.º 25
0
		public LoadMoreElement (string normalCaption, string loadingCaption, Action<LoadMoreElement> tapped, UIFont font, UIColor textColor) 
            : base (UITableViewCellStyle.Default, key.ToString())
		{
			NormalCaption = normalCaption;
			LoadingCaption = loadingCaption;
			Tapped += tapped;
			Font = font;
			TextColor = textColor;
		}
Ejemplo n.º 26
0
 protected override void Dispose(bool disposing)
 {
     color = null;
     color2 = null;
     color3 = null;
     shadow = null;
     go = null;
     base.Dispose (disposing);
 }
Ejemplo n.º 27
0
 public static void GetCellSelectedColor(UITableViewCell cell)
 {
     using (var v = new UIView(cell.Frame))
     {
         var LightBlue = new UIColor(0.29f, 0.50f, 0.53f, 255.0f);
         v.BackgroundColor = LightBlue;
         cell.SelectedBackgroundView = v;
     }
 }
Ejemplo n.º 28
0
        public UIViewFullscreen()
        {
            var cBackground = new UIColor (0.0f, 0.0f, 0.0f, 0.9f);
            BackgroundColor = cBackground;

            scrollViewMain = new UIScrollViewImage ();
            AddSubview (scrollViewMain);
            AddClose ();
        }
 public DrawingView(RectangleF rect)
     : base(rect)
 {
     ContentMode = UIViewContentMode.Redraw;
     this.AutoresizingMask = UIViewAutoresizing.All;
     var color = Color.Wheat;
     var wheat = new UIColor(color.R / 255f, color.G/255f, color.B/255f, color.A/255f );
     BackgroundColor = wheat;
 }
Ejemplo n.º 30
0
 static CustomCell()
 {
     if (font == null)
         font = UIFont.BoldSystemFontOfSize(UIFont.SystemFontSize);
     if (background == null)
         background = UIImage.FromFile(@"Images/cell-background.png");
     if (textColor == null)
         textColor = UIColor.FromRGBA(255, 255, 255, 32);
 }
Ejemplo n.º 31
0
        private void Theme()
        {
            //UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;

            UISwitch.Appearance.OnTintColor = UIColor.FromRGB(45, 80, 148);

            UINavigationBar.Appearance.TintColor    = UIColor.White;
            UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(45, 80, 148);
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White, Font = UIFont.SystemFontOfSize(18f)
            });
            UINavigationBar.Appearance.BackIndicatorImage = CodeFramework.iOS.Images.BackButton;
            UINavigationBar.Appearance.BackIndicatorTransitionMaskImage = CodeFramework.iOS.Images.BackButton;

            UIImageView.AppearanceWhenContainedIn(typeof(UITableViewCell)).TintColor = UIColor.FromRGB(45, 80, 148);

            MonoTouch.Dialog.SplitButtonElement.TextColor = UIColor.FromRGB(45, 80, 148);

            //CodeFramework.iOS.Utils.Hud.BackgroundTint = UIColor.FromRGBA(228, 228, 228, 128);

            //UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(45,80,148);

            UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationController)).TintColor = UIColor.White;

            UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = UIColor.FromRGB(136, 136, 136);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).Font      = UIFont.SystemFontOfSize(13f);

            //UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes()
            {
                TextColor = UIColor.White,
            }, UIControlState.Normal);

//            CodeFramework.iOS.Views.StartupView.TextColor = UIColor.FromWhiteAlpha(0.9f, 1.0f);
//            CodeFramework.iOS.Views.StartupView.SpinnerColor = UIColor.FromWhiteAlpha(0.85f, 1.0f);
//            CodeFramework.iOS.Views.StartupView.StatusBarStyle = UIStatusBarStyle.LightContent;
        }
Ejemplo n.º 32
0
        public Localization()
        {
            schedule = new SFSchedule();

            label.Text      = "Select the Locale";
            label.TextColor = UIColor.Black;
            this.AddSubview(label);

            textbutton.SetTitle("French", UIControlState.Normal);
            textbutton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            textbutton.BackgroundColor     = UIColor.Clear;
            textbutton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            textbutton.Hidden             = false;
            textbutton.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;
            textbutton.Layer.BorderWidth  = 4;
            textbutton.Layer.CornerRadius = 8;
            textbutton.TouchUpInside     += ShowPicker;
            this.AddSubview(textbutton);

            button.SetTitle("Done\t", UIControlState.Normal);
            button.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            button.BackgroundColor     = UIColor.FromRGB(240, 240, 240);
            button.SetTitleColor(UIColor.Black, UIControlState.Normal);
            button.Hidden         = true;
            button.TouchUpInside += HidePicker;

            schedule.Locale       = new NSLocale("fr-FR");
            schedule.Appointments = getFrenchAppointments();
            schedule.ScheduleView = SFScheduleView.SFScheduleViewWeek;
            this.AddSubview(schedule);

            appView = new UITableView();
            appView.RegisterClassForCellReuse(typeof(UITableViewCell), "Cell");

            this.AddSubview(appView);

            this.languages.Add((NSString)"French");
            this.languages.Add((NSString)"Spanish");
            this.languages.Add((NSString)"English");
            this.languages.Add((NSString)"Chinese");

            SchedulePickerModel model = new SchedulePickerModel(this.languages);

            model.PickerChanged += (sender, e) =>
            {
                this.localisation_Languages = e.SelectedValue;
                textbutton.SetTitle(localisation_Languages, UIControlState.Normal);
                if (localisation_Languages == "French")
                {
                    schedule.Locale       = new NSLocale("fr-FR");
                    schedule.Appointments = getFrenchAppointments();
                }
                else if (localisation_Languages == "Spanish")
                {
                    schedule.Locale       = new NSLocale("es-AR");
                    schedule.Appointments = getSpanishAppointments();
                }
                else if (localisation_Languages == "English")
                {
                    schedule.Locale       = new NSLocale("en-US");
                    schedule.Appointments = getEnglishAppointments();
                }
                else if (localisation_Languages == "Chinese")
                {
                    schedule.Locale       = new NSLocale("zh-CN");
                    schedule.Appointments = getChineseAppointments();
                }
            };
            scheduleTypePicker.ShowSelectionIndicator = true;
            scheduleTypePicker.Hidden          = true;
            scheduleTypePicker.Model           = model;
            scheduleTypePicker.BackgroundColor = UIColor.White;
            //control = this;
            this.OptionView = new UIView();
        }
Ejemplo n.º 33
0
        internal void CreateOptionWindow()
        {
            if (timezoneButton == null)
            {
                timezoneButton = new UIButton();
                timezoneButton.Layer.BorderWidth  = 2;
                timezoneButton.Layer.CornerRadius = 4;
                timezoneButton.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;
                timezoneButton.SetTitle("Default", UIControlState.Normal);
                timezoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            }

            if (timezoneLabel == null)
            {
                timezoneLabel           = new UILabel();
                timezoneLabel.Text      = "Time Zone";
                timezoneLabel.TextColor = UIColor.Black;
            }

            if (timeZonePicker == null)
            {
                timeZonePicker        = new UIPickerView();
                timeZonePicker.Hidden = true;
            }
            if (doneButton == null)
            {
                doneButton        = new UIButton();
                doneButton.Hidden = true;
                doneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
                doneButton.SetTitle("Done\t", UIControlState.Normal);
                doneButton.BackgroundColor     = UIColor.LightGray;
                doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            }

            timezoneButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                timeZonePicker.Hidden = false;
                doneButton.Hidden     = false;
            };
            doneButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                timeZonePicker.Hidden = true;
                doneButton.Hidden     = true;
            };

            SchedulePickerModel model = new SchedulePickerModel(TimeZoneCollection.TimeZoneList);

            model.PickerChanged += (sender, e) =>
            {
                if (e.SelectedValue != "Default")
                {
                    schedule.TimeZone = e.SelectedValue;
                }
                timezoneButton.SetTitle(e.SelectedValue, UIControlState.Normal);
            };

            timeZonePicker.Model = model;
            timeZonePicker.ShowSelectionIndicator = true;

            if (Utility.IsIPad)
            {
                timezoneLabel.Frame  = new CGRect(0, 0, 320, 30);
                timezoneButton.Frame = new CGRect(0, timezoneLabel.Frame.Bottom, 320, 30);
                doneButton.Frame     = new CGRect(0, timezoneButton.Frame.Bottom, 320, 30);
                timeZonePicker.Frame = new CGRect(0, doneButton.Frame.Bottom, 320, 200);
            }
        }
        public GMAlbumsViewCell(UITableViewCellStyle style, string reuseIdentifier)
            : base(style, reuseIdentifier)
        {
            Opaque                          = false;
            BackgroundColor                 = UIColor.Clear;
            TextLabel.BackgroundColor       = BackgroundColor;
            DetailTextLabel.BackgroundColor = BackgroundColor;
            Accessory                       = UITableViewCellAccessory.DisclosureIndicator;

            // Border width of 1 pixel:
            nfloat borderWidth = 1.0f / UIScreen.MainScreen.Scale;

            // ImageView
            ImageView3 = new UIImageView {
                ContentMode   = UIViewContentMode.ScaleAspectFill,
                Frame         = new CGRect(GMAlbumsViewController.AlbumLeftToImageSpace + 4, 8, GMAlbumsViewController.AlbumThumbnailSize3.Width, GMAlbumsViewController.AlbumThumbnailSize3.Height),
                ClipsToBounds = true,
                TranslatesAutoresizingMaskIntoConstraints = true,
                AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin,
            };
            ImageView3.Layer.BorderColor = UIColor.White.CGColor;
            ImageView3.Layer.BorderWidth = borderWidth;
            ContentView.AddSubview(ImageView3);

            // ImageView
            ImageView2 = new UIImageView {
                ContentMode   = UIViewContentMode.ScaleAspectFill,
                Frame         = new CGRect(GMAlbumsViewController.AlbumLeftToImageSpace + 2, 8 + 2, GMAlbumsViewController.AlbumThumbnailSize2.Width, GMAlbumsViewController.AlbumThumbnailSize2.Height),
                ClipsToBounds = true,
                TranslatesAutoresizingMaskIntoConstraints = true,
                AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin,
            };
            ImageView2.Layer.BorderColor = UIColor.White.CGColor;
            ImageView2.Layer.BorderWidth = borderWidth;
            ContentView.AddSubview(ImageView2);

            // ImageView
            ImageView1 = new UIImageView {
                ContentMode   = UIViewContentMode.ScaleAspectFill,
                Frame         = new CGRect(GMAlbumsViewController.AlbumLeftToImageSpace, 8 + 4, GMAlbumsViewController.AlbumThumbnailSize1.Width, GMAlbumsViewController.AlbumThumbnailSize1.Height),
                ClipsToBounds = true,
                TranslatesAutoresizingMaskIntoConstraints = true,
                AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin,
            };
            ImageView1.Layer.BorderColor = UIColor.White.CGColor;
            ImageView1.Layer.BorderWidth = borderWidth;
            ContentView.AddSubview(ImageView1);

            // The video gradient, label & icon
            var gradientFrame = new CGRect(0.0f, GMAlbumsViewController.AlbumThumbnailSize1.Height - GMAlbumsViewController.AlbumGradientHeight, GMAlbumsViewController.AlbumThumbnailSize1.Width, GMAlbumsViewController.AlbumGradientHeight);

            _gradientView = new UIView(gradientFrame)
            {
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin,
                TranslatesAutoresizingMaskIntoConstraints = true,
                Hidden = true
            };
            var topGradient = UIColor.FromRGBA(0f, 0f, 0f, 0f);
            var midGradient = UIColor.FromRGBA(0f, 0f, 0f, 0.33f);
            var botGradient = UIColor.FromRGBA(0f, 0f, 0f, 0.75f);

            _gradient = new CAGradientLayer()
            {
                Frame     = _gradientView.Bounds,
                Colors    = new[] { topGradient.CGColor, midGradient.CGColor, botGradient.CGColor },
                Locations = new NSNumber[] { 0.0f, 0.5f, 1.0f },
            };
            _gradientView.Layer.InsertSublayer(_gradient, 0);
            ImageView1.AddSubview(_gradientView);

            // VideoIcon
            _videoIcon = new UIImageView {
                ContentMode   = UIViewContentMode.ScaleAspectFill,
                Frame         = new CGRect(3, GMAlbumsViewController.AlbumThumbnailSize1.Height - 4 - 8, 15, 8),
                Image         = UIImage.FromFile("GMVideoIcon"),
                ClipsToBounds = true,
                TranslatesAutoresizingMaskIntoConstraints = true,
                AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin,
                Hidden           = false
            };
            ImageView1.AddSubview(_videoIcon);

            // TextLabels
            TextLabel.Font  = UIFont.SystemFontOfSize(17.0f);
            TextLabel.Lines = 1;
            TextLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            TextLabel.AdjustsFontSizeToFitWidth = true;

            DetailTextLabel.Font  = UIFont.SystemFontOfSize(17.0f);
            DetailTextLabel.Lines = 1;
            DetailTextLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            DetailTextLabel.AdjustsFontSizeToFitWidth = true;

            // Set next text labels constraints :
            ContentView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("H:[imageView1]-(offset)-[textLabel]-|",
                                                    NSLayoutFormatOptions.DirectionLeadingToTrailing,
                                                    new NSDictionary("offset", GMAlbumsViewController.AlbumImageToTextSpace),
                                                    new NSDictionary("textLabel", TextLabel, "imageView1", ImageView1))
                );

            ContentView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("H:[imageView1]-(offset)-[detailTextLabel]-|",
                                                    NSLayoutFormatOptions.DirectionLeadingToTrailing,
                                                    new NSDictionary("offset", GMAlbumsViewController.AlbumImageToTextSpace),
                                                    new NSDictionary("detailTextLabel", DetailTextLabel, "imageView1", ImageView1))
                );

            ContentView.AddConstraints(new [] {
                NSLayoutConstraint.Create(TextLabel, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, TextLabel.Superview, NSLayoutAttribute.CenterY, 1f, 0f)
            });

            ContentView.AddConstraints(new [] {
                NSLayoutConstraint.Create(DetailTextLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, TextLabel.Superview, NSLayoutAttribute.CenterY, 1f, 4f)
            });
        }
Ejemplo n.º 35
0
        public bool HandleShortcutItem(UIApplicationShortcutItem shortcutItem)
        {
            Console.WriteLine("HandleShortcutItem ");
            var handled = false;

            // Anything to process?
            if (shortcutItem == null)
            {
                return(false);
            }


            // Take action based on the shortcut type
            switch (shortcutItem.Type)
            {
            case ShortcutIdentifier.Tweet:
                Console.WriteLine("QUICKACTION: Tweet");
                var slComposer = SLComposeViewController.FromService(SLServiceType.Twitter);
                if (slComposer == null)
                {
                    new UIAlertView("Unavailable", "Twitter is not available, please sign in on your devices settings screen.", null, "OK").Show();
                }
                else
                {
                    slComposer.SetInitialText("#Conference");
                    if (slComposer.EditButtonItem != null)
                    {
                        slComposer.EditButtonItem.TintColor = UIColor.FromRGB(118, 53, 235);
                    }
                    slComposer.CompletionHandler += (result) =>
                    {
                        InvokeOnMainThread(() => UIApplication.SharedApplication.KeyWindow.RootViewController.DismissViewController(true, null));
                    };

                    UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewControllerAsync(slComposer, true);
                }
                handled = true;
                break;

            case ShortcutIdentifier.Announcements:
                Console.WriteLine("QUICKACTION: Accouncements");
                ContinueNavigation(AppPage.Notification);
                handled = true;
                break;

            case ShortcutIdentifier.MiniHacks:
                Console.WriteLine("QUICKACTION: MiniHacks");
                ContinueNavigation(AppPage.MiniHacks);
                handled = true;
                break;

            case ShortcutIdentifier.Events:
                Console.WriteLine("QUICKACTION: Events");
                ContinueNavigation(AppPage.Events);
                handled = true;
                break;
            }

            Console.Write(handled);
            // Return results
            return(handled);
        }
Ejemplo n.º 36
0
 public static UIColor ToUIColor(this SKColor color)
 {
     return(UIColor.FromRGBA(color.Red, color.Green, color.Blue, color.Alpha));
 }
Ejemplo n.º 37
0
 public static SKColor UIColorToSKColor(UIColor color)
 {
     color.GetRGBA(out nfloat r, out nfloat g, out nfloat b, out nfloat a);
     return(new SKColor((byte)r, (byte)g, (byte)b, (byte)a));
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            btnFbLogin.Frame = new CoreGraphics.CGRect(1, 59, 132, 44);
            SidebarController.CloseMenu(true);
            txtPassword.Text   = "123456";
            txtEmail.Text      = "*****@*****.**";
            txtEmail.Font      = UIFont.FromName("OpenSans", 14);
            txtPassword.Font   = UIFont.FromName("OpenSans", 14);
            lblSignInWith.Font = UIFont.FromName("OpenSans-Bold", 14);

            var redColoe = new UIColor((nfloat)(148 / 255.0), (nfloat)(26 / 255.0), (nfloat)(33 / 255.0), (nfloat)(1));

            btnLogin.Layer.BorderColor       = redColoe.CGColor;
            btnLogin.Layer.BorderWidth       = 1;
            btnLogin.AccessibilityIdentifier = "btnLogin";
            btnLogin.Font = UIFont.FromName("OpenSans", 14);

            btnLogin.SetTitle("SIGN IN", UIControlState.Normal);
            var text = "Virtual Event";

            var attributedString = new NSMutableAttributedString(text);

            var nsKern  = new NSString("NSKern");
            var spacing = NSObject.FromObject(3.2);
            var range   = new NSRange(0, text.Length - 1);

            attributedString.AddAttribute(nsKern, spacing, range);
            lblLogo.AttributedText = attributedString;
            lblLogo.Font           = UIFont.FromName("SFUIDisplay-Regular", 24);

            btnLogin.TouchUpInside += async delegate
            {
                if (txtEmail.Text.Trim() == "" && txtPassword.Text.Trim() == "")
                {
                    CommonUtils.AlertView("Please fill email and password.");
                }
                else if (txtEmail.Text.Trim() == "")
                {
                    CommonUtils.AlertView("Please fill email.");
                }
                else if (txtPassword.Text.Trim() == "")
                {
                    CommonUtils.AlertView("Please fill password.");
                }
                else if (txtPassword.Text.Trim() != "")
                {
                    bool valid = Regex.IsMatch(txtEmail.Text, @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9_\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", RegexOptions.ECMAScript);
                    if (!valid)
                    {
                        CommonUtils.AlertView("Please enter valid email.");
                    }
                    else
                    {
                        await UserLogin();
                    }
                }
            };

            btnFbLogin.TouchUpInside += delegate
            {
                // https://developers.facebook.com/apps/
                var auth = new OAuth2Authenticator(
                    clientId: "822879767861537",
                    scope: "",
                    authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),
                    redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html"));

                var ui = auth.GetUI();

                auth.Completed += FacebookAuth_Completed;

                PresentViewController((UIKit.UIViewController)ui, true, null);
            };



            #region Gogle Login
            // TODO(developer) Configure the sign-in button look/feel
            SignIn.SharedInstance.UIDelegate = this;

            SignIn.SharedInstance.SignedIn += (sender, e) =>
            {
                // Perform any operations on signed in user here.
                if (e.User != null && e.Error == null)
                {
                    //statusText.Text = string.Format("Signed in user: {0}", e.User.Profile.Name);
                    ToggleAuthUI();
                }
            };

            SignIn.SharedInstance.Disconnected += (sender, e) =>
            {
                // Perform any operations when the user disconnects from app here.
                //statusText.Text = "Disconnected user";
                ToggleAuthUI();
            };

            // Automatically sign in the user.
            SignIn.SharedInstance.SignInUserSilently();
            ToggleAuthUI();

            //statusText.Text = "Google Sign in\niOS Demo";
            #endregion
        }
Ejemplo n.º 39
0
        public Swiping()
        {
            save = new UIButton();
            save.SetTitle("Save", UIControlState.Normal);
            save.BackgroundColor = UIColor.DarkGray;
            save.Font            = UIFont.FromName("Helvetica-Bold", 12f);
            save.TouchDown      += Save_TouchDown;
            cancel = new UIButton();
            cancel.SetTitle("Cancel", UIControlState.Normal);
            cancel.TouchDown      += Cancel_TouchDown;
            cancel.BackgroundColor = UIColor.DarkGray;
            cancel.Font            = UIFont.FromName("Helvetica-Bold", 12f);
            col1        = new UILabel();
            col1.Text   = "Order ID";
            col2        = new UILabel();
            col2.Text   = "Customer ID";
            col3        = new UILabel();
            col3.Text   = "Employee ID";
            col4        = new UILabel();
            col4.Text   = "Name";
            orderIDText = new UITextField();
            orderIDText.AllowsEditingTextAttributes = true;
            orderIDText.ShouldReturn += (textField) =>
            {
                orderIDText.ResignFirstResponder();
                return(true);
            };
            customerIDText = new UITextField();
            customerIDText.ShouldReturn += (textField) =>
            {
                customerIDText.ResignFirstResponder();
                return(true);
            };
            employeeIDText = new UITextField();
            employeeIDText.ShouldReturn += (textField) =>
            {
                employeeIDText.ResignFirstResponder();
                return(true);
            };
            nameText = new UITextField();
            nameText.ShouldReturn += (textField) =>
            {
                nameText.ResignFirstResponder();
                return(true);
            };
            orderIDText.Hidden    = true;
            customerIDText.Hidden = true;
            employeeIDText.Hidden = true;
            nameText.Hidden       = true;
            col1.Hidden           = true;
            col2.Hidden           = true;
            col3.Hidden           = true;
            col4.Hidden           = true;
            save.Hidden           = true;
            cancel.Hidden         = true;

            this.detailView                 = new DetailView();
            this.detailView.Hidden          = true;
            this.SfGrid                     = new SfDataGrid();
            this.viewModel                  = new SwipingViewModel();
            this.SfGrid.ItemsSource         = viewModel.OrdersInfo;
            this.SfGrid.AutoGenerateColumns = false;
            this.SfGrid.ShowRowHeader       = false;
            this.SfGrid.HeaderRowHeight     = 45;
            this.SfGrid.RowHeight           = 45;
            this.SfGrid.ColumnSizer         = ColumnSizer.Star;

            UIButton leftSwipeViewText = new UIButton();

            leftSwipeViewText.SetTitle("Edit", UIControlState.Normal);
            leftSwipeViewText.SetTitleColor(UIColor.White, UIControlState.Normal);
            leftSwipeViewText.VerticalAlignment = UIControlContentVerticalAlignment.Center;
            leftSwipeViewText.BackgroundColor   = UIColor.FromRGB(0, 158, 218);
            leftSwipeViewText.TouchUpInside    += LeftSwipeViewButton_TouchUpInside;
            leftSwipeViewText.Frame             = new CGRect(56, 0, 60, 45);

            UIButton leftSwipeViewButton = new UIButton();

            leftSwipeViewButton.SetImage(UIImage.FromFile("Images/Edit.png"), UIControlState.Normal);
            leftSwipeViewButton.BackgroundColor = UIColor.FromRGB(0, 158, 218);
            leftSwipeViewButton.TouchUpInside  += LeftSwipeViewButton_TouchUpInside;
            leftSwipeViewButton.Frame           = new CGRect(16, 10, 24, 24);

            CustomSwipeView leftSwipeView = new CustomSwipeView();

            leftSwipeView.AddSubview(leftSwipeViewButton);
            leftSwipeView.AddSubview(leftSwipeViewText);
            leftSwipeView.Frame           = new CGRect(0, 0, 120, 44);
            leftSwipeView.BackgroundColor = UIColor.FromRGB(0, 158, 218);

            UIButton rightSwipeViewText = new UIButton();

            rightSwipeViewText.SetTitle("Delete", UIControlState.Normal);
            rightSwipeViewText.SetTitleColor(UIColor.White, UIControlState.Normal);
            rightSwipeViewText.VerticalAlignment = UIControlContentVerticalAlignment.Center;
            rightSwipeViewText.BackgroundColor   = UIColor.FromRGB(220, 89, 95);
            rightSwipeViewText.TouchUpInside    += RightSwipeViewButton_TouchUpInside;
            rightSwipeViewText.Frame             = new CGRect(56, 0, 60, 45);


            UIButton rightSwipeViewButton = new UIButton();

            rightSwipeViewButton.SetImage(UIImage.FromFile("Images/Delete.png"), UIControlState.Normal);
            rightSwipeViewButton.BackgroundColor     = UIColor.FromRGB(220, 89, 95);
            rightSwipeViewButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            rightSwipeViewButton.TouchUpInside      += RightSwipeViewButton_TouchUpInside;
            rightSwipeViewButton.Frame = new CGRect(16, 10, 24, 24);

            CustomSwipeView rightSwipeView = new CustomSwipeView();

            rightSwipeView.AddSubview(rightSwipeViewButton);
            rightSwipeView.AddSubview(rightSwipeViewText);
            rightSwipeView.Frame           = new CGRect(0, 0, 120, 44);
            rightSwipeView.BackgroundColor = UIColor.FromRGB(220, 89, 95);

            this.SfGrid.AllowSwiping     = true;
            this.SfGrid.LeftSwipeView    = leftSwipeView;
            this.SfGrid.RightSwipeView   = rightSwipeView;
            this.SfGrid.SwipeEnded      += SfGrid_SwipeEnded;
            this.SfGrid.SwipeStarted    += SfGrid_SwipeStarted;
            this.SfGrid.GridTapped      += SfGrid_GridTapped;
            this.SfGrid.GridLongPressed += SfGrid_GridLongPressed;

            GridTextColumn CustomerID = new GridTextColumn();

            CustomerID.MappingName = "CustomerID";
            CustomerID.HeaderText  = "Customer ID";
            GridTextColumn OrderID = new GridTextColumn();

            OrderID.MappingName = "OrderID";
            OrderID.HeaderText  = "Order ID";
            GridTextColumn EmployeeID = new GridTextColumn();

            EmployeeID.MappingName = "EmployeeID";
            EmployeeID.HeaderText  = "Employee ID";
            GridTextColumn Name = new GridTextColumn();

            Name.MappingName = "FirstName";
            Name.HeaderText  = "Name";

            this.SfGrid.Columns.Add(OrderID);
            this.SfGrid.Columns.Add(CustomerID);
            this.SfGrid.Columns.Add(EmployeeID);
            this.SfGrid.Columns.Add(Name);

            this.AddSubview(SfGrid);
            this.AddSubview(detailView);
            this.AddSubview(col1);
            this.AddSubview(col2);
            this.AddSubview(col3);
            this.AddSubview(col4);
            this.AddSubview(orderIDText);
            this.AddSubview(customerIDText);
            this.AddSubview(employeeIDText);
            this.AddSubview(nameText);
            this.AddSubview(save);
            this.AddSubview(cancel);
        }
Ejemplo n.º 40
0
        void DrawBeerLoader(CGRect frame, float percentage)
        {
            var fillColor4 = UIColor.FromRGBA(0.963f, 0.836f, 0.300f, 1.000f);
            var fillColor9 = UIColor.FromRGBA(0.833f, 0.723f, 0.260f, 1.000f);

            var expression  = 450.0f - 360.0f / 100.0f * percentage;
            var expression2 = 180.0f - 360.0f / 100.0f * percentage;


            CGRect background = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.00017f + 0.41f) + 0.09f, frame.GetMinY() + NMath.Floor(frame.Height * 0.00016f + 0.23f) + 0.27f, NMath.Floor(frame.Width * 0.99950f - 0.24f) - NMath.Floor(frame.Width * 0.00017f + 0.41f) + 0.65f, NMath.Floor(frame.Height * 0.98998f - 0.42f) - NMath.Floor(frame.Height * 0.00016f + 0.23f) + 0.65f);
            CGRect beer       = new CGRect(frame.GetMinX() + NMath.Floor(frame.Width * 0.33565f - 0.05f) + 0.55f, frame.GetMinY() + NMath.Floor(frame.Height * 0.22329f + 0.0f) + 0.5f, NMath.Floor(frame.Width * 0.71844f - 0.4f) - NMath.Floor(frame.Width * 0.33565f - 0.05f) + 0.35f, NMath.Floor(frame.Height * 0.72339f - 0.05f) - NMath.Floor(frame.Height * 0.22329f + 0.0f) + 0.05f);

            {
                UIBezierPath bezierPath = new UIBezierPath();
                bezierPath.MoveTo(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.58913f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.96205f * background.Width, background.GetMinY() + 0.69140f * background.Height), new CGPoint(background.GetMinX() + 0.94178f * background.Width, background.GetMinY() + 0.62023f * background.Height), new CGPoint(background.GetMinX() + 0.97392f * background.Width, background.GetMinY() + 0.66278f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.87973f * background.Width, background.GetMinY() + 0.75370f * background.Height), new CGPoint(background.GetMinX() + 0.94998f * background.Width, background.GetMinY() + 0.72052f * background.Height), new CGPoint(background.GetMinX() + 0.89706f * background.Width, background.GetMinY() + 0.72781f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.85355f * background.Width, background.GetMinY() + 0.85355f * background.Height), new CGPoint(background.GetMinX() + 0.86227f * background.Width, background.GetMinY() + 0.77977f * background.Height), new CGPoint(background.GetMinX() + 0.87567f * background.Width, background.GetMinY() + 0.83144f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.75369f * background.Width, background.GetMinY() + 0.87973f * background.Height), new CGPoint(background.GetMinX() + 0.83144f * background.Width, background.GetMinY() + 0.87567f * background.Height), new CGPoint(background.GetMinX() + 0.77977f * background.Width, background.GetMinY() + 0.86227f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.69139f * background.Width, background.GetMinY() + 0.96205f * background.Height), new CGPoint(background.GetMinX() + 0.72781f * background.Width, background.GetMinY() + 0.89706f * background.Height), new CGPoint(background.GetMinX() + 0.72051f * background.Width, background.GetMinY() + 0.94998f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.63742f * background.Width, background.GetMinY() + 0.95593f * background.Height), new CGPoint(background.GetMinX() + 0.67609f * background.Width, background.GetMinY() + 0.96840f * background.Height), new CGPoint(background.GetMinX() + 0.65681f * background.Width, background.GetMinY() + 0.96216f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.58913f * background.Width, background.GetMinY() + 0.94793f * background.Height), new CGPoint(background.GetMinX() + 0.62055f * background.Width, background.GetMinY() + 0.95050f * background.Height), new CGPoint(background.GetMinX() + 0.60360f * background.Width, background.GetMinY() + 0.94507f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.50000f * background.Width, background.GetMinY() + 1.00000f * background.Height), new CGPoint(background.GetMinX() + 0.55894f * background.Width, background.GetMinY() + 0.95391f * background.Height), new CGPoint(background.GetMinX() + 0.53194f * background.Width, background.GetMinY() + 1.00000f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.41087f * background.Width, background.GetMinY() + 0.94793f * background.Height), new CGPoint(background.GetMinX() + 0.46806f * background.Width, background.GetMinY() + 1.00000f * background.Height), new CGPoint(background.GetMinX() + 0.44106f * background.Width, background.GetMinY() + 0.95391f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.36258f * background.Width, background.GetMinY() + 0.95593f * background.Height), new CGPoint(background.GetMinX() + 0.39640f * background.Width, background.GetMinY() + 0.94507f * background.Height), new CGPoint(background.GetMinX() + 0.37945f * background.Width, background.GetMinY() + 0.95050f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.30861f * background.Width, background.GetMinY() + 0.96205f * background.Height), new CGPoint(background.GetMinX() + 0.34319f * background.Width, background.GetMinY() + 0.96216f * background.Height), new CGPoint(background.GetMinX() + 0.32391f * background.Width, background.GetMinY() + 0.96840f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.24631f * background.Width, background.GetMinY() + 0.87973f * background.Height), new CGPoint(background.GetMinX() + 0.27949f * background.Width, background.GetMinY() + 0.94998f * background.Height), new CGPoint(background.GetMinX() + 0.27219f * background.Width, background.GetMinY() + 0.89705f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.14645f * background.Width, background.GetMinY() + 0.85355f * background.Height), new CGPoint(background.GetMinX() + 0.22023f * background.Width, background.GetMinY() + 0.86227f * background.Height), new CGPoint(background.GetMinX() + 0.16856f * background.Width, background.GetMinY() + 0.87567f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.12027f * background.Width, background.GetMinY() + 0.75369f * background.Height), new CGPoint(background.GetMinX() + 0.12433f * background.Width, background.GetMinY() + 0.83144f * background.Height), new CGPoint(background.GetMinX() + 0.13773f * background.Width, background.GetMinY() + 0.77977f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.03795f * background.Width, background.GetMinY() + 0.69139f * background.Height), new CGPoint(background.GetMinX() + 0.10294f * background.Width, background.GetMinY() + 0.72781f * background.Height), new CGPoint(background.GetMinX() + 0.05002f * background.Width, background.GetMinY() + 0.72051f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.05207f * background.Width, background.GetMinY() + 0.58913f * background.Height), new CGPoint(background.GetMinX() + 0.02608f * background.Width, background.GetMinY() + 0.66277f * background.Height), new CGPoint(background.GetMinX() + 0.05822f * background.Width, background.GetMinY() + 0.62023f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.50000f * background.Height), new CGPoint(background.GetMinX() + 0.04609f * background.Width, background.GetMinY() + 0.55894f * background.Height), new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.53194f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.05207f * background.Width, background.GetMinY() + 0.41087f * background.Height), new CGPoint(background.GetMinX() + 0.00000f * background.Width, background.GetMinY() + 0.46806f * background.Height), new CGPoint(background.GetMinX() + 0.04609f * background.Width, background.GetMinY() + 0.44106f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.03795f * background.Width, background.GetMinY() + 0.30861f * background.Height), new CGPoint(background.GetMinX() + 0.05822f * background.Width, background.GetMinY() + 0.37976f * background.Height), new CGPoint(background.GetMinX() + 0.02608f * background.Width, background.GetMinY() + 0.33723f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.12027f * background.Width, background.GetMinY() + 0.24631f * background.Height), new CGPoint(background.GetMinX() + 0.05002f * background.Width, background.GetMinY() + 0.27949f * background.Height), new CGPoint(background.GetMinX() + 0.10294f * background.Width, background.GetMinY() + 0.27219f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.14645f * background.Width, background.GetMinY() + 0.14644f * background.Height), new CGPoint(background.GetMinX() + 0.13773f * background.Width, background.GetMinY() + 0.22023f * background.Height), new CGPoint(background.GetMinX() + 0.12433f * background.Width, background.GetMinY() + 0.16856f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.24631f * background.Width, background.GetMinY() + 0.12027f * background.Height), new CGPoint(background.GetMinX() + 0.16856f * background.Width, background.GetMinY() + 0.12433f * background.Height), new CGPoint(background.GetMinX() + 0.22023f * background.Width, background.GetMinY() + 0.13773f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.30861f * background.Width, background.GetMinY() + 0.03795f * background.Height), new CGPoint(background.GetMinX() + 0.27219f * background.Width, background.GetMinY() + 0.10294f * background.Height), new CGPoint(background.GetMinX() + 0.27949f * background.Width, background.GetMinY() + 0.05002f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.36258f * background.Width, background.GetMinY() + 0.04407f * background.Height), new CGPoint(background.GetMinX() + 0.32391f * background.Width, background.GetMinY() + 0.03160f * background.Height), new CGPoint(background.GetMinX() + 0.34319f * background.Width, background.GetMinY() + 0.03784f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.41087f * background.Width, background.GetMinY() + 0.05206f * background.Height), new CGPoint(background.GetMinX() + 0.37945f * background.Width, background.GetMinY() + 0.04950f * background.Height), new CGPoint(background.GetMinX() + 0.39640f * background.Width, background.GetMinY() + 0.05493f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.50000f * background.Width, background.GetMinY() + 0.00000f * background.Height), new CGPoint(background.GetMinX() + 0.44106f * background.Width, background.GetMinY() + 0.04609f * background.Height), new CGPoint(background.GetMinX() + 0.46806f * background.Width, background.GetMinY() + 0.00000f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.58913f * background.Width, background.GetMinY() + 0.05206f * background.Height), new CGPoint(background.GetMinX() + 0.53194f * background.Width, background.GetMinY() + 0.00000f * background.Height), new CGPoint(background.GetMinX() + 0.55894f * background.Width, background.GetMinY() + 0.04609f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.63742f * background.Width, background.GetMinY() + 0.04407f * background.Height), new CGPoint(background.GetMinX() + 0.60360f * background.Width, background.GetMinY() + 0.05493f * background.Height), new CGPoint(background.GetMinX() + 0.62055f * background.Width, background.GetMinY() + 0.04950f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.69140f * background.Width, background.GetMinY() + 0.03795f * background.Height), new CGPoint(background.GetMinX() + 0.65681f * background.Width, background.GetMinY() + 0.03784f * background.Height), new CGPoint(background.GetMinX() + 0.67609f * background.Width, background.GetMinY() + 0.03160f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.75369f * background.Width, background.GetMinY() + 0.12027f * background.Height), new CGPoint(background.GetMinX() + 0.72051f * background.Width, background.GetMinY() + 0.05002f * background.Height), new CGPoint(background.GetMinX() + 0.72781f * background.Width, background.GetMinY() + 0.10294f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.85356f * background.Width, background.GetMinY() + 0.14645f * background.Height), new CGPoint(background.GetMinX() + 0.77977f * background.Width, background.GetMinY() + 0.13773f * background.Height), new CGPoint(background.GetMinX() + 0.83144f * background.Width, background.GetMinY() + 0.12433f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.87973f * background.Width, background.GetMinY() + 0.24631f * background.Height), new CGPoint(background.GetMinX() + 0.87567f * background.Width, background.GetMinY() + 0.16856f * background.Height), new CGPoint(background.GetMinX() + 0.86227f * background.Width, background.GetMinY() + 0.22023f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.96206f * background.Width, background.GetMinY() + 0.30861f * background.Height), new CGPoint(background.GetMinX() + 0.89706f * background.Width, background.GetMinY() + 0.27219f * background.Height), new CGPoint(background.GetMinX() + 0.94998f * background.Width, background.GetMinY() + 0.27949f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.41087f * background.Height), new CGPoint(background.GetMinX() + 0.97392f * background.Width, background.GetMinY() + 0.33723f * background.Height), new CGPoint(background.GetMinX() + 0.94178f * background.Width, background.GetMinY() + 0.37976f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.50000f * background.Height), new CGPoint(background.GetMinX() + 0.95391f * background.Width, background.GetMinY() + 0.44106f * background.Height), new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.46806f * background.Height));
                bezierPath.AddCurveToPoint(new CGPoint(background.GetMinX() + 0.94794f * background.Width, background.GetMinY() + 0.58913f * background.Height), new CGPoint(background.GetMinX() + 1.00000f * background.Width, background.GetMinY() + 0.53194f * background.Height), new CGPoint(background.GetMinX() + 0.95391f * background.Width, background.GetMinY() + 0.55894f * background.Height));
                bezierPath.ClosePath();
                bezierPath.UsesEvenOddFillRule = true;

                this.Green.SetFill();
                bezierPath.Fill();


                var whitePath = UIBezierPath.FromOval(new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.09115f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09203f + 0.47f) + 0.03f, NMath.Floor(background.Width * 0.91052f - 0.11f) - NMath.Floor(background.Width * 0.09115f - 0.41f) - 0.3f, NMath.Floor(background.Height * 0.90967f - 0.23f) - NMath.Floor(background.Height * 0.09203f + 0.47f) + 0.7f));
                this.SimpleWhite.SetFill();
                whitePath.Fill();

                var white2Rect = new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.08925f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09011f + 0.47f) + 0.03f, NMath.Floor(background.Width * 0.91052f - 0.11f) - NMath.Floor(background.Width * 0.08925f - 0.41f) - 0.3f, NMath.Floor(background.Height * 0.90967f - 0.23f) - NMath.Floor(background.Height * 0.09011f + 0.47f) + 0.7f);
                var white2Path = new UIBezierPath();
                white2Path.AddArc(new CGPoint(0.0f, 0.0f), white2Rect.Width / 2.0f, (nfloat)(-expression * NMath.PI / 180), (nfloat)(-expression2 * NMath.PI / 180.0f), true);
                white2Path.AddLineTo(new CGPoint(0.0f, 0.0f));
                white2Path.ClosePath();

                var white2Transform = CGAffineTransform.MakeScale(1.0f, white2Rect.Height / white2Rect.Width);
                white2Transform.Translate(white2Rect.GetMidX(), white2Rect.GetMidY());
                white2Path.ApplyTransform(white2Transform);

                this.Green.SetFill();
                white2Path.Fill();

                var greenFillerPath = UIBezierPath.FromOval(new CGRect(background.GetMinX() + NMath.Floor(background.Width * 0.09686f - 0.41f) + 0.91f, background.GetMinY() + NMath.Floor(background.Height * 0.09780f - 0.23f) + 0.73f, NMath.Floor(background.Width * 0.90348f - 0.41f) - NMath.Floor(background.Width * 0.09686f - 0.41f), NMath.Floor(background.Height * 0.90257f - 0.23f) - NMath.Floor(background.Height * 0.09780f - 0.23f)));
                this.Green.SetFill();
                greenFillerPath.Fill();
            }


            {
                var ovalPath = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.07499f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.06273f + 0.45f) + 0.05f, NMath.Floor(beer.Width * 0.26124f - 0.1f) - NMath.Floor(beer.Width * 0.07499f + 0.4f) + 0.5f, NMath.Floor(beer.Height * 0.20908f - 0.05f) - NMath.Floor(beer.Height * 0.06273f + 0.45f) + 0.5f));
                OffWhite.SetFill();
                ovalPath.Fill();

                var oval2Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.15263f + 0.1f) + 0.4f, NMath.Floor(beer.Width * 0.18624f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.29899f - 0.4f) - NMath.Floor(beer.Height * 0.15263f + 0.1f) + 0.5f));
                OffWhite.SetFill();
                oval2Path.Fill();

                var oval3Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.24881f + 0.5f) + 0.0f, NMath.Floor(beer.Width * 0.13211f - 0.1f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.6f, NMath.Floor(beer.Height * 0.35373f - 0.1f) - NMath.Floor(beer.Height * 0.24881f + 0.5f) + 0.6f));
                OffWhite.SetFill();
                oval3Path.Fill();

                var oval4Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.00000f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.32541f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.13211f - 0.1f) - NMath.Floor(beer.Width * 0.00000f + 0.5f) + 0.6f, NMath.Floor(beer.Height * 0.43033f + 0.05f) - NMath.Floor(beer.Height * 0.32541f - 0.35f) - 0.4f));
                OffWhite.SetFill();
                oval4Path.Fill();

                var oval5Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.03526f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.40068f + 0.45f) + 0.05f, NMath.Floor(beer.Width * 0.16737f - 0.2f) - NMath.Floor(beer.Width * 0.03526f + 0.4f) + 0.6f, NMath.Floor(beer.Height * 0.50560f - 0.15f) - NMath.Floor(beer.Height * 0.40068f + 0.45f) + 0.6f));
                OffWhite.SetFill();
                oval5Path.Fill();

                UIBezierPath bezier2Path = new UIBezierPath();
                bezier2Path.MoveTo(new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.31182f * beer.Height), new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height), new CGPoint(beer.GetMinX() + 0.72564f * beer.Width, beer.GetMinY() + 0.30342f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.91991f * beer.Width, beer.GetMinY() + 0.33162f * beer.Height), new CGPoint(beer.GetMinX() + 0.78618f * beer.Width, beer.GetMinY() + 0.32004f * beer.Height), new CGPoint(beer.GetMinX() + 0.85931f * beer.Width, beer.GetMinY() + 0.30847f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.99028f * beer.Width, beer.GetMinY() + 0.67241f * beer.Height), new CGPoint(beer.GetMinX() + 0.97956f * beer.Width, beer.GetMinY() + 0.35442f * beer.Height), new CGPoint(beer.GetMinX() + 1.01934f * beer.Width, beer.GetMinY() + 0.58000f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.74374f * beer.Width, beer.GetMinY() + 0.90110f * beer.Height), new CGPoint(beer.GetMinX() + 0.96121f * beer.Width, beer.GetMinY() + 0.76480f * beer.Height), new CGPoint(beer.GetMinX() + 0.71157f * beer.Width, beer.GetMinY() + 0.83870f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70703f * beer.Width, beer.GetMinY() + 0.67071f * beer.Height), new CGPoint(beer.GetMinX() + 0.71927f * beer.Width, beer.GetMinY() + 0.95149f * beer.Height), new CGPoint(beer.GetMinX() + 0.68742f * beer.Width, beer.GetMinY() + 0.70678f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.86866f * beer.Width, beer.GetMinY() + 0.70181f * beer.Height), new CGPoint(beer.GetMinX() + 0.72080f * beer.Width, beer.GetMinY() + 0.74270f * beer.Height), new CGPoint(beer.GetMinX() + 0.83654f * beer.Width, beer.GetMinY() + 0.72700f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.91685f * beer.Width, beer.GetMinY() + 0.55481f * beer.Height), new CGPoint(beer.GetMinX() + 0.90079f * beer.Width, beer.GetMinY() + 0.67660f * beer.Height), new CGPoint(beer.GetMinX() + 0.93284f * beer.Width, beer.GetMinY() + 0.65992f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.87095f * beer.Width, beer.GetMinY() + 0.38322f * beer.Height), new CGPoint(beer.GetMinX() + 0.90085f * beer.Width, beer.GetMinY() + 0.44970f * beer.Height), new CGPoint(beer.GetMinX() + 0.90002f * beer.Width, beer.GetMinY() + 0.39521f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.76540f * beer.Width, beer.GetMinY() + 0.38082f * beer.Height), new CGPoint(beer.GetMinX() + 0.84188f * beer.Width, beer.GetMinY() + 0.37122f * beer.Height), new CGPoint(beer.GetMinX() + 0.78988f * beer.Width, beer.GetMinY() + 0.37602f * beer.Height));
                bezier2Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70116f * beer.Width, beer.GetMinY() + 0.43331f * beer.Height), new CGPoint(beer.GetMinX() + 0.74093f * beer.Width, beer.GetMinY() + 0.38562f * beer.Height), new CGPoint(beer.GetMinX() + 0.70116f * beer.Width, beer.GetMinY() + 0.43331f * beer.Height));
                bezier2Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.71340f * beer.Width, beer.GetMinY() + 0.27402f * beer.Height));
                bezier2Path.ClosePath();
                bezier2Path.UsesEvenOddFillRule = true;

                SimpleWhite.SetFill();
                bezier2Path.Fill();

                UIBezierPath bezier3Path = new UIBezierPath();
                bezier3Path.MoveTo(new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height));
                bezier3Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.05563f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height));
                bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height), new CGPoint(beer.GetMinX() + 0.05563f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height), new CGPoint(beer.GetMinX() + 0.10382f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height));
                bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height), new CGPoint(beer.GetMinX() + 0.71569f * beer.Width, beer.GetMinY() + 0.98741f * beer.Height), new CGPoint(beer.GetMinX() + 0.75623f * beer.Width, beer.GetMinY() + 0.95199f * beer.Height));
                bezier3Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height));
                bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.41893f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height), new CGPoint(beer.GetMinX() + 0.68510f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height));
                bezier3Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height), new CGPoint(beer.GetMinX() + 0.15277f * beer.Width, beer.GetMinY() + 0.86680f * beer.Height), new CGPoint(beer.GetMinX() + 0.08316f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height));
                bezier3Path.ClosePath();
                bezier3Path.UsesEvenOddFillRule = true;

                SimpleWhite.SetFill();
                bezier3Path.Fill();

                UIBezierPath bezier4Path = new UIBezierPath();
                bezier4Path.MoveTo(new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height));
                bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.11024f * beer.Width, beer.GetMinY() + 0.26059f * beer.Height), new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height), new CGPoint(beer.GetMinX() + 0.11789f * beer.Width, beer.GetMinY() + 0.37817f * beer.Height));
                bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height), new CGPoint(beer.GetMinX() + 0.56915f * beer.Width, beer.GetMinY() + 0.27150f * beer.Height), new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height));
                bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.56362f * beer.Height), new CGPoint(beer.GetMinX() + 0.72869f * beer.Width, beer.GetMinY() + 0.28120f * beer.Height), new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.43635f * beer.Height));
                bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height), new CGPoint(beer.GetMinX() + 0.71951f * beer.Width, beer.GetMinY() + 0.69090f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height));
                bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40593f * beer.Width, beer.GetMinY() + 0.88119f * beer.Height), new CGPoint(beer.GetMinX() + 0.73787f * beer.Width, beer.GetMinY() + 0.83756f * beer.Height), new CGPoint(beer.GetMinX() + 0.63538f * beer.Width, beer.GetMinY() + 0.88726f * beer.Height));
                bezier4Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height), new CGPoint(beer.GetMinX() + 0.17648f * beer.Width, beer.GetMinY() + 0.87513f * beer.Height), new CGPoint(beer.GetMinX() + 0.08189f * beer.Width, beer.GetMinY() + 0.84290f * beer.Height));
                bezier4Path.ClosePath();
                bezier4Path.UsesEvenOddFillRule = true;

                fillColor4.SetFill();
                bezier4Path.Fill();

                UIBezierPath bezier5Path = new UIBezierPath();
                bezier5Path.MoveTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.29331f * beer.Height));
                bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.19362f * beer.Height));
                bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.11621f * beer.Width, beer.GetMinY() + 0.19110f * beer.Height));
                bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.11073f * beer.Width, beer.GetMinY() + 0.28260f * beer.Height));
                bezier5Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72835f * beer.Width, beer.GetMinY() + 0.29331f * beer.Height));
                bezier5Path.ClosePath();
                bezier5Path.UsesEvenOddFillRule = true;

                SimpleWhite.SetFill();
                bezier5Path.Fill();

                UIBezierPath bezier6Path = new UIBezierPath();
                bezier6Path.MoveTo(new CGPoint(beer.GetMinX() + 0.07471f * beer.Width, beer.GetMinY() + 0.94603f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height), new CGPoint(beer.GetMinX() + 0.09876f * beer.Width, beer.GetMinY() + 0.95447f * beer.Height), new CGPoint(beer.GetMinX() + 0.18051f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73863f * beer.Width, beer.GetMinY() + 0.94607f * beer.Height), new CGPoint(beer.GetMinX() + 0.64454f * beer.Width, beer.GetMinY() + 0.97479f * beer.Height), new CGPoint(beer.GetMinX() + 0.71869f * beer.Width, beer.GetMinY() + 0.95411f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.72181f * beer.Width, beer.GetMinY() + 0.83863f * beer.Height), new CGPoint(beer.GetMinX() + 0.73399f * beer.Width, beer.GetMinY() + 0.92454f * beer.Height), new CGPoint(beer.GetMinX() + 0.72199f * beer.Width, beer.GetMinY() + 0.86626f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.56681f * beer.Height), new CGPoint(beer.GetMinX() + 0.72051f * beer.Width, beer.GetMinY() + 0.82816f * beer.Height), new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.68784f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.70999f * beer.Width, beer.GetMinY() + 0.21141f * beer.Height), new CGPoint(beer.GetMinX() + 0.70346f * beer.Width, beer.GetMinY() + 0.45862f * beer.Height), new CGPoint(beer.GetMinX() + 0.70858f * beer.Width, beer.GetMinY() + 0.26290f * beer.Height));
                bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13157f * beer.Width, beer.GetMinY() + 0.20390f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.84329f * beer.Height), new CGPoint(beer.GetMinX() + 0.12671f * beer.Width, beer.GetMinY() + 0.29022f * beer.Height), new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.80316f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.07471f * beer.Width, beer.GetMinY() + 0.94603f * beer.Height), new CGPoint(beer.GetMinX() + 0.09795f * beer.Width, beer.GetMinY() + 0.87907f * beer.Height), new CGPoint(beer.GetMinX() + 0.08216f * beer.Width, beer.GetMinY() + 0.92590f * beer.Height));
                bezier6Path.ClosePath();
                bezier6Path.MoveTo(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.04465f * beer.Width, beer.GetMinY() + 0.96119f * beer.Height), new CGPoint(beer.GetMinX() + 0.10624f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height), new CGPoint(beer.GetMinX() + 0.05006f * beer.Width, beer.GetMinY() + 0.96517f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.04033f * beer.Width, beer.GetMinY() + 0.94815f * beer.Height), new CGPoint(beer.GetMinX() + 0.04013f * beer.Width, beer.GetMinY() + 0.95786f * beer.Height), new CGPoint(beer.GetMinX() + 0.03844f * beer.Width, beer.GetMinY() + 0.95279f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.84329f * beer.Height), new CGPoint(beer.GetMinX() + 0.04059f * beer.Width, beer.GetMinY() + 0.94752f * beer.Height), new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.88517f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.10017f * beer.Width, beer.GetMinY() + 0.19054f * beer.Height), new CGPoint(beer.GetMinX() + 0.06583f * beer.Width, beer.GetMinY() + 0.79913f * beer.Height), new CGPoint(beer.GetMinX() + 0.09876f * beer.Width, beer.GetMinY() + 0.21537f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.11648f * beer.Width, beer.GetMinY() + 0.17850f * beer.Height), new CGPoint(beer.GetMinX() + 0.10055f * beer.Width, beer.GetMinY() + 0.18373f * beer.Height), new CGPoint(beer.GetMinX() + 0.10770f * beer.Width, beer.GetMinY() + 0.17845f * beer.Height));
                bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.72667f * beer.Width, beer.GetMinY() + 0.18643f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73798f * beer.Width, beer.GetMinY() + 0.19029f * beer.Height), new CGPoint(beer.GetMinX() + 0.73094f * beer.Width, beer.GetMinY() + 0.18648f * beer.Height), new CGPoint(beer.GetMinX() + 0.73501f * beer.Width, beer.GetMinY() + 0.18787f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.74246f * beer.Width, beer.GetMinY() + 0.19931f * beer.Height), new CGPoint(beer.GetMinX() + 0.74094f * beer.Width, beer.GetMinY() + 0.19271f * beer.Height), new CGPoint(beer.GetMinX() + 0.74255f * beer.Width, beer.GetMinY() + 0.19595f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.56681f * beer.Height), new CGPoint(beer.GetMinX() + 0.74239f * beer.Width, beer.GetMinY() + 0.20172f * beer.Height), new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.44240f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75155f * beer.Width, beer.GetMinY() + 0.81696f * beer.Height), new CGPoint(beer.GetMinX() + 0.73559f * beer.Width, beer.GetMinY() + 0.66362f * beer.Height), new CGPoint(beer.GetMinX() + 0.74661f * beer.Width, beer.GetMinY() + 0.77302f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.82358f * beer.Height), new CGPoint(beer.GetMinX() + 0.75305f * beer.Width, beer.GetMinY() + 0.81888f * beer.Height), new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.82115f * beer.Height));
                bezier6Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.83800f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.77205f * beer.Width, beer.GetMinY() + 0.94980f * beer.Height), new CGPoint(beer.GetMinX() + 0.75393f * beer.Width, beer.GetMinY() + 0.86897f * beer.Height), new CGPoint(beer.GetMinX() + 0.77186f * beer.Width, beer.GetMinY() + 0.94900f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.76818f * beer.Width, beer.GetMinY() + 0.96041f * beer.Height), new CGPoint(beer.GetMinX() + 0.77291f * beer.Width, beer.GetMinY() + 0.95363f * beer.Height), new CGPoint(beer.GetMinX() + 0.77148f * beer.Width, beer.GetMinY() + 0.95754f * beer.Height));
                bezier6Path.AddCurveToPoint(new CGPoint(beer.GetMinX() + 0.40975f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height), new CGPoint(beer.GetMinX() + 0.76061f * beer.Width, beer.GetMinY() + 0.96702f * beer.Height), new CGPoint(beer.GetMinX() + 0.70776f * beer.Width, beer.GetMinY() + 1.00000f * beer.Height));
                bezier6Path.ClosePath();
                bezier6Path.UsesEvenOddFillRule = true;

                SimpleWhite.SetFill();
                bezier6Path.Fill();

                UIBezierPath bezier7Path = new UIBezierPath();
                bezier7Path.MoveTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height));
                bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13068f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height));
                bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.13068f * beer.Width, beer.GetMinY() + 0.16404f * beer.Height));
                bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.17446f * beer.Height));
                bezier7Path.AddLineTo(new CGPoint(beer.GetMinX() + 0.70988f * beer.Width, beer.GetMinY() + 0.21792f * beer.Height));
                bezier7Path.ClosePath();
                bezier7Path.UsesEvenOddFillRule = true;

                SimpleWhite.SetFill();
                bezier7Path.Fill();

                var oval6Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.42910f + 0.1f) + 0.4f, beer.GetMinY() + NMath.Floor(beer.Height * 0.65196f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.48175f + 0.5f) - NMath.Floor(beer.Width * 0.42910f + 0.1f) - 0.4f, NMath.Floor(beer.Height * 0.69226f - 0.05f) - NMath.Floor(beer.Height * 0.65196f - 0.45f) - 0.4f));
                fillColor9.SetFill();
                oval6Path.Fill();

                var oval7Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.34542f - 0.05f) + 0.55f, beer.GetMinY() + NMath.Floor(beer.Height * 0.55521f - 0.3f) + 0.8f, NMath.Floor(beer.Width * 0.42091f - 0.25f) - NMath.Floor(beer.Width * 0.34542f - 0.05f) + 0.2f, NMath.Floor(beer.Height * 0.61300f + 0.5f) - NMath.Floor(beer.Height * 0.55521f - 0.3f) - 0.8f));
                fillColor9.SetFill();
                oval7Path.Fill();

                var oval8Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.14651f) + 0.5f, beer.GetMinY() + NMath.Floor(beer.Height * 0.76810f - 0.4f) + 0.9f, NMath.Floor(beer.Width * 0.23144f - 0.1f) - NMath.Floor(beer.Width * 0.14651f) + 0.1f, NMath.Floor(beer.Height * 0.83311f + 0.5f) - NMath.Floor(beer.Height * 0.76810f - 0.4f) - 0.9f));
                fillColor9.SetFill();
                oval8Path.Fill();

                var oval9Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.15f, beer.GetMinY() + NMath.Floor(beer.Height * 0.74700f + 0.05f) + 0.45f, NMath.Floor(beer.Width * 0.66725f + 0.15f) - NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.2f, NMath.Floor(beer.Height * 0.78920f - 0.05f) - NMath.Floor(beer.Height * 0.74700f + 0.05f) + 0.1f));
                fillColor9.SetFill();
                oval9Path.Fill();

                var oval10Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.56891f - 0.05f) + 0.55f, beer.GetMinY() + NMath.Floor(beer.Height * 0.62250f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.63348f - 0.05f) - NMath.Floor(beer.Width * 0.56891f - 0.05f), NMath.Floor(beer.Height * 0.67192f + 0.2f) - NMath.Floor(beer.Height * 0.62250f + 0.2f)));
                fillColor9.SetFill();
                oval10Path.Fill();

                var oval11Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.34393f + 0.25f) + 0.25f, beer.GetMinY() + NMath.Floor(beer.Height * 0.75631f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.42240f + 0.45f) - NMath.Floor(beer.Width * 0.34393f + 0.25f) - 0.2f, NMath.Floor(beer.Height * 0.81638f + 0.4f) - NMath.Floor(beer.Height * 0.75631f + 0.2f) - 0.2f));
                fillColor9.SetFill();
                oval11Path.Fill();

                var oval12Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.15f, beer.GetMinY() + NMath.Floor(beer.Height * 0.43661f + 0.5f) + 0.0f, NMath.Floor(beer.Width * 0.64242f + 0.15f) - NMath.Floor(beer.Width * 0.61162f + 0.35f) + 0.2f, NMath.Floor(beer.Height * 0.46018f + 0.3f) - NMath.Floor(beer.Height * 0.43661f + 0.5f) + 0.2f));
                fillColor9.SetFill();
                oval12Path.Fill();

                var oval13Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.22821f - 0.45f) + 0.95f, beer.GetMinY() + NMath.Floor(beer.Height * 0.42482f + 0.4f) + 0.1f, NMath.Floor(beer.Width * 0.25900f + 0.35f) - NMath.Floor(beer.Width * 0.22821f - 0.45f) - 0.8f, NMath.Floor(beer.Height * 0.44839f + 0.2f) - NMath.Floor(beer.Height * 0.42482f + 0.4f) + 0.2f));
                fillColor9.SetFill();
                oval13Path.Fill();

                var oval14Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.43705f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.44820f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.46784f + 0.3f) - NMath.Floor(beer.Width * 0.43705f + 0.5f) + 0.2f, NMath.Floor(beer.Height * 0.47177f + 0.35f) - NMath.Floor(beer.Height * 0.44820f - 0.45f) - 0.8f));
                fillColor9.SetFill();
                oval14Path.Fill();

                var oval15Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.15818f - 0.35f) + 0.85f, beer.GetMinY() + NMath.Floor(beer.Height * 0.50940f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.18897f + 0.45f) - NMath.Floor(beer.Width * 0.15818f - 0.35f) - 0.8f, NMath.Floor(beer.Height * 0.53297f + 0.45f) - NMath.Floor(beer.Height * 0.50940f - 0.35f) - 0.8f));
                fillColor9.SetFill();
                oval15Path.Fill();

                var oval16Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.52794f + 0.2f) + 0.3f, beer.GetMinY() + NMath.Floor(beer.Height * 0.52803f - 0.45f) + 0.95f, NMath.Floor(beer.Width * 0.55873f) - NMath.Floor(beer.Width * 0.52794f + 0.2f) + 0.2f, NMath.Floor(beer.Height * 0.55160f + 0.35f) - NMath.Floor(beer.Height * 0.52803f - 0.45f) - 0.8f));
                fillColor9.SetFill();
                oval16Path.Fill();

                var oval17Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.25875f + 0.4f) + 0.1f, beer.GetMinY() + NMath.Floor(beer.Height * 0.69207f - 0.3f) + 0.8f, NMath.Floor(beer.Width * 0.28955f + 0.2f) - NMath.Floor(beer.Width * 0.25875f + 0.4f) + 0.2f, NMath.Floor(beer.Height * 0.71564f + 0.5f) - NMath.Floor(beer.Height * 0.69207f - 0.3f) - 0.8f));
                fillColor9.SetFill();
                oval17Path.Fill();

                var oval18Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.50013f - 0.2f) + 0.7f, beer.GetMinY() + NMath.Floor(beer.Height * 0.81638f - 0.1f) + 0.6f, NMath.Floor(beer.Width * 0.54333f + 0.1f) - NMath.Floor(beer.Width * 0.50013f - 0.2f) - 0.3f, NMath.Floor(beer.Height * 0.84945f + 0.2f) - NMath.Floor(beer.Height * 0.81638f - 0.1f) - 0.3f));
                fillColor9.SetFill();
                oval18Path.Fill();

                var oval19Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.20512f + 0.2f) + 0.3f, beer.GetMinY() + NMath.Floor(beer.Height * 0.55863f - 0.0f) + 0.5f, NMath.Floor(beer.Width * 0.25776f - 0.4f) - NMath.Floor(beer.Width * 0.20512f + 0.2f) + 0.6f, NMath.Floor(beer.Height * 0.59893f + 0.4f) - NMath.Floor(beer.Height * 0.55863f - 0.0f) - 0.4f));
                fillColor9.SetFill();
                oval19Path.Fill();

                var oval20Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.55004f - 0.25f) + 0.75f, beer.GetMinY() + NMath.Floor(beer.Height * 0.07318f + 0.2f) + 0.3f, NMath.Floor(beer.Width * 0.73628f + 0.25f) - NMath.Floor(beer.Width * 0.55004f - 0.25f) - 0.5f, NMath.Floor(beer.Height * 0.21954f - 0.3f) - NMath.Floor(beer.Height * 0.07318f + 0.2f) + 0.5f));
                OffWhite.SetFill();
                oval20Path.Fill();

                var oval21Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.52148f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.11272f - 0.4f) + 0.9f, NMath.Floor(beer.Width * 0.70772f) - NMath.Floor(beer.Width * 0.52148f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.25907f + 0.1f) - NMath.Floor(beer.Height * 0.11272f - 0.4f) - 0.5f));
                OffWhite.SetFill();
                oval21Path.Fill();

                var oval22Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.45568f - 0.25f) + 0.75f, beer.GetMinY() + NMath.Floor(beer.Height * 0.01673f + 0.35f) + 0.15f, NMath.Floor(beer.Width * 0.64192f + 0.25f) - NMath.Floor(beer.Width * 0.45568f - 0.25f) - 0.5f, NMath.Floor(beer.Height * 0.16309f - 0.15f) - NMath.Floor(beer.Height * 0.01673f + 0.35f) + 0.5f));
                OffWhite.SetFill();
                oval22Path.Fill();

                var oval23Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.30097f - 0.1f) + 0.6f, beer.GetMinY() + NMath.Floor(beer.Height * 0.00000f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.48721f + 0.4f) - NMath.Floor(beer.Width * 0.30097f - 0.1f) - 0.5f, NMath.Floor(beer.Height * 0.14636f + 0.45f) - NMath.Floor(beer.Height * 0.00000f - 0.05f) - 0.5f));
                OffWhite.SetFill();
                oval23Path.Fill();

                var oval24Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.15843f - 0.4f) + 0.9f, beer.GetMinY() + NMath.Floor(beer.Height * 0.01178f + 0.05f) + 0.45f, NMath.Floor(beer.Width * 0.34467f + 0.1f) - NMath.Floor(beer.Width * 0.15843f - 0.4f) - 0.5f, NMath.Floor(beer.Height * 0.15814f - 0.45f) - NMath.Floor(beer.Height * 0.01178f + 0.05f) + 0.5f));
                OffWhite.SetFill();
                oval24Path.Fill();

                var oval25Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.23169f - 0.15f) + 0.65f, beer.GetMinY() + NMath.Floor(beer.Height * 0.14199f + 0.3f) + 0.2f, NMath.Floor(beer.Width * 0.41793f + 0.35f) - NMath.Floor(beer.Width * 0.23169f - 0.15f) - 0.5f, NMath.Floor(beer.Height * 0.28835f - 0.2f) - NMath.Floor(beer.Height * 0.14199f + 0.3f) + 0.5f));
                OffWhite.SetFill();
                oval25Path.Fill();

                var oval26Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.25329f + 0.5f), beer.GetMinY() + NMath.Floor(beer.Height * 0.09504f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.43953f) - NMath.Floor(beer.Width * 0.25329f + 0.5f) + 0.5f, NMath.Floor(beer.Height * 0.24140f + 0.45f) - NMath.Floor(beer.Height * 0.09504f - 0.05f) - 0.5f));
                OffWhite.SetFill();
                oval26Path.Fill();

                var oval27Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.12218f - 0.1f) + 0.6f, beer.GetMinY() + NMath.Floor(beer.Height * 0.09504f - 0.05f) + 0.55f, NMath.Floor(beer.Width * 0.30842f + 0.4f) - NMath.Floor(beer.Width * 0.12218f - 0.1f) - 0.5f, NMath.Floor(beer.Height * 0.24140f + 0.45f) - NMath.Floor(beer.Height * 0.09504f - 0.05f) - 0.5f));
                OffWhite.SetFill();
                oval27Path.Fill();

                var oval28Path = UIBezierPath.FromOval(new CGRect(beer.GetMinX() + NMath.Floor(beer.Width * 0.36702f - 0.4f) + 0.9f, beer.GetMinY() + NMath.Floor(beer.Height * 0.10910f - 0.35f) + 0.85f, NMath.Floor(beer.Width * 0.55327f + 0.1f) - NMath.Floor(beer.Width * 0.36702f - 0.4f) - 0.5f, NMath.Floor(beer.Height * 0.25546f + 0.15f) - NMath.Floor(beer.Height * 0.10910f - 0.35f) - 0.5f));
                OffWhite.SetFill();
                oval28Path.Fill();
            }
        }
Ejemplo n.º 41
0
        protected override IBound ReApply(IDictionary <Type, IStyle> styles, IBound styleBound, IBound maxBound)
        {
            IStyleHelper helper = StyleSheetContext.Current.CreateHelper(styles, CurrentStyleSheet, this);

            if (styles.Count > 0)
            {
                // background color, borders
                helper.SetBackgroundSettings(this);

                // text color
                ITextColor textColor;
                if (helper.TryGet(out textColor))
                {
                    _textColor      = textColor.ToColorOrClear();
                    _view.TextColor = _textColor;
                }

                // placeholder color
                IPlaceholderColor placeholderColor;
                if (helper.TryGet(out placeholderColor))
                {
                    _placeholderColor = placeholderColor.ToColorOrClear();
                    if (!string.IsNullOrEmpty(_placeholder) && _placeholderVisible)
                    {
                        _view.TextColor = _placeholderColor;
                    }
                }

                // font
                UIFont f;
                if (helper.FontChanged(styleBound.Height, out f))
                {
                    _view.Font = f;
                }

                // padding
                float screenWidth  = ApplicationContext.Current.DisplayProvider.Width;
                float screenHeight = ApplicationContext.Current.DisplayProvider.Height;
                float pl           = helper.Get <IPaddingLeft>().CalcSize(styleBound.Width, screenWidth);
                float pt           = helper.Get <IPaddingTop>().CalcSize(styleBound.Height, screenHeight);
                float pr           = helper.Get <IPaddingRight>().CalcSize(styleBound.Width, screenWidth);
                float pb           = helper.Get <IPaddingBottom>().CalcSize(styleBound.Height, screenHeight);
                if (IOSApplicationContext.OSVersion.Major >= 7)
                {
                    _view.TextContainerInset = new UIEdgeInsets(pt, pl, pb, pr);
                }

                // text align
                ITextAlign textAlign;
                if (helper.TryGet(out textAlign))
                {
                    switch (textAlign.Align)
                    {
                    case TextAlignValues.Left:
                        _view.TextAlignment = UITextAlignment.Left;
                        break;

                    case TextAlignValues.Center:
                        _view.TextAlignment = UITextAlignment.Center;
                        break;

                    case TextAlignValues.Right:
                        _view.TextAlignment = UITextAlignment.Right;
                        break;
                    }
                }

                float size = _view.Font.LineHeight;
                _errorSubview.Frame  = new RectangleF(styleBound.Width - size, pt, size, size);
                _errorSubview.Hidden = true;
            }

            return(styleBound);
        }
Ejemplo n.º 42
0
 public static UIImage AssertColorAtTopRight(this UIImage bitmap, UIColor expectedColor)
 {
     return(bitmap.AssertColorAtPoint(expectedColor, (int)bitmap.Size.Width - 1, (int)bitmap.Size.Height - 1));
 }
Ejemplo n.º 43
0
        public static UIImage AssertColorAtPoint(this UIView view, UIColor expectedColor, int x, int y)
        {
            var bitmap = view.ToBitmap();

            return(bitmap.AssertColorAtPoint(expectedColor, x, y));
        }
Ejemplo n.º 44
0
        public ZoomingandPanning()
        {
            chart = new SFChart();
            chart.ColorModel.Palette = SFChartColorPalette.Natural;
            chart.Title.Text         = new NSString("Height vs Weight");
            chart.Delegate           = new TooltipGenerator();

            SFNumericalAxis primary = new SFNumericalAxis();

            primary.ShowMajorGridLines    = false;
            primary.EdgeLabelsDrawingMode = SFChartAxisEdgeLabelsDrawingMode.Shift;
            primary.Minimum    = new NSNumber(100);
            primary.Maximum    = new NSNumber(220);
            primary.Interval   = new NSNumber(20);
            primary.Title.Text = new NSString("Height in Inches");
            chart.PrimaryAxis  = primary;

            SFNumericalAxis secondary = new SFNumericalAxis();

            secondary.Title.Text         = new NSString("Weight in Pounds");
            secondary.ShowMajorGridLines = false;
            secondary.Minimum            = new NSNumber(50);
            secondary.Maximum            = new NSNumber(80);
            secondary.Interval           = new NSNumber(5);
            chart.SecondaryAxis          = secondary;
            ChartViewModel dataModel = new ChartViewModel();

            SFScatterSeries series = new SFScatterSeries();

            series.ItemsSource     = dataModel.ScatterMaleData;
            series.XBindingPath    = "XValue";
            series.YBindingPath    = "YValue";
            series.EnableTooltip   = true;
            series.ScatterHeight   = 10;
            series.ScatterWidth    = 10;
            series.Alpha           = 0.7f;
            series.EnableAnimation = true;
            series.Label           = "Male";
            series.LegendIcon      = SFChartLegendIcon.SeriesType;
            chart.Series.Add(series);

            SFScatterSeries series1 = new SFScatterSeries();

            series1.ItemsSource     = dataModel.ScatterFemaleData;
            series1.XBindingPath    = "XValue";
            series1.YBindingPath    = "YValue";
            series1.EnableTooltip   = true;
            series1.ScatterHeight   = 10;
            series1.ScatterWidth    = 10;
            series1.ShapeType       = ChartScatterShapeType.Diamond;
            series1.Alpha           = 0.7f;
            series1.EnableAnimation = true;
            series1.Label           = "Female";
            series1.LegendIcon      = SFChartLegendIcon.SeriesType;
            chart.Series.Add(series1);

            chart.Legend.Visible = true;
            chart.Legend.ToggleSeriesVisibility = true;
            chart.Legend.IconWidth    = 14;
            chart.Legend.IconHeight   = 14;
            chart.Legend.DockPosition = SFChartLegendPosition.Bottom;

            var tooltip = new SFChartTooltipBehavior();

            tooltip.BackgroundColor = UIColor.FromRGBA(64.0f / 255.0f, 64.0f / 255.0f, 65.0f / 255.0f, 1.0f);
            chart.AddChartBehavior(tooltip);

            label                 = new UILabel();
            label.Text            = "Pinch to zoom or double tap and drag to select a region to zoom in";
            label.Font            = UIFont.FromName("Helvetica", 12f);
            label.TextAlignment   = UITextAlignment.Center;
            label.LineBreakMode   = UILineBreakMode.WordWrap;
            label.Lines           = 2;
            label.BackgroundColor = UIColor.FromRGB(249, 249, 249);
            label.TextColor       = UIColor.FromRGB(79, 86, 91);
            chart.AddChartBehavior(new SFChartZoomPanBehavior()
            {
                EnableSelectionZooming = true
            });
            this.AddSubview(chart);

            CALayer topLine = new CALayer();

            topLine.Frame           = new CGRect(0, 0, UIScreen.MainScreen.ApplicationFrame.Width, 0.5);
            topLine.BackgroundColor = UIColor.FromRGB(178, 178, 178).CGColor;
            label.Layer.AddSublayer(topLine);

            this.AddSubview(label);
        }
Ejemplo n.º 45
0
        public override void LoadView()
        {
            // Create the views.
            View = new UIView {
                BackgroundColor = ApplicationTheme.BackgroundColor
            };

            _staticSceneView = new SceneView();
            _staticSceneView.TranslatesAutoresizingMaskIntoConstraints = false;
            _dynamicSceneView = new SceneView();
            _dynamicSceneView.TranslatesAutoresizingMaskIntoConstraints = false;

            _stackView = new UIStackView(new UIView[] { _staticSceneView, _dynamicSceneView });
            _stackView.TranslatesAutoresizingMaskIntoConstraints = false;
            _stackView.Distribution = UIStackViewDistribution.FillEqually;
            _stackView.Axis         = View.TraitCollection.VerticalSizeClass == UIUserInterfaceSizeClass.Compact ? UILayoutConstraintAxis.Horizontal : UILayoutConstraintAxis.Vertical;

            _zoomButton       = new UIBarButtonItem();
            _zoomButton.Title = "Zoom";

            UIToolbar toolbar = new UIToolbar();

            toolbar.TranslatesAutoresizingMaskIntoConstraints = false;
            toolbar.Items = new[]
            {
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                _zoomButton,
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace)
            };

            UILabel staticLabel = new UILabel
            {
                Text            = "Static",
                BackgroundColor = UIColor.FromWhiteAlpha(0f, .6f),
                TextColor       = UIColor.White,
                TextAlignment   = UITextAlignment.Center,
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            UILabel dynamicLabel = new UILabel
            {
                Text            = "Dynamic",
                BackgroundColor = UIColor.FromWhiteAlpha(0f, .6f),
                TextColor       = UIColor.White,
                TextAlignment   = UITextAlignment.Center,
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            // Add the views.
            View.AddSubviews(_stackView, toolbar, staticLabel, dynamicLabel);

            // Lay out the views.
            NSLayoutConstraint.ActivateConstraints(new[]
            {
                _stackView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor),
                _stackView.BottomAnchor.ConstraintEqualTo(toolbar.TopAnchor),
                _stackView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                _stackView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),

                toolbar.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                toolbar.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),
                toolbar.BottomAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.BottomAnchor),

                staticLabel.TopAnchor.ConstraintEqualTo(_staticSceneView.TopAnchor),
                staticLabel.HeightAnchor.ConstraintEqualTo(40),
                staticLabel.LeadingAnchor.ConstraintEqualTo(_staticSceneView.LeadingAnchor),
                staticLabel.TrailingAnchor.ConstraintEqualTo(_staticSceneView.TrailingAnchor),

                dynamicLabel.TopAnchor.ConstraintEqualTo(_dynamicSceneView.TopAnchor),
                dynamicLabel.HeightAnchor.ConstraintEqualTo(40),
                dynamicLabel.LeadingAnchor.ConstraintEqualTo(_dynamicSceneView.LeadingAnchor),
                dynamicLabel.TrailingAnchor.ConstraintEqualTo(_dynamicSceneView.TrailingAnchor)
            });
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.NavigationBar.BarTintColor = UIColor.FromPatternImage(UIImage.FromFile("*****@*****.**"));
        }
Ejemplo n.º 47
0
        // UIColor

        public static SKColor ToSKColor(this UIColor color)
        {
            System.nfloat r, g, b, a;
            color.GetRGBA(out r, out g, out b, out a);
            return(new SKColor((byte)(r * 255), (byte)(g * 255), (byte)(b * 255), (byte)(a * 255)));
        }
Ejemplo n.º 48
0
 private void prepare(UIImage image, UIColor tintColor)
 {
     this.Image     = image;
     this.TintColor = tintColor;
 }
Ejemplo n.º 49
0
 public static UIImage AssertColorAtBottomLeft(this UIImage bitmap, UIColor expectedColor)
 {
     return(bitmap.AssertColorAtPoint(expectedColor, 0, 0));
 }
Ejemplo n.º 50
0
 public void SetFillColor(UIColor color, UIControlState state)
 {
     this.SetBackgroundImage(GetImage(color), state);
 }
Ejemplo n.º 51
0
        public override void Draw(CGRect rect)
        {
            base.Draw(rect);



            using (var g = UIGraphics.GetCurrentContext())
            {
                //background
                //g.SetStrokeColor(UIColor.Blue.CGColor);//線色の指定(青色)
                //g.SetLineWidth(4);//線の太さ
                //g.SetFillColor(100, 100, 100, 1);//塗りつぶし色の指定(薄い青色)

                //g.AddRect(rect);
                //g.StrokePath();



                //原点(メーターの中心)
                float bX = (float)Element.meterSize / 2f;
                float bY = (float)Element.meterSize * .4f;

                double maxV = Element.maxValue;
                double minV = Element.minValue;

                //Value 1 当たりの角度
                double xx = 180 / (maxV - minV);

                //ベース円弧
                // 色の指定
                Color c = Element.basecolor;
                g.SetStrokeColor(UIColor.FromRGB((float)c.R, (float)c.G, (float)c.B).CGColor);

                // 線幅の指定
                g.SetLineWidth((float)Element.meterSize / 5f);

                // 円弧を追加
                g.AddArc(
                    bX,
                    bY,
                    bX * .6f,
                    Convert.ToSingle(-180f * Math.PI / 180f),
                    0f,
                    false);

                // 描画
                g.StrokePath();

                //値円弧
                // 色の指定
                c = Element.valuecolor;
                g.SetStrokeColor(UIColor.FromRGB((float)c.R, (float)c.G, (float)c.B).CGColor);

                // 線幅の指定
                g.SetLineWidth((float)Element.meterSize / 5f);

                // 円弧を追加
                g.AddArc(
                    bX,
                    bY,
                    bX * .6f,
                    Convert.ToSingle(-180f * Math.PI / 180f),
                    Convert.ToSingle((-180f + xx * val) * Math.PI / 180f),
                    false);

                // 描画
                g.StrokePath();


                //境界円弧
                // 色の指定
                c = Element.linecolor;
                g.SetStrokeColor(UIColor.FromRGB((float)c.R, (float)c.G, (float)c.B).CGColor);

                // 線幅の指定
                g.SetLineWidth((float)Element.meterSize / 5f);

                // 円弧を追加
                g.AddArc(
                    bX,
                    bY,
                    bX * .6f,
                    Convert.ToSingle((-180f + xx * val - 1) * Math.PI / 180f),
                    Convert.ToSingle((-180f + xx * val) * Math.PI / 180f),
                    false);

                // 枠線描画
                g.StrokePath();


                //value string
                if (Element.viewvalu)
                {
                    NSString stn  = new NSString(val.ToString() + Element.unitString);
                    var      attr = new UIStringAttributes
                    {
                        ForegroundColor = UIColor.Black,                                             //文字色
                        BackgroundColor = UIColor.Clear,                                             //背景色
                        Font            = UIFont.FromName("Courier-Italic", Element.valuestringSize) //フォント Courier 20ポイント
                    };
                    CGSize sz1 = stn.GetSizeUsingAttributes(attr);
                    stn.DrawString(new CGPoint(bX - sz1.Width / 2, bY - sz1.Height), attr);
                }



                //g.SetStrokeColor(UIColor.Blue.CGColor);//線色の指定(青色)
                //g.SetLineWidth(4);//線の太さ
                //g.SetFillColor(255, 0, 0, 1);//塗りつぶし色の指定(薄い青色)

                //var path = new CGPath();
                //CGPoint p1 = new CGPoint(bX, bY);
                //CGPoint p2 = new CGPoint( bX,  bY-10);
                //path.AddLines(new CGPoint[]{
                //                p1,
                //                p2,
                //        });
                //g.AddPath(path);
                //g.DrawPath(CGPathDrawingMode.FillStroke);



                //for (int i = (int)minV; i <= (int)maxV; i += (int)Element.tickValue)
                //{
                //    double r1 = bX * .85;
                //    double r2 = bX * .65;
                //    double r3 = bX * .55;
                //    double kak1 = Element.minAngle + (i - minV) * xx;
                //    double pX1 = -1 * r1 * Math.Sin(kak1 * (Math.PI / 180));
                //    double pY1 = r1 * Math.Cos(kak1 * (Math.PI / 180));
                //    double pX2 = -1 * r2 * Math.Sin(kak1 * (Math.PI / 180));
                //    double pY2 = r2 * Math.Cos(kak1 * (Math.PI / 180));
                //    double pX3 = -1 * r3 * Math.Sin(kak1 * (Math.PI / 180));
                //    double pY3 = r3 * Math.Cos(kak1 * (Math.PI / 180));

                //    string str1 = i.ToString();

                //    //属性の生成
                //    UIFont fnt = UIFont.FromName("Courier-Italic", 16f);



                //    var attr = new UIStringAttributes
                //    {
                //        ForegroundColor = UIColor.White,//文字色(白色)
                //        BackgroundColor = UIColor.Black,//背景色(オレンジ色)
                //        Font = UIFont.FromName("Courier-Italic", 20f) //フォント Courier 35ポイント

                //    };
                //    NSString stn = new NSString(str1);
                //    CGSize sz1 = stn.GetSizeUsingAttributes(attr);

                //    stn.DrawString(new CGPoint(pX3 + bX - sz1.Width / 2, pY3 + bX - sz1.Height / 2), attr);



                //    var pathT = new CGPath();
                //    CGPoint p1t = new CGPoint(pX1 + bX, pY1 + bX);
                //    CGPoint p2t = new CGPoint(pX2 + bX, pY2 + bX);

                //    pathT.AddLines(new CGPoint[]{
                //                 p1t,
                //                 p2t,
                //                  });
                //    g.AddPath(pathT);
                //    g.DrawPath(CGPathDrawingMode.FillStroke);

                //}



                //double r = bX * .85;
                //double kak = Element.minAngle + (val - minV) * xx;
                //double pX = -1 * r * Math.Sin(kak * (Math.PI / 180));
                //double pY = r * Math.Cos(kak * (Math.PI / 180));

                //g.SetStrokeColor(UIColor.Blue.CGColor);//線色の指定(青色)
                //g.SetLineWidth(4);//線の太さ
                //g.SetFillColor(255, 0, 0, 1);//塗りつぶし色の指定(薄い青色)

                //var path = new CGPath();
                //CGPoint p1 = new CGPoint(bX, bX);
                //CGPoint p2 = new CGPoint(pX + bX, pY + bX);
                //path.AddLines(new CGPoint[]{
                //                p1,
                //                p2,
                //        });
                //g.AddPath(path);
                //g.DrawPath(CGPathDrawingMode.FillStroke);

                //System.Diagnostics.Debug.WriteLine(">>> " + kak.ToString() + " " + pX.ToString() + " " + pY.ToString());
            }
        }
Ejemplo n.º 52
0
 public void SetStrokeColor(UIColor color)
 {
     this.Layer.BorderWidth = UIHelper.OnePixel;
     this.Layer.BorderColor = color.CGColor;
 }
Ejemplo n.º 53
0
 public static UIImage AssertContainsColor(this UIView view, UIColor expectedColor)
 {
     return(view.ToBitmap().AssertContainsColor(expectedColor));
 }
Ejemplo n.º 54
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.


            View.BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile("BackMain.jpg"));

            //--------Staff set up---------

            //notePositions will tell us where to draw staff in case sizes, positions change, noteHieght lets us find mid point
            int[] notePositions = { (int)Btn_FP1.Frame.Y, (int)Btn_D.Frame.Y, (int)Btn_B.Frame.Y, (int)Btn_G.Frame.Y, (int)Btn_E.Frame.Y };
            int   noteHeight    = (int)Btn_FP1.Frame.Height;
            int   staffOffset   = (int)(Btn_FP1.Frame.X * .9);

            //start of staff will be based on second E + width and will go down 90% from top, end points will be entire screen minus offsets and bottom E note
            layout = new StaffViewer(new CGRect(Btn_EP1.Frame.X + Btn_EP1.Frame.Width, (int)(Btn_FP1.Frame.X * .9), UIScreen.MainScreen.Bounds.Width - Btn_FP1.Frame.X - (Btn_EP1.Frame.X + Btn_EP1.Frame.Width), Btn_E.Frame.Y + Btn_E.Frame.Height), notePositions, noteHeight, staffOffset);

            //-----Staff set up end--------

            //-----Handle stepper for tempo---------------
            stepper_tempo.ValueChanged += (object sender, EventArgs e) =>
            {
                txtTempo.Text = stepper_tempo.Value.ToString();
                currentTempo  = Convert.ToInt32(stepper_tempo.Value.ToString());
            };

            txtTempo.ShouldChangeCharacters += (UITextField textfield, NSRange range, string replacement) =>
            {
                string combine = textfield.Text + replacement;

                if (combine.Equals(""))
                {
                    combine = "0";
                }

                double newVal = Convert.ToDouble(combine);

                if (newVal >= 30.0 && newVal <= 180.0)
                {
                    stepper_tempo.Value = newVal;
                }
                else if (newVal < 30.0)
                {
                    stepper_tempo.Value = 30.0;
                }
                else
                {
                    stepper_tempo.Value = 180.0;
                }

                currentTempo = Convert.ToInt32(stepper_tempo.Value.ToString());

                return(true);
            };

            //-----Handle Button Presses--------

            Btn_Math.TouchUpInside += (object sender, EventArgs e) =>
            {
            };

            //---------Save/Load file-------
            btn_Save.TouchUpInside += (object sender, EventArgs e) =>
            {
                var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                var filename  = Path.Combine(documents, txt_name.Text);
                File.WriteAllText(filename, currentMelody + ":" + currentTempo);
            };

            btn_Load.TouchUpInside += (object sender, EventArgs e) =>
            {
                var       documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                var       filename  = Path.Combine(documents, txt_Load.Text);
                string[]  splitData = { ":" };
                string [] txtData   = File.ReadAllText(filename).Split(splitData, StringSplitOptions.RemoveEmptyEntries);
                currentMelody       = txtData[0];
                currentTempo        = Convert.ToInt32(txtData[1]);
                stepper_tempo.Value = currentTempo;
                txtTempo.Text       = currentTempo.ToString();
                layout.SetMelody(currentMelody);
                layout.SetNeedsDisplay();
            };
            //-------end file save/load----------

            //----Play/Remove buttons---------
            PlayButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                //MidiPlayer player = new MidiPlayer();
                //player.play("C|1|1,A|1|0,C|.25|1,A|.25|0,C|.25|1,A|.25|0", 60);
                player.play(currentMelody, currentTempo);
            };

            Btn_Remove.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("", "", "R");
            };
            //-----end Play/Remove Buttons------

            //-----Instrument buttons------------
            Btn_Piano.TouchUpInside += (object sender, EventArgs e) =>
            {
                player.SetInstrument("piano");
            };

            Btn_Choir.TouchUpInside += (object sender, EventArgs e) =>
            {
                player.SetInstrument("voice");
            };

            Btn_Guitar.TouchUpInside += (object sender, EventArgs e) =>
            {
                player.SetInstrument("guitar");
            };

            Btn_Bass.TouchUpInside += (object sender, EventArgs e) =>
            {
                player.SetInstrument("bass");
            };
            //----end instrument buttons----------


            //---Note Value Buttons---------
            Btn_NoteWhole.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageNoteButtons(Btn_NoteWhole);
            };

            Btn_Half.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageNoteButtons(Btn_Half);
            };

            Btn_Quarter.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageNoteButtons(Btn_Quarter);
            };

            Btn_Eighth.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageNoteButtons(Btn_Eighth);
            };

            Btn_Sixteen.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageNoteButtons(Btn_Sixteen);
            };
            //----end note value buttons------

            //----Note Pitch Buttons---------
            Btn_D0.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("D", "0", "A");
            };

            Btn_E.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("E", "0", "A");
            };

            Btn_F.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("F", "0", "A");
            };

            Btn_G.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("G", "0", "A");
            };

            Btn_A.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("A", "0", "A");
            };

            Btn_B.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("B", "0", "A");
            };

            Btn_C.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("C", "1", "A");
            };

            Btn_D.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("D", "1", "A");
            };

            Btn_EP1.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("E", "1", "A");
            };

            Btn_FP1.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("F", "1", "A");
            };

            Btn_G1.TouchUpInside += (object sender, EventArgs e) =>
            {
                ManageMelody("G", "1", "A");
            };
            //----end note pitch buttons--------

            //------end Handle Button presses-----------

            //add the view to the main view
            //var layout = new StaffViewer(new CGRect(100, 50, UIScreen.MainScreen.Bounds.Width - 100, UIScreen.MainScreen.Bounds.Height - 400));
            //layout.BackgroundColor = UIColor.Red;
            View.AddSubview(layout);
        }
Ejemplo n.º 55
0
 private void prepare(string title, UIColor titleColor)
 {
     this.Title      = title;
     this.TitleColor = titleColor;
 }
Ejemplo n.º 56
0
        public void mainPageDesign()
        {
            customView = new UIView();
            customView.BackgroundColor = UIColor.FromRGB(165, 165, 165);
            this.OptionView            = new UIView();
            image1          = new UIImageView();
            precisionPicker = new UIPickerView();
            toolTipPicker   = new UIPickerView();
            PickerModel model = new PickerModel(precisionList);

            precisionPicker.Model = model;
            PickerModel model1 = new PickerModel(toottipplace);

            toolTipPicker.Model = model1;
            precisionLabel      = new UILabel();
            toolTipLabel        = new UILabel();
            itemCountLabel      = new UILabel();
            movieRateLabel      = new UILabel();
            walkLabel           = new UILabel();
            timeLabel           = new UILabel();
            descriptionLabel    = new UILabel();
            rateLabel           = new UILabel();
            valueLabel          = new UILabel();
            precisionButton     = new UIButton();
            toolTipButton       = new UIButton();
            image1.Image        = UIImage.FromBundle("Images/walk.png");

            precisionLabel.Text          = "Precision";
            precisionLabel.TextColor     = UIColor.Black;
            precisionLabel.TextAlignment = UITextAlignment.Left;

            toolTipLabel.Text          = "ToolTip Placement";
            toolTipLabel.TextColor     = UIColor.Black;
            toolTipLabel.TextAlignment = UITextAlignment.Left;

            itemCountLabel.Text          = "Item Count";
            itemCountLabel.TextColor     = UIColor.Black;
            itemCountLabel.TextAlignment = UITextAlignment.Left;
            itemCountLabel.Font          = UIFont.FromName("Helvetica", 14f);

            movieRateLabel.Text          = "Movie Rating";
            movieRateLabel.TextColor     = UIColor.Black;
            movieRateLabel.TextAlignment = UITextAlignment.Left;
            movieRateLabel.Font          = UIFont.FromName("Helvetica", 22f);

            walkLabel.Text          = "The Walk (2015)";
            walkLabel.TextColor     = UIColor.Black;
            walkLabel.TextAlignment = UITextAlignment.Left;
            walkLabel.Font          = UIFont.FromName("Helvetica", 18f);

            timeLabel.Text          = "PG | 2 h 20 min";
            timeLabel.TextColor     = UIColor.Black;
            timeLabel.TextAlignment = UITextAlignment.Left;
            timeLabel.Font          = UIFont.FromName("Helvetica", 10f);

            descriptionLabel.Text          = "In 1974, high-wire artist Philippe Petit recruits a team of people to help him realize his dream: to walk the immense void between the world Trade Centre towers.";
            descriptionLabel.TextColor     = UIColor.Black;
            descriptionLabel.TextAlignment = UITextAlignment.Left;
            descriptionLabel.Font          = UIFont.FromName("Helvetica", 12f);
            descriptionLabel.LineBreakMode = UILineBreakMode.WordWrap;
            descriptionLabel.Lines         = 0;

            rateLabel.Text          = "Rate";
            rateLabel.TextColor     = UIColor.Black;
            rateLabel.TextAlignment = UITextAlignment.Left;
            rateLabel.Font          = UIFont.FromName("Helvetica", 18f);

            valueLabel.TextColor     = UIColor.Black;
            valueLabel.TextAlignment = UITextAlignment.Left;
            valueLabel.Font          = UIFont.FromName("Helvetica", 14f);
            UpdateText();

            precisionButton.SetTitle("Standard", UIControlState.Normal);
            precisionButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            precisionButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            precisionButton.Layer.CornerRadius  = 8;
            precisionButton.Layer.BorderWidth   = 2;
            precisionButton.TouchUpInside      += ShowPicker1;
            precisionButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            toolTipButton.SetTitle("None", UIControlState.Normal);
            toolTipButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            toolTipButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            toolTipButton.Layer.CornerRadius  = 8;
            toolTipButton.Layer.BorderWidth   = 2;
            toolTipButton.TouchUpInside      += ShowPicker2;
            toolTipButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            doneButton.SetTitle("Done\t", UIControlState.Normal);
            doneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            doneButton.TouchUpInside      += HidePicker;
            doneButton.Hidden          = true;
            doneButton.BackgroundColor = UIColor.FromRGB(246, 246, 246);

            model.PickerChanged  += SelectedIndexChanged;
            model1.PickerChanged += SelectedIndexChanged1;
            precisionPicker.ShowSelectionIndicator = true;
            precisionPicker.Hidden = true;
            toolTipPicker.Hidden   = true;
            //precisionPicker.BackgroundColor = UIColor.Gray;
            //toolTipPicker.BackgroundColor = UIColor.Gray;
            toolTipPicker.ShowSelectionIndicator = true;

            itemCountTextfield = new UITextView();
            itemCountTextfield.TextAlignment     = UITextAlignment.Center;
            itemCountTextfield.Layer.BorderColor = UIColor.Black.CGColor;
            itemCountTextfield.BackgroundColor   = UIColor.FromRGB(246, 246, 246);
            itemCountTextfield.KeyboardType      = UIKeyboardType.NumberPad;
            itemCountTextfield.Text     = "5";
            itemCountTextfield.Changed += (object sender, EventArgs e) =>
            {
                if (itemCountTextfield.Text.Length > 0)
                {
                    rating1.ItemCount = int.Parse(itemCountTextfield.Text);
                }
                else
                {
                    rating1.ItemCount = 5;
                }
                UpdateText();
            };

            this.AddSubview(movieRateLabel);
            this.AddSubview(walkLabel);
            this.AddSubview(timeLabel);
            this.AddSubview(descriptionLabel);
            this.AddSubview(rateLabel);
            this.AddSubview(valueLabel);
            this.AddSubview(image1);
            this.AddSubview(itemCountTextfield);
        }
Ejemplo n.º 57
0
        internal void CreateEditor()
        {
            button_cancel       = new UIButton();
            button_save         = new UIButton();
            label_subject       = new UITextView();
            label_location      = new UITextView();
            label_ends          = new UILabel();
            label_starts        = new UILabel();
            button_startDate    = new UIButton();
            button_endDate      = new UIButton();
            startTimeZoneLabel  = new UILabel();
            endTimeZoneLabel    = new UILabel();
            startTimeZoneButton = new UIButton();
            endTimeZoneButton   = new UIButton();
            picker_startDate    = new UIDatePicker();
            picker_endDate      = new UIDatePicker();
            done_button         = new UIButton();
            scrollView          = new UIScrollView();
            startTimeZonePicker = new UIPickerView();
            endTimeZonePicker   = new UIPickerView();
            allDaySwitch        = new UISwitch();
            allDaylabel         = new UILabel();

            scrollView.BackgroundColor = UIColor.White;

            label_subject.Font       = UIFont.SystemFontOfSize(14);
            label_location.Font      = UIFont.SystemFontOfSize(14);
            label_starts.Font        = UIFont.SystemFontOfSize(15);
            label_ends.Font          = UIFont.SystemFontOfSize(15);
            startTimeZoneLabel.Font  = UIFont.SystemFontOfSize(15);
            endTimeZoneLabel.Font    = UIFont.SystemFontOfSize(15);
            allDaylabel.Font         = UIFont.SystemFontOfSize(15);
            startTimeZoneButton.Font = UIFont.SystemFontOfSize(15);
            endTimeZoneButton.Font   = UIFont.SystemFontOfSize(15);
            button_startDate.Font    = UIFont.SystemFontOfSize(15);
            button_endDate.Font      = UIFont.SystemFontOfSize(15);

            button_cancel.BackgroundColor = UIColor.FromRGB(229, 229, 229);
            button_cancel.Font            = UIFont.SystemFontOfSize(15);
            button_save.Font                    = UIFont.SystemFontOfSize(15);
            button_save.BackgroundColor         = UIColor.FromRGB(33, 150, 243);
            button_cancel.Layer.CornerRadius    = 6;
            button_save.Layer.CornerRadius      = 6;
            button_startDate.Layer.CornerRadius = 6;
            button_endDate.Layer.CornerRadius   = 6;


            startTimeZoneLabel.Text      = "Start Time Zone";
            startTimeZoneLabel.TextColor = UIColor.Black;

            endTimeZoneLabel.Text      = "End Time Zone";
            endTimeZoneLabel.TextColor = UIColor.Black;

            allDaylabel.Text      = "All Day";
            allDaylabel.TextColor = UIColor.Black;

            allDaySwitch.On            = false;
            allDaySwitch.OnTintColor   = UIColor.FromRGB(33, 150, 243);
            allDaySwitch.ValueChanged += AllDaySwitch_ValueChanged;

            startTimeZoneButton.SetTitle("Default", UIControlState.Normal);
            startTimeZoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            startTimeZoneButton.Layer.BorderWidth   = 2;
            startTimeZoneButton.Layer.CornerRadius  = 4;
            startTimeZoneButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;
            startTimeZoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            startTimeZoneButton.TouchUpInside      += (object sender, EventArgs e) =>
            {
                startTimeZonePicker.Hidden = false;
                done_button.Hidden         = false;

                allDaylabel.Hidden       = true;
                allDaySwitch.Hidden      = true;
                button_cancel.Hidden     = true;
                button_save.Hidden       = true;
                endTimeZoneLabel.Hidden  = true;
                endTimeZoneButton.Hidden = true;
                Editor.EndEditing(true);
            };

            endTimeZoneButton.SetTitle("Default", UIControlState.Normal);
            endTimeZoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            endTimeZoneButton.Layer.BorderWidth   = 2;
            endTimeZoneButton.Layer.CornerRadius  = 4;
            endTimeZoneButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;
            endTimeZoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            endTimeZoneButton.TouchUpInside      += (object sender, EventArgs e) =>
            {
                endTimeZonePicker.Hidden = false;
                done_button.Hidden       = false;
                allDaylabel.Hidden       = true;
                allDaySwitch.Hidden      = true;
                button_cancel.Hidden     = true;
                button_save.Hidden       = true;
                endTimeZoneLabel.Hidden  = true;
                endTimeZoneButton.Hidden = true;
                Editor.EndEditing(true);
            };


            //cancel button
            button_cancel.SetTitle("Cancel", UIControlState.Normal);
            button_cancel.SetTitleColor(UIColor.FromRGB(59, 59, 59), UIControlState.Normal);// UIColor.FromRGB(59, 59, 59);
            button_cancel.TouchUpInside += (object sender, EventArgs e) =>
            {
                Editor.Hidden   = true;
                schedule.Hidden = false;
                Editor.EndEditing(true);
                scheduleViews.headerView.Hidden = false;
            };

            //save button
            button_save.SetTitle("Save", UIControlState.Normal);
            button_save.SetTitleColor(UIColor.White, UIControlState.Normal);
            button_save.TouchUpInside += (object sender, EventArgs e) =>
            {
                scheduleViews.headerView.Hidden = false;
                if (scheduleViews.indexOfAppointment != -1)
                {
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.indexOfAppointment.ToString())].Subject   = (NSString)label_subject.Text;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.indexOfAppointment.ToString())].Location  = (NSString)label_location.Text;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.indexOfAppointment.ToString())].StartTime = picker_startDate.Date;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.indexOfAppointment.ToString())].EndTime   = picker_endDate.Date;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.indexOfAppointment.ToString())].IsAllDay  = allDaySwitch.On;
                }
                else
                {
                    ScheduleAppointment appointment = new ScheduleAppointment();
                    appointment.Subject               = (NSString)label_subject.Text;
                    appointment.Location              = (NSString)label_location.Text;
                    appointment.StartTime             = picker_startDate.Date;
                    appointment.EndTime               = picker_endDate.Date;
                    appointment.AppointmentBackground = UIColor.FromRGB(0xA2, 0xC1, 0x39);
                    appointment.IsAllDay              = allDaySwitch.On;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>).Add(appointment);
                }
                Editor.Hidden   = true;
                schedule.Hidden = false;
                schedule.ReloadData();
                Editor.EndEditing(true);
            };

            //subject label
            label_subject.TextColor          = UIColor.Black;
            label_subject.TextAlignment      = UITextAlignment.Left;
            label_subject.Layer.CornerRadius = 8;
            label_subject.Layer.BorderWidth  = 2;
            label_subject.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;


            //location label
            label_location.TextColor          = UIColor.Black;
            label_location.TextAlignment      = UITextAlignment.Left;
            label_location.Layer.CornerRadius = 8;
            label_location.Layer.BorderWidth  = 2;
            label_location.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;

            //starts time

            label_starts.Text      = "Start Time";
            label_starts.TextColor = UIColor.Black;

            button_startDate.SetTitle("Start time", UIControlState.Normal);
            button_startDate.Layer.BorderWidth  = 2;
            button_startDate.Layer.CornerRadius = 4;
            button_startDate.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;
            button_startDate.SetTitleColor(UIColor.Black, UIControlState.Normal);
            button_startDate.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            button_startDate.TouchUpInside      += (object sender, EventArgs e) =>
            {
                picker_startDate.Hidden = false;
                done_button.Hidden      = false;

                allDaylabel.Hidden       = true;
                allDaySwitch.Hidden      = true;
                button_cancel.Hidden     = true;
                button_save.Hidden       = true;
                endTimeZoneLabel.Hidden  = true;
                endTimeZoneButton.Hidden = true;
                Editor.EndEditing(true);
            };

            //end time

            label_ends.Text      = "End Time";
            label_ends.TextColor = UIColor.Black;


            //end date
            button_endDate.SetTitle("End time", UIControlState.Normal);
            button_endDate.SetTitleColor(UIColor.Black, UIControlState.Normal);
            button_endDate.Layer.BorderWidth   = 2;
            button_endDate.Layer.CornerRadius  = 4;
            button_endDate.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;
            button_endDate.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            button_endDate.TouchUpInside      += (object sender, EventArgs e) =>
            {
                picker_endDate.Hidden    = false;
                done_button.Hidden       = false;
                allDaylabel.Hidden       = true;
                allDaySwitch.Hidden      = true;
                button_cancel.Hidden     = true;
                button_save.Hidden       = true;
                endTimeZoneLabel.Hidden  = true;
                endTimeZoneButton.Hidden = true;

                Editor.EndEditing(true);
            };

            //date and time pickers
            picker_startDate.Hidden    = true;
            picker_endDate.Hidden      = true;
            startTimeZonePicker.Hidden = true;
            endTimeZonePicker.Hidden   = true;
            done_button.Hidden         = true;

            //done button
            done_button.SetTitle("Done", UIControlState.Normal);
            done_button.SetTitleColor(UIColor.Blue, UIControlState.Normal);
            done_button.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            done_button.TouchUpInside      += (object sender, EventArgs e) =>
            {
                picker_startDate.Hidden    = true;
                picker_endDate.Hidden      = true;
                startTimeZonePicker.Hidden = true;
                endTimeZonePicker.Hidden   = true;
                done_button.Hidden         = true;

                label_ends.Hidden          = false;
                button_endDate.Hidden      = false;
                button_startDate.Hidden    = false;
                label_starts.Hidden        = false;
                endTimeZoneLabel.Hidden    = false;
                startTimeZoneLabel.Hidden  = false;
                allDaylabel.Hidden         = false;
                allDaySwitch.Hidden        = false;
                startTimeZoneButton.Hidden = false;
                endTimeZoneButton.Hidden   = false;
                button_cancel.Hidden       = false;
                button_save.Hidden         = false;

                String _sDate = DateTime.Parse((picker_startDate.Date.ToString())).ToString();
                button_startDate.SetTitle(_sDate, UIControlState.Normal);

                String _eDate = DateTime.Parse((picker_endDate.Date.ToString())).ToString();
                button_endDate.SetTitle(_eDate, UIControlState.Normal);
                Editor.EndEditing(true);
            };

            SchedulePickerModel model = new SchedulePickerModel(TimeZoneCollection.TimeZoneList);

            model.PickerChanged += (sender, e) =>
            {
                if (e.SelectedValue != "Default" && scheduleViews.selectedAppointment != null)
                {
                    scheduleViews.selectedAppointment.StartTimeZone = e.SelectedValue;
                }
                startTimeZoneButton.SetTitle(e.SelectedValue, UIControlState.Normal);
            };

            SchedulePickerModel model2 = new SchedulePickerModel(TimeZoneCollection.TimeZoneList);

            model2.PickerChanged += (sender, e) =>
            {
                if (e.SelectedValue != "Default" && scheduleViews.selectedAppointment != null)
                {
                    scheduleViews.selectedAppointment.EndTimeZone = e.SelectedValue;
                }
                endTimeZoneButton.SetTitle(e.SelectedValue, UIControlState.Normal);
            };

            startTimeZonePicker.Model = model;
            endTimeZonePicker.Model   = model2;
            startTimeZonePicker.ShowSelectionIndicator = true;
            endTimeZonePicker.ShowSelectionIndicator   = true;

            scrollView.Add(label_subject);
            scrollView.Add(label_location);
            scrollView.Add(label_starts);
            scrollView.Add(button_startDate);
            scrollView.Add(startTimeZoneLabel);
            scrollView.Add(startTimeZoneButton);
            scrollView.Add(label_ends);
            scrollView.Add(button_endDate);
            scrollView.Add(endTimeZoneLabel);
            scrollView.Add(endTimeZoneButton);
            scrollView.Add(startTimeZonePicker);
            scrollView.Add(endTimeZonePicker);
            scrollView.Add(picker_endDate);
            scrollView.Add(picker_startDate);
            scrollView.Add(done_button);
            scrollView.Add(allDaylabel);
            scrollView.Add(allDaySwitch);
            scrollView.Add(button_cancel);
            scrollView.Add(button_save);

            Editor.Add(scrollView);
        }
Ejemplo n.º 58
0
        public static UIImage AssertColorAtTopRight(this UIView view, UIColor expectedColor)
        {
            var bitmap = view.ToBitmap();

            return(bitmap.AssertColorAtTopRight(expectedColor));
        }
Ejemplo n.º 59
0
        private void drawBackground(RectangleF frame, CGContext context)
        {
            float R0 = 0.267f, G0 = 0.303f, B0 = 0.335f;
            float R1 = 0.040f, G1 = 0.040f, B1 = 0.040f;

            //UIColor tintColor = KxMenu.tintColor;
            float X0 = frame.X;
            float X1 = frame.X + frame.Width;
            float Y0 = frame.Y;
            float Y1 = frame.Y + frame.Height;

            // render arrow

            UIBezierPath arrowPath = new UIBezierPath();

            // fix the issue with gap of arrow's base if on the edge
            const float kEmbedFix = 3f;

            if (_arrowDirection == ArrowDirection.Up)
            {
                float arrowXM = _arrowPosition;
                float arrowX0 = arrowXM - kArrowSize;
                float arrowX1 = arrowXM + kArrowSize;
                float arrowY0 = Y0;
                float arrowY1 = Y0 + kArrowSize + kEmbedFix;

                arrowPath.MoveTo(new PointF(arrowXM, arrowY0));
                arrowPath.AddLineTo(new PointF(arrowX1, arrowY1));
                arrowPath.AddLineTo(new PointF(arrowX0, arrowY1));
                arrowPath.AddLineTo(new PointF(arrowXM, arrowY0));

                UIColor.FromRGBA(R0, G0, B0, 1).SetFill();

                Y0 += kArrowSize;
            }
            else if (_arrowDirection == ArrowDirection.Down)
            {
                float arrowXM = _arrowPosition;
                float arrowX0 = arrowXM - kArrowSize;
                float arrowX1 = arrowXM + kArrowSize;
                float arrowY0 = Y1 - kArrowSize - kEmbedFix;
                float arrowY1 = Y1;

                arrowPath.MoveTo(new PointF(arrowXM, arrowY1));
                arrowPath.AddLineTo(new PointF(arrowX1, arrowY0));
                arrowPath.AddLineTo(new PointF(arrowX0, arrowY0));
                arrowPath.AddLineTo(new PointF(arrowXM, arrowY1));

                UIColor.FromRGBA(R1, G1, B1, 1).SetFill();

                Y1 -= kArrowSize;
            }
            else if (_arrowDirection == ArrowDirection.Left)
            {
                float arrowYM = _arrowPosition;
                float arrowX0 = X0;
                float arrowX1 = X0 + kArrowSize + kEmbedFix;
                float arrowY0 = arrowYM - kArrowSize;
                ;
                float arrowY1 = arrowYM + kArrowSize;

                arrowPath.MoveTo(new PointF(arrowX0, arrowYM));
                arrowPath.AddLineTo(new PointF(arrowX1, arrowY0));
                arrowPath.AddLineTo(new PointF(arrowX1, arrowY1));
                arrowPath.AddLineTo(new PointF(arrowX0, arrowYM));

                UIColor.FromRGBA(R0, G0, B0, 1).SetFill();

                X0 += kArrowSize;
            }
            else if (_arrowDirection == ArrowDirection.Right)
            {
                float arrowYM = _arrowPosition;
                float arrowX0 = X1;
                float arrowX1 = X1 - kArrowSize - kEmbedFix;
                float arrowY0 = arrowYM - kArrowSize;
                ;
                float arrowY1 = arrowYM + kArrowSize;

                arrowPath.MoveTo(new PointF(arrowX0, arrowYM));
                arrowPath.AddLineTo(new PointF(arrowX1, arrowY0));
                arrowPath.AddLineTo(new PointF(arrowX1, arrowY1));
                arrowPath.AddLineTo(new PointF(arrowX0, arrowYM));

                UIColor.FromRGBA(R1, G1, B1, 1).SetFill();

                X1 -= kArrowSize;
            }

            arrowPath.Fill();
            // render body

            RectangleF bodyFrame = new RectangleF(X0, Y0, X1 - X0, Y1 - Y0);

            UIBezierPath borderPath = UIBezierPath.FromRoundedRect(bodyFrame, 8);

            float[] locations  = new[] { 0f, 1f };
            float[] components = new[]
            {
                R0, G0, B0, 1,
                R1, G1, B1, 1,
            };

            CGColorSpace colorSpace = CGColorSpace.CreateDeviceRGB();
            CGGradient   gradient   = new CGGradient(colorSpace, components, locations);

            borderPath.AddClip();

            PointF start, end;

            if (_arrowDirection == ArrowDirection.Left ||
                _arrowDirection == ArrowDirection.Right)
            {
                start = new PointF(X0, Y0);
                end   = new PointF(X1, Y0);
            }
            else
            {
                start = new PointF(X0, Y0);
                end   = new PointF(X0, Y1);
            }

            context.DrawLinearGradient(gradient, start, end, 0);
        }
Ejemplo n.º 60
0
        protected override IBound Apply(IStyleSheet stylesheet, IBound styleBound, IBound maxBound)
        {
            base.Apply(stylesheet, styleBound, maxBound);

            IStyleSheetHelper style = stylesheet.Helper;

            // background color, borders
            stylesheet.SetBackgroundSettings(this);

            // text color
            _textColor      = style.Color(this).ToColorOrClear();
            _view.TextColor = _textColor;

            // placeholder color
            _placeholderColor = style.PlaceholderColor(this).ToColorOrClear();

            // font
            UIFont f = stylesheet.Font(this, styleBound.Height);

            if (f != null)
            {
                _view.Font = f;
            }

            // padding
            float pl = style.PaddingLeft(this, styleBound.Width);
            float pt = style.PaddingTop(this, styleBound.Height);
            float pr = style.PaddingRight(this, styleBound.Width);
            float pb = style.PaddingBottom(this, styleBound.Height);

            if (IOSApplicationContext.OSVersion.Major >= 7)
            {
                _view.TextContainerInset = new UIEdgeInsets(pt, pl, pb, pr);
            }

            // text align
            switch (style.TextAlign(this))
            {
            case TextAlignValues.Left:
                _view.TextAlignment = UITextAlignment.Left;
                break;

            case TextAlignValues.Center:
                _view.TextAlignment = UITextAlignment.Center;
                break;

            case TextAlignValues.Right:
                _view.TextAlignment = UITextAlignment.Right;
                break;
            }

            RefreshPlaceholder();

            float size = _view.Font.LineHeight;

            _errorSubview        = CreateValidationIcon(size);
            _errorSubview.Frame  = new RectangleF(styleBound.Width - size, pt, size, size);
            _errorSubview.Hidden = true;
            _view.AddSubview(_errorSubview);

            // size to content by background
            return(styleBound);
        }