public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			scrollView = new UIScrollView {
				BackgroundColor = UIColor.Black,
				Frame = new CGRect (0, 0, 320, View.Bounds.Height * 3)
			};

			hamburgerMenu = new UIButton {
				Frame = new CGRect (10, 10, 25, 25)
			};
			hamburgerMenu.SetImage (UIImage.FromFile ("HamburgerMenu.png"), UIControlState.Normal);
			hamburgerMenu.TouchUpInside += (sender, e) => {
				flyout.ToggleMenu ();
			};

			photoGalleryView = new PhotoGalleryView (View.Bounds) {
				Frame = new CGRect (0, 0, View.Bounds.Width, View.Bounds.Height)
			};

			scrollView.Add (photoGalleryView);
			scrollView.Add (hamburgerMenu);

			View.Add (scrollView);
		}
Ejemplo n.º 2
0
		private void SetupUserInterface ()
		{
			scrollView = new UIScrollView {
				BackgroundColor = UIColor.Clear.FromHexString ("#336699", 1.0f),
				Frame = new CGRect (0, 0, Frame.Width, Frame.Height)
			};

			licensureLabel = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 30f),
				Frame = new CGRect (0, 20, Frame.Width, 35),
				Text = "Terms of Service",
				TextAlignment = UITextAlignment.Center,
				TextColor = UIColor.White
			};

			textView = new UITextView {
				BackgroundColor = UIColor.Clear,
				Font = UIFont.FromName ("SegoeUI-Light", 15f), 
				Frame = new CGRect (20, 50, Frame.Width - 40, Frame.Height * 1.75),
				Text = "Willie’s Cycle will assume no damage liability from the sales of used or new parts. This damage includes personal injury, property, vehicle, monetary, punitive, emotional, and mental damage. All risk and liability is assumed by the purchaser or the installer of any product sold by Willie’s Cycle. Willie’s Cycle cannot be held liable for any of the following reasons: damage to person or property, including damage or injury to driver, passenger, or any other person, animal or property damage that may occur have occurred after purchasing any product from Willie’s Cycle. Willie’s Cycle will only accept returns for parts to be used in store credit or, at our discretion. Willie’s Cycle will give refunds due to applications not being as described. Willie’s Cycle will only give credit or refund up to full purchase amount of the product. Willie’s Cycle may charge a restock fee for returned parts. This restock fee is a minimum of 20% of the purchase price. All parts are expected to have normal wear, and in no way do we consider used parts to be in any condition other than used functional parts with wear, unless otherwise noted. Any returns must be sent with return authorization. RA# may be granted by providing the following: Date of purchase, transaction number, year, model, make, and VIN number of vehicle. Returns can be rejected if purchase was made on account of buyer error. Amount of refund or credit is determined solely by Willie’s Cycle. Returned item must be received by Willie’s Cycle within 30 days of original purchase date. All returned items must be returned in the same condition as they were received.",
				TextColor = UIColor.White,
				UserInteractionEnabled = false
			};

			scrollView.ContentSize = new CGSize (Frame.Width, Frame.Height * 1.75);

			scrollView.Add (licensureLabel);
			scrollView.Add (textView);
			Add (scrollView);
		}
Ejemplo n.º 3
0
		private void SetupUserInterface ()
		{
			scrollView = new UIScrollView {
				BackgroundColor = UIColor.Clear.FromHexString ("#094074", 1.0f),
				Frame = new CGRect (0, 0, Frame.Width, Frame.Height * 2)
			};

			licensureLabel = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 25f),
				Frame = new CGRect (0, 20, Frame.Width, 35),
				Text = "Open-Source",
				TextAlignment = UITextAlignment.Center,
				TextColor = UIColor.White
			};

			string localHtmlUrl = Path.Combine (NSBundle.MainBundle.BundlePath, "Licensure.html");
			var url = new NSUrl (localHtmlUrl, false);
			var request = new NSUrlRequest (url);

			webView = new UIWebView () {
				Frame = new CGRect (0, 55, Frame.Width, Frame.Height - 55)
			};
			webView.LoadRequest (request);

			scrollView.ContentSize = new CGSize (Frame.Width, Frame.Height * 2);

			scrollView.Add (licensureLabel);
			scrollView.Add (webView);
			Add (scrollView);
		}
		public override void LoadView ()
		{
			base.LoadView ();
			View.AddSubview (scrollView = new UIScrollView (View.Bounds));
			if (ShouldShowInstructions) {
				scrollView.Add (ContentView = new PrefillXamarinAccountInstructionsView ());
			} else {
				LoginView = new LoginView (XamarinAccountEmail);
				LoginView.UserDidLogin += _ => Login (XamarinAccountEmail, LoginView.PasswordField.Text);
				scrollView.Add (ContentView = LoginView);
			}
		}
        private void InitializeComponent()
        {
            View.BackgroundColor = Application.Colors.MainBackgroundColor;

            FlowerImage = new UIImageView(new CGRect(10, 75, 120, 120));
            View.Add(FlowerImage);

            NameText = new UILabel(new CGRect(140, 75, 170, 30))
            {
                TextColor = Application.Colors.HighlightColor,
                Font = Application.Fonts.TitleFont,
                LineBreakMode = UILineBreakMode.WordWrap,
                Lines = 0,
            };
            View.Add(NameText);

            Scroll = new UIScrollView(new CGRect(10, 205, 300, 265));
            View.Add(Scroll);

            DescriptionText = new UILabel(new CGRect(0, 0, 300, 235))
            {
                LineBreakMode = UILineBreakMode.WordWrap,
                Lines = 0,
            };
            Scroll.Add(DescriptionText);

            SeeCommentButton = new UIBarButtonItem(
                "Comments",
                UIBarButtonItemStyle.Plain,
                null);

            NavigationItem.SetRightBarButtonItem(SeeCommentButton, false);
        }
Ejemplo n.º 6
0
		private void SetupUserInterface ()
		{
			scrollView = new UIScrollView {
				BackgroundColor = UIColor.Clear.FromHexString ("#FAC05E", 1.0f),
				Frame = new CGRect (0, 0, Frame.Width, Frame.Height * 2)
			};

			photoGallery = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 30f),
				Frame = new CGRect (0, 10, Frame.Width, 35),
				Text = "Photo Gallery",
				TextAlignment = UITextAlignment.Center,
				TextColor = UIColor.White
			};

			imageViewOne = new UIImageView {
				Frame = new CGRect ((Bounds.Width - 256) / 2, 55, 256, 192),
				Image = UIImage.FromFile ("ImageTwo.jpg")
			};

			imageViewTwo = new UIImageView {
				Frame = new CGRect ((Bounds.Width - 256) / 2, 255, 256, 192),
				Image = UIImage.FromFile ("ImageThree.jpg")
			};

			imageViewThree = new UIImageView {
				Frame = new CGRect ((Bounds.Width - 256) / 2, 455, 256, 192),
				Image = UIImage.FromFile ("ImageOne.jpg")
			};

			scrollView.Add (photoGallery);
			scrollView.Add (imageViewOne);
			scrollView.Add (imageViewTwo);
			scrollView.Add (imageViewThree);

			Add (scrollView);
		}
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
			
            _rootViewController = UIApplication.SharedApplication.KeyWindow.RootViewController;

            scrollView = new UIScrollView(_windowBounds)
            {
                BackgroundColor = UIColor.Clear,
                Bounces = false,
                ShowsVerticalScrollIndicator = false,
                ShowsHorizontalScrollIndicator = false
            };
            
            blackMask.Add(scrollView);
            blackMask.BringSubviewToFront(btnDone);

            scrollView.Add(_imageView);
            scrollView.UserInteractionEnabled = true;
            scrollView.MultipleTouchEnabled = true;

            scrollView.DidZoom += (object sender, EventArgs e) =>
            {
                if (btnDone.Layer.Opacity == 1 && scrollView.ZoomScale > 1)
                {
                    HideDoneButton();
                }
                else if (scrollView.ZoomScale == 1 && btnDone.Layer.Opacity == 0)
                {
                    ShowDoneButton();
                }

                CenterScrollViewContents();
            };
            
            scrollView.ZoomingEnded += (object sender, ZoomingEndedEventArgs e) =>
            {
                _isAnimating = false;
            };
            scrollView.ViewForZoomingInScrollView += (UIScrollView sv) =>
            {
                return _imageView;
            };

            AddPanGestureToView(_imageView);
            AddMultipleGesture();

            btnDone.ImageEdgeInsets = new UIEdgeInsets(20, 20, 10, 10);
        }
Ejemplo n.º 8
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.BackgroundColor = UIColor.White;

            // Create and add subviews
            CGRect screenRect = new CGRect(window.Bounds.Location.X, window.Bounds.Location.Y,window.Bounds.Size.Width,window.Bounds.Size.Height);
            UIScrollView scrollView = new UIScrollView(screenRect);

            view = new HypnosisView(scrollView.Bounds);
            //view.Frame = new RectangleF(window.Bounds.Location.X, window.Bounds.Location.Y+23,window.Bounds.Size.Width,window.Bounds.Size.Height-23);
            //view.Frame = new RectangleF(window.Bounds.Location, window.Bounds.Size);
            //view.Frame = new RectangleF(window.Frame.Location, window.Frame.Size);
            scrollView.Add(view);

            BNRLogo logoView = new BNRLogo(new CGRect(0, 0, 100, 100));
            view.Add(logoView);

            CGSize svSize = scrollView.Bounds.Size;
            scrollView.ContentSize = svSize;
            scrollView.MinimumZoomScale = 1;
            scrollView.MaximumZoomScale = 5;
            //scrollView.PagingEnabled = true;

            scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => {return view;};

            bool success = view.BecomeFirstResponder();
            if (success) {
                Console.WriteLine("HypnosisView became the first responder");
            } else {
                Console.WriteLine("HypnosisView could not become the first responder");
            }

            // If you have defined a root view controller, set it here:
            viewController = new HypnosisViewController();
            viewController.View = scrollView;
            window.RootViewController = viewController;

            // make the window visible
            window.MakeKeyAndVisible();

            return true;
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			Title = "Terms of Service";

			scrollView = new UIScrollView {
				BackgroundColor = UIColor.Black,
				Frame = new CGRect (0, 0, 320, View.Bounds.Height * 3)
			};

			disclaimerView = new DisclaimerView (View.Bounds) {
				Frame = new CGRect (0, 0, View.Bounds.Width, View.Bounds.Height)
			};

			scrollView.Add (disclaimerView);

			View.Add (scrollView);
		}
Ejemplo n.º 10
0
        public ScrollingToolbarView(CGRect rect, IEnumerable<UIButton> buttons)
            : base(rect)
        {
            _buttons = buttons;
            this.AutosizesSubviews = true;
            _scrollView = new UIScrollView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));
            _scrollView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            _scrollView.UserInteractionEnabled = true;
            _scrollView.ExclusiveTouch = true;
            _scrollView.CanCancelContentTouches = true;
            _scrollView.DelaysContentTouches = true;
            _scrollView.ShowsHorizontalScrollIndicator = false;
            _scrollView.ShowsVerticalScrollIndicator = false;

            var line = new UIView(new CGRect(0, 0, rect.Width, 0.5f));
            line.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleBottomMargin;
            line.BackgroundColor = UIColor.DarkGray;
            Add(line);

            foreach (var button in buttons)
                _scrollView.Add(button);

            Add(_scrollView);
        }
Ejemplo n.º 11
0
		public KeyboardInputView (RectangleF frame)
			: base(frame)
		{
			_toolbar = new UIToolbar (frame);

			var toolbarItems = new UIBarButtonItem[] {
				new UIBarButtonItem (UIBarButtonSystemItem.Cancel, CancelButton_Tapped),
				new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace, null),
				new UIBarButtonItem (UIBarButtonSystemItem.Done, DoneButton_Tapped)
			};

			_toolbar.SetItems (toolbarItems, false);
			_toolbar.SizeToFit ();

			_title = new UILabel (RectangleF.Empty);
			_title.Font = UIFont.SystemFontOfSize (UIFont.LabelFontSize * 1.2f);
			_title.BackgroundColor = UIColor.Clear;
			_title.LineBreakMode = UILineBreakMode.TailTruncation;
			_title.Lines = 2;

			_description = new UILabel (RectangleF.Empty);
			_description.Font = UIFont.SystemFontOfSize (UIFont.LabelFontSize);
			_description.TextColor = UIColor.DarkTextColor.ColorWithAlpha (0.95f);
			_description.BackgroundColor = UIColor.Clear;
			_title.LineBreakMode = UILineBreakMode.TailTruncation;
			_description.Lines = 2;

			_textFieldContainer = new UIScrollView(new RectangleF(0, 0, 100, 100));

			_textField = new UITextField (_textFieldContainer.Bounds);
			_textField.AutoresizingMask =
				UIViewAutoresizing.FlexibleWidth |
				UIViewAutoresizing.FlexibleHeight;
			_textField.BorderStyle = UITextBorderStyle.RoundedRect;
			_textField.Delegate = new TextFieldDelegate (this);

			_textFieldContainer.Add (_textField);

			Add (_toolbar);
			Add (_title);
			Add (_description);
			Add (_textFieldContainer);

			AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
			AutosizesSubviews = false;
			Opaque = true;
			BackgroundColor = UIColor.FromRGB (0xC5, 0xCC, 0xD4);

			SetNeedsLayout ();
		}
Ejemplo n.º 12
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            //			TableView.Frame = new RectangleF (TableView.Frame.X,TableView.Frame.Y,TABLEVIEW_WIDTH,TableView.Frame.Size.Height);
            //			ScrollView.ContentSize = new SizeF (TABLEVIEW_WIDTH ,TableView.Frame.Height);
            //			ScrollView.BackgroundColor = UIColor.LightGray;
            //

            UITableView tableView = new UITableView (new RectangleF (new PointF (5,10), new SizeF (UIScreen.MainScreen.Bounds.Width,UIScreen.MainScreen.Bounds.Height)));
            UIScrollView scrollView = new UIScrollView (new RectangleF (new PointF (5,10), new SizeF (UIScreen.MainScreen.Bounds.Width,UIScreen.MainScreen.Bounds.Height)));
            tableView.Source = new TreeViewSource (scrollView);
            scrollView.Add (tableView);
            this.View.Add (scrollView);
            this.View.BackgroundColor = UIColor.White;

            var Source = new TreeViewSource (scrollView);

            tableView.Source = Source;
        }
Ejemplo n.º 13
0
        protected override void SetupUserInterface()
        {
            EdgesForExtendedLayout = UIRectEdge.None;

            View = scrollView =
                new UIScrollView(RectangleF.Empty)
            {
                BackgroundColor = MobileCore.Values.Colors.LightGray.ToNative(),
                ShowsHorizontalScrollIndicator = false,
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth,
                TranslatesAutoresizingMaskIntoConstraints = true
            };

            passwordManagement = new UIButton(UIButtonType.DetailDisclosure);
            passwordManagement.SetTitle(MobileCore.Values.Strings.Settings_PasswordManagement, UIControlState.Normal);
            scrollView.Add(passwordManagement);

            myProfile = new UIButton(UIButtonType.DetailDisclosure);
            myProfile.SetTitle(MobileCore.Values.Strings.Settings_MyProfile, UIControlState.Normal);
            scrollView.Add(myProfile);

            myRates = new UIButton(UIButtonType.DetailDisclosure);
            myRates.SetTitle(MobileCore.Values.Strings.Settings_Rates, UIControlState.Normal);
            scrollView.Add(myRates);

            billing = new UIButton(UIButtonType.DetailDisclosure);
            billing.SetTitle(MobileCore.Values.Strings.Settings_Billing, UIControlState.Normal);
            scrollView.Add(billing);

            inviteUsers = new UIButton(UIButtonType.DetailDisclosure);
            inviteUsers.SetTitle(MobileCore.Values.Strings.Settings_AddUsers, UIControlState.Normal);
            scrollView.Add(inviteUsers);

            scrollView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            View.AddConstraints(

                passwordManagement.AtTopOf(scrollView, Constants.Layout.VerticalPadding),
                passwordManagement.AtLeftOf(scrollView, Constants.Layout.HorizontalPadding),
                passwordManagement.WithSameWidth(scrollView)
                .Minus(Constants.Layout.HorizontalPadding * 2),

                myProfile.WithSameWidth(scrollView)
                .Minus(Constants.Layout.HorizontalPadding * 2),
                myProfile.Below(passwordManagement, Constants.Layout.VerticalPadding),
                myProfile.AtLeftOf(scrollView, Constants.Layout.HorizontalPadding),

                myRates.WithSameWidth(scrollView)
                .Minus(Constants.Layout.HorizontalPadding * 2),
                myRates.Below(myProfile, Constants.Layout.VerticalPadding),
                myRates.AtLeftOf(scrollView, Constants.Layout.HorizontalPadding),

                billing.WithSameWidth(scrollView)
                .Minus(Constants.Layout.HorizontalPadding * 2),
                billing.Below(myRates, Constants.Layout.VerticalPadding),
                billing.AtLeftOf(scrollView, Constants.Layout.HorizontalPadding),

                inviteUsers.WithSameWidth(scrollView)
                .Minus(Constants.Layout.HorizontalPadding * 2),
                inviteUsers.Below(billing, Constants.Layout.VerticalPadding),
                inviteUsers.AtLeftOf(scrollView, Constants.Layout.HorizontalPadding),
                inviteUsers.Bottom()
                .EqualTo()
                .BottomOf(scrollView)
                .Minus(Constants.Layout.VerticalPadding)
                );
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            View.BackgroundColor = UIColor.FromRGB (75, 75, 75);

            var HeaderView = new UIView (new CGRect (0, 0, Width, 63)) {
                BackgroundColor = UIColor.White
            };

            var menuImage = new UIImageView (new CGRect (10, 20, 30, 30));
            menuImage.Image = new UIImage ("menu_icon.png");

            var title = new UILabel (new CGRect (X_Margin, 15, Width, 40)) {

                Font = UIFont.SystemFontOfSize (15.0f),
                TextAlignment = UITextAlignment.Left,
                TextColor = UIColor.DarkGray,
                Text = "John Anderson",
            };

            HeaderView.Add (title);
            //HeaderView.Add (menuImage);
            arrowIcon = new UIImageView ();
            arrowIcon.Image = new UIImage ("arrow_icon.png");

            var conversationsButton = new UIButton (UIButtonType.System);
            conversationsButton.Frame = new CGRect (0, 63, Width + X_Margin, btnHeight);
            conversationsButton.SetTitle ("Conversations", UIControlState.Normal);
            conversationsButton.ContentEdgeInsets = new UIEdgeInsets (0, X_Margin, 0, 0);
            conversationsButton.SetTitleColor (UIColor.White, UIControlState.Normal);
            conversationsButton.Font = UIFont.BoldSystemFontOfSize (15);
            conversationsButton.BackgroundColor = UIColor.FromRGB (99, 99, 99);
            conversationsButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            conversationsButton.TouchUpInside += (sender, e) => {
                arrowIcon.Frame = new CGRect (Width - 50, conversationsButton.Frame.Y + 15, 25, 25);
                //SidebarController.ChangeContentView (new TSConversationVC());
                NavController.PushViewController (new TSConversationView (), true);
                SidebarController.CloseMenu ();
            };

            var ContactsButton = new UIButton (UIButtonType.System);
            ContactsButton.Frame = new CGRect (0, conversationsButton.Frame.Y + conversationsButton.Frame.Height + 5, Width + X_Margin, btnHeight);
            ContactsButton.SetTitle ("Contacts", UIControlState.Normal);
            ContactsButton.ContentEdgeInsets = new UIEdgeInsets (0, X_Margin, 0, 0);
            ContactsButton.SetTitleColor (UIColor.White, UIControlState.Normal);
            ContactsButton.Font = UIFont.BoldSystemFontOfSize (15);
            ContactsButton.BackgroundColor = UIColor.FromRGB (99, 99, 99);
            ContactsButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            ContactsButton.TouchUpInside += (sender, e) => {
                //	newsButton.BackgroundColor = UIColor.LightGray;
                //	SidebarController.ChangeContentView (new IntroController ());
            };

            var settingsButton = new UIButton (UIButtonType.System);
            settingsButton.Frame = new CGRect (0, ContactsButton.Frame.Y + ContactsButton.Frame.Height + 5, Width + X_Margin, btnHeight);
            settingsButton.SetTitle ("Settings", UIControlState.Normal);
            settingsButton.BackgroundColor = UIColor.FromRGB (99, 99, 99);
            settingsButton.ContentEdgeInsets = new UIEdgeInsets (0, X_Margin, 0, 0);
            settingsButton.SetTitleColor (UIColor.White, UIControlState.Normal);
            settingsButton.Font = UIFont.BoldSystemFontOfSize (15);
            settingsButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            arrowIcon.Frame = new CGRect (Width - 50, settingsButton.Frame.Y + 15, 25, 25);

            settingsButton.TouchUpInside += (sender, e) => {
                NavController.PopToRootViewController (false);
                arrowIcon.Frame = new CGRect (Width - 50, settingsButton.Frame.Y + 15, 25, 25);
                SidebarController.CloseMenu ();
            };

            var reportingButton = new UIButton (UIButtonType.System);
            reportingButton.Frame = new CGRect (0, settingsButton.Frame.Y + settingsButton.Frame.Height + 5, Width + X_Margin, btnHeight);
            reportingButton.SetTitle ("Reporting", UIControlState.Normal);
            reportingButton.BackgroundColor = UIColor.FromRGB (99, 99, 99);
            reportingButton.ContentEdgeInsets = new UIEdgeInsets (0, X_Margin, 0, 0);
            reportingButton.SetTitleColor (UIColor.White, UIControlState.Normal);
            reportingButton.Font = UIFont.BoldSystemFontOfSize (15);
            reportingButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            reportingButton.TouchUpInside += (sender, e) => {
                //intheaterButton.BackgroundColor = UIColor.LightGray;
                //SidebarController.ChangeContentView (new IntroController ());
            };

            var AutoBytleIcon = new UIImageView (new CGRect (30, reportingButton.Frame.Y + reportingButton.Frame.Height + 20, 150, 40));
            AutoBytleIcon.Image = new UIImage ("autobytle.PNG");

            var scroll = new UIScrollView (new CGRect (0, 0, Width, 360));
            scroll.ContentSize = new CGSize (Width, 360);
            View.Add (scroll);
            scroll.Add (conversationsButton);
            scroll.Add (ContactsButton);
            scroll.Add (settingsButton);
            scroll.Add (arrowIcon);
            scroll.Add (reportingButton);
            scroll.Add (HeaderView);
            scroll.Add (AutoBytleIcon);
        }
Ejemplo n.º 15
0
        public override void Scrolled(UIScrollView scrollView)
        {
            if (scrollView.Dragging && _controller.HasMorePages && _controller.EnableInfinitePaging)
                {
                    float threshold = scrollView.ContentSize.Height - scrollView.Bounds.Height;
                    if (scrollView.ContentOffset.Y > threshold - 160 && !_controller._pagingActionInProgress)
                    {
                        Console.WriteLine("starting infinite loading");
                        _controller._pagingActionInProgress = true;

                        var existingInset = scrollView.ContentInset;
                        float bottom = existingInset.Bottom;
                        existingInset.Bottom += 60;
                        scrollView.ContentInset = existingInset;

                        var view = new UIView(new RectangleF(0, scrollView.ContentSize.Height, scrollView.Bounds.Width, 60));
                        scrollView.Add(view);

                        var indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
                        indicator.Center = new PointF(view.Bounds.Width / 2, view.Bounds.Height / 2);
                        indicator.HidesWhenStopped = true;
                        indicator.StartAnimating();
                        view.Add(indicator);

                        _controller._tableView.BeginUpdates();
                        int position = _controller._items[0].Item2.Count;

                        _controller.InfinitePagingAction(addedCount => {
                            Console.WriteLine ("inside infinite paging action");
                            indicator.StopAnimating();
                            view.RemoveFromSuperview();
                            var ex = scrollView.ContentInset;
                            ex.Bottom = bottom;
                            scrollView.ContentInset = ex;

                            _controller._tableView.InsertRows(Enumerable.Range(position, addedCount).Select(r => NSIndexPath.FromRowSection(r, _controller.PagingSectionIndex)).ToArray(), UITableViewRowAnimation.Fade);
                            _controller._tableView.EndUpdates();

                            NSTimer.CreateScheduledTimer(1, delegate {
                                _controller._pagingActionInProgress = false;
                            });
                        });
                    }
                }
        }
        public override void LoadView ()
        {
            var scrollView = new UIScrollView ().Apply (Style.Screen);

            scrollView.Add (wrapper = new UIView () {
                TranslatesAutoresizingMaskIntoConstraints = false,
            });

            wrapper.Add (startStopView = new StartStopView () {
                TranslatesAutoresizingMaskIntoConstraints = false,
                StartTime = model.StartTime,
                StopTime = model.StopTime,
            }.Apply (BindStartStopView));
            startStopView.SelectedChanged += OnStartStopViewSelectedChanged;

            wrapper.Add (datePicker = new UIDatePicker () {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Hidden = DatePickerHidden,
                Alpha = 0,
            }.Apply (Style.EditTimeEntry.DatePicker).Apply (BindDatePicker));
            datePicker.ValueChanged += OnDatePickerValueChanged;

            wrapper.Add (projectButton = new ProjectClientTaskButton () {
                TranslatesAutoresizingMaskIntoConstraints = false,
            }.Apply (BindProjectButton));
            projectButton.TouchUpInside += OnProjectButtonTouchUpInside;

            wrapper.Add (descriptionTextField = new TextField () {
                TranslatesAutoresizingMaskIntoConstraints = false,
                AttributedPlaceholder = new NSAttributedString (
                    "EditEntryDesciptionTimerHint".Tr (),
                    foregroundColor: Color.Gray
                ),
                ShouldReturn = (tf) => tf.ResignFirstResponder (),
            }.Apply (Style.EditTimeEntry.DescriptionField).Apply (BindDescriptionField));
            descriptionTextField.EditingChanged += OnDescriptionFieldEditingChanged;
            descriptionTextField.EditingDidEnd += (s, e) => CommitDescriptionChanges ();

            wrapper.Add (tagsButton = new UIButton () {
                TranslatesAutoresizingMaskIntoConstraints = false,
            }.Apply (Style.EditTimeEntry.TagsButton).Apply (BindTagsButton));
            tagsButton.TouchUpInside += OnTagsButtonTouchUpInside;

            wrapper.Add (billableSwitch = new LabelSwitchView () {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Text = "EditEntryBillable".Tr (),
            }.Apply (Style.EditTimeEntry.BillableContainer).Apply (BindBillableSwitch));
            billableSwitch.Label.Apply (Style.EditTimeEntry.BillableLabel);
            billableSwitch.Switch.ValueChanged += OnBillableSwitchValueChanged;

            wrapper.Add (deleteButton = new UIButton () {
                TranslatesAutoresizingMaskIntoConstraints = false,
            }.Apply (Style.EditTimeEntry.DeleteButton));
            deleteButton.SetTitle ("EditEntryDelete".Tr (), UIControlState.Normal);
            deleteButton.TouchUpInside += OnDeleteButtonTouchUpInside;

            wrapper.AddConstraints (VerticalLinearLayout (wrapper));
            scrollView.AddConstraints (
                wrapper.AtTopOf (scrollView),
                wrapper.AtBottomOf (scrollView),
                wrapper.AtLeftOf (scrollView),
                wrapper.AtRightOf (scrollView),
                wrapper.WithSameWidth (scrollView),
                wrapper.Height ().GreaterThanOrEqualTo ().HeightOf (scrollView).Minus (64f),
                null
            );

            View = scrollView;
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			View.BackgroundColor = UIColor.White;

			TextInfo textInfo = new CultureInfo("en-US", false).TextInfo;
			part.PartName.ToLower ();

			var scrollView = new UIScrollView {
				Frame = new CGRect (0, 0, 320, View.Frame.Height * 1.5)
			} ;

			var partNameLabel = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 25f),
				Frame = new CGRect (20, 5, View.Bounds.Width, 30),
				Text = textInfo.ToTitleCase (part.PartName.ToLower ())
			} ;

			var partMakeLabel = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 23f),
				Frame = new CGRect (20, 35, View.Bounds.Width, 25),
				Text = partString
			};

			var priceLabel = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 24f),
				Frame = new CGRect (View.Bounds.Width - 80, 17.5, 70, 30),
				Text = string.Format ("${0}", part.Price),
				TextAlignment = UITextAlignment.Right
			} ;

			var williesGuarentee = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 15f),
				Frame = new CGRect (0, 65, View.Bounds.Width, 20),
				Text = "Willie's Guarentee",
				TextAlignment = UITextAlignment.Center
			} ;

			var guarenteeOne = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 11f),
				Frame = new CGRect (20, 85, View.Bounds.Width - 40, 50),
				Lines = 10,
				Text = "Why go anywhere else? With over 10 million satisified customers in more than 28 years, Willie’s is your best bet for the quality part you are looking for."
			} ;

			var guarenteeTwo = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 11f),
				Frame = new CGRect (20, 140, View.Bounds.Width - 40, 50),
				Lines = 5,
				Text = "Willie’s ships parts daily to many satisified customers. We can ship international, next day air, two day air, three day select, and to post office boxes."
			} ;

			var guarenteeThree = new UILabel {
				Font = UIFont.FromName ("SegoeUI-Light", 11f),
				Frame = new CGRect (20, 205, View.Bounds.Width - 40, 50),
				Lines = 5,
				Text = "We give full refunds or exchange on parts arriving defective and will accept returns on incorrect parts. We do have a restock fee of only 20% if you misorder a part."
			} ;

			var contactButton = new ContactUsButton {
				Frame = new CGRect (40, 260, View.Bounds.Width - 80, 40)
			} ;
			contactButton.SetTitle ("Contact Us", UIControlState.Normal);
			contactButton.SetTitleColor (UIColor.White, UIControlState.Normal);

			contactButton.TouchUpInside += CancelButtonTapped;

			var payButton = new SearchButton {
				Frame = new CGRect (40, 310, View.Bounds.Width - 80, 40)
			} ;
			payButton.SetTitle ("Buy Part", UIControlState.Normal);
			payButton.SetTitleColor (UIColor.White, UIControlState.Normal);
			payButton.TouchUpInside += PaymentButtonTapped;

			var payText = new UILabel {
				Frame = new CGRect (40, 350, View.Bounds.Width - 80, 50),
				Text = "By purchasing part(s) from Willie's Cycles, you agree to the Terms of Service (tap to view).",
				Font = UIFont.FromName ("SegoeUI-Light", 12f),
				Lines = 5,
				TextAlignment = UITextAlignment.Center,
				UserInteractionEnabled = true
			};

			payTextTouched = new UITapGestureRecognizer (PayTextTapped) {
				NumberOfTapsRequired = 1
			};
			payText.AddGestureRecognizer (payTextTouched);

			scrollView.Add (partNameLabel);
			scrollView.Add (priceLabel);
			scrollView.Add (partMakeLabel);
			scrollView.Add (williesGuarentee);
			scrollView.Add (guarenteeOne);
			scrollView.Add (guarenteeTwo);
			scrollView.Add (guarenteeThree);
			scrollView.Add (contactButton);
			scrollView.Add (payButton);
			scrollView.Add (payText);
			scrollView.ContentSize = new CGSize (View.Frame.Width, View.Frame.Height * 1.25);

			View.Add (scrollView);
		}
Ejemplo n.º 18
0
        private void SetupUI()
        {
            View.BackgroundColor = UIColor.White;

            scrollView = new UIScrollView {
                BackgroundColor = UIColor.Clear,
                Frame = new RectangleF (0, 0, View.Bounds.Width, View.Bounds.Height),
                PagingEnabled = false,
                ScrollEnabled = true
            };
            View.Add (scrollView);

            contentArea = new UILabel {
                BackgroundColor = UIColor.Clear,
                Font = FontConstants.SourceSansProRegular (15),
                Frame = new RectangleF (14f, 35f, 294f, 10f),
                LineBreakMode = UILineBreakMode.TailTruncation,
                Lines = 0,
                Text = verse.Content,
                TextAlignment = UITextAlignment.Left
            };
            scrollView.Add (contentArea);
            contentArea.Frame = new RectangleF (14f, 35f, 294f,
                InterfaceHelper.ContentSize (contentArea.Text, contentArea.Frame.Width, contentArea.Font));

            var height = contentArea.Bounds.Height + 45f;
            blackLine = new UIView {
                BackgroundColor = UIColor.FromPatternImage (UIImage.FromFile (Images.BlackLine)),
                Frame = new RectangleF (24, height, 284f, 1f)
            };
            scrollView.Add (blackLine);

            height = contentArea.Frame.Height + blackLine.Frame.Height + 50f;
            commentsArea = new UILabel {
                BackgroundColor = UIColor.Clear,
                Font = FontConstants.SourceSansProRegular (15),
                Frame = new RectangleF (14f, height, 294f, 10f),
                LineBreakMode = UILineBreakMode.TailTruncation,
                Lines = 0,
                Text = verse.Comments,
                TextAlignment = UITextAlignment.Left
            };
            scrollView.Add (commentsArea);

            if (verse.Comments.Length != 0) {
                commentsArea.Frame = new RectangleF (14f, height, 294f,
                    InterfaceHelper.ContentSize (commentsArea.Text, contentArea.Frame.Width, contentArea.Font));
            } else {
                commentsArea.Hidden = true;
                blackLine.Hidden = true;
            }

                    height = contentArea.Bounds.Height + 45;
            shareButton = new UIButton {
                Frame = new RectangleF (33.5f, height, 253f, 33f)
            };
            shareButton.SetBackgroundImage (UIImage.FromFile (Images.ShareButton), UIControlState.Normal);

            copyrightButton = new UIButton {
                Enabled = true,
                Frame = new RectangleF (282, 5, 25, 25),
                UserInteractionEnabled = true
            };
            copyrightButton.SetBackgroundImage (UIImage.FromFile (Images.CopyrightButton), UIControlState.Normal);

            scrollView.Add (shareButton);
            scrollView.Add (copyrightButton);

                    var contentSize = shareButton.Frame.Y + 170;
            scrollView.ContentSize = new SizeF (320f, contentSize);
        }
Ejemplo n.º 19
0
        public RaffleListScreenView(RaffleListScreenController RaffleListScreenController,List<Tap5050Event> eventlist,List<UIImage> eventImageList)
        {
            BackgroundColor = UIColor.FromRGB (235, 235, 235);
            //basic info GUI**************************************************
            confirmedBtn=UIButton.FromType(UIButtonType.RoundedRect);
            confirmedBtn.BackgroundColor = UIColor.Clear;
            confirmedBtn.SetTitle (RaffleListScreenData.TableViewFirstHeaderText, UIControlState.Normal);
            confirmedBtn.SetTitleColor (UIColor.Black, UIControlState.Normal);
            Add(confirmedBtn);

            PotentialBtn=UIButton.FromType(UIButtonType.RoundedRect);
            PotentialBtn.BackgroundColor = UIColor.Clear;
            PotentialBtn.SetTitle (RaffleListScreenData.TableViewSecondHeaderText, UIControlState.Normal);
            PotentialBtn.SetTitleColor (UIColor.Black, UIControlState.Normal);
            Add(PotentialBtn);

            ConfirmedBarView= new UIView () {
                BackgroundColor=UIColor.FromRGB (245, 245, 245),
            };
            Add (ConfirmedBarView);
            PotentialBarView= new UIView () {
                BackgroundColor=UIColor.FromRGB (245, 245, 245),
            };
            Add (PotentialBarView);

            RaffleListTableView = new UITableView ()
            {
                Source=new RaffleListSource(RaffleListScreenController),
                SeparatorColor=UIColor.Clear,
                BackgroundColor=UIColor.Clear,
            };
            Add (RaffleListTableView);

            LocationLabel= new UILabel ()
            {
                Text=RaffleListScreenData.LocationLabelText,
                TextAlignment=UITextAlignment.Left,
                TextColor = UIColor.Gray,
                BackgroundColor=UIColor.Clear,
            };
            Add(LocationLabel);

            //***************************************************************
            ScrollView = new UIScrollView () {
                BackgroundColor=UIColor.White,
            };
            Add (ScrollView);

            noRaffleTextLable= new UITextView ()
            {
                Text=RaffleListScreenData.NoRaffleText,
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                Editable=false,
                BackgroundColor=UIColor.Clear,
                ScrollEnabled=false
            };
            ScrollView.Add(noRaffleTextLable);

            organizationNameTextField= new UITextField( )
            {
                Placeholder = RaffleListScreenData.organizationNameTextFieldPlaceholder,
                Text = "",
                ClearButtonMode=UITextFieldViewMode.Always,
                KeyboardType=UIKeyboardType.Default,
                ReturnKeyType=UIReturnKeyType.Done,
                TextColor = UIColor.Black,
                BackgroundColor = UIColor.Clear,
                BorderStyle = UITextBorderStyle.RoundedRect,
                Enabled = true,
            };
            organizationNameTextField.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                return true;
            };
            ScrollView.Add(organizationNameTextField);

            phoneNumberTextField= new UITextField( )
            {
                Placeholder = RaffleListScreenData.phoneNumberTextFieldPlaceholder,
                Text = "",
                ClearButtonMode=UITextFieldViewMode.Always,
                KeyboardType=UIKeyboardType.Default,
                ReturnKeyType=UIReturnKeyType.Done,
                TextColor = UIColor.Black,
                BackgroundColor = UIColor.Clear,
                BorderStyle = UITextBorderStyle.RoundedRect,
                Enabled = true,
            };
            phoneNumberTextField.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                return true;
            };
            ScrollView.Add(phoneNumberTextField);

            sentBtn =new CustomBtn();
            sentBtn.SetTitle (RaffleListScreenData.sentBtnTitle, UIControlState.Normal);
            sentBtn.SetTitleColor (UIColor.White, UIControlState.Normal);
            ScrollView.Add(sentBtn);

            //move the view when the keyboard is up
            NSNotificationCenter.DefaultCenter.AddObserver
            (UIKeyboard.DidShowNotification,KeyBoardUpNotification);

            Rotate ();
        }
Ejemplo n.º 20
0
        internal void CreateEditor()
        {
            ButtonCancel        = new UIButton();
            ButtonSave          = new UIButton();
            LabelSubject        = new UITextView();
            LabelLocation       = new UITextView();
            LabelEnds           = new UILabel();
            LabelStarts         = new UILabel();
            ButtonStartDate     = new UIButton();
            ButtonEndDate       = new UIButton();
            StartTimeZoneLabel  = new UILabel();
            EndTimeZoneLabel    = new UILabel();
            StartTimeZoneButton = new UIButton();
            EndTimeZoneButton   = new UIButton();
            PickerStartDate     = new UIDatePicker();
            PickerEndDate       = new UIDatePicker();
            DoneButton          = new UIButton();
            ScrollView          = new UIScrollView();
            StartTimeZonePicker = new UIPickerView();
            EndTimeZonePicker   = new UIPickerView();
            AllDaySwitch        = new UISwitch();
            AllDaylabel         = new UILabel();

            ScrollView.BackgroundColor = UIColor.White;

            LabelSubject.Font        = UIFont.SystemFontOfSize(14);
            LabelLocation.Font       = UIFont.SystemFontOfSize(14);
            LabelStarts.Font         = UIFont.SystemFontOfSize(15);
            LabelEnds.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);
            ButtonStartDate.Font     = UIFont.SystemFontOfSize(15);
            ButtonEndDate.Font       = UIFont.SystemFontOfSize(15);

            ButtonCancel.BackgroundColor = UIColor.FromRGB(229, 229, 229);
            ButtonCancel.Font            = UIFont.SystemFontOfSize(15);
            ButtonSave.Font                    = UIFont.SystemFontOfSize(15);
            ButtonSave.BackgroundColor         = UIColor.FromRGB(33, 150, 243);
            ButtonCancel.Layer.CornerRadius    = 6;
            ButtonSave.Layer.CornerRadius      = 6;
            ButtonStartDate.Layer.CornerRadius = 6;
            ButtonEndDate.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;
                DoneButton.Hidden          = false;

                AllDaylabel.Hidden       = true;
                AllDaySwitch.Hidden      = true;
                ButtonCancel.Hidden      = true;
                ButtonSave.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;
                DoneButton.Hidden        = false;
                AllDaylabel.Hidden       = true;
                AllDaySwitch.Hidden      = true;
                ButtonCancel.Hidden      = true;
                ButtonSave.Hidden        = true;
                EndTimeZoneLabel.Hidden  = true;
                EndTimeZoneButton.Hidden = true;
                Editor.EndEditing(true);
            };

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

            //save button
            ButtonSave.SetTitle("Save", UIControlState.Normal);
            ButtonSave.SetTitleColor(UIColor.White, UIControlState.Normal);
            ButtonSave.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)LabelSubject.Text;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].Location  = (NSString)LabelLocation.Text;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].StartTime = PickerStartDate.Date;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].EndTime   = PickerEndDate.Date;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].IsAllDay  = AllDaySwitch.On;
                }
                else
                {
                    ScheduleAppointment appointment = new ScheduleAppointment();
                    appointment.Subject               = (NSString)LabelSubject.Text;
                    appointment.Location              = (NSString)LabelLocation.Text;
                    appointment.StartTime             = PickerStartDate.Date;
                    appointment.EndTime               = PickerEndDate.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
            LabelSubject.TextColor          = UIColor.Black;
            LabelSubject.TextAlignment      = UITextAlignment.Left;
            LabelSubject.Layer.CornerRadius = 8;
            LabelSubject.Layer.BorderWidth  = 2;
            LabelSubject.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;

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

            //starts time
            LabelStarts.Text      = "Start Time";
            LabelStarts.TextColor = UIColor.Black;

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

                AllDaylabel.Hidden       = true;
                AllDaySwitch.Hidden      = true;
                ButtonCancel.Hidden      = true;
                ButtonSave.Hidden        = true;
                EndTimeZoneLabel.Hidden  = true;
                EndTimeZoneButton.Hidden = true;
                Editor.EndEditing(true);
            };

            //end time
            LabelEnds.Text      = "End Time";
            LabelEnds.TextColor = UIColor.Black;

            //end date
            ButtonEndDate.SetTitle("End time", UIControlState.Normal);
            ButtonEndDate.SetTitleColor(UIColor.Black, UIControlState.Normal);
            ButtonEndDate.Layer.BorderWidth   = 2;
            ButtonEndDate.Layer.CornerRadius  = 4;
            ButtonEndDate.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;
            ButtonEndDate.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            ButtonEndDate.TouchUpInside      += (object sender, EventArgs e) =>
            {
                PickerEndDate.Hidden     = false;
                DoneButton.Hidden        = false;
                AllDaylabel.Hidden       = true;
                AllDaySwitch.Hidden      = true;
                ButtonCancel.Hidden      = true;
                ButtonSave.Hidden        = true;
                EndTimeZoneLabel.Hidden  = true;
                EndTimeZoneButton.Hidden = true;

                Editor.EndEditing(true);
            };

            //date and time pickers
            PickerStartDate.Hidden     = true;
            PickerEndDate.Hidden       = true;
            StartTimeZonePicker.Hidden = true;
            EndTimeZonePicker.Hidden   = true;
            DoneButton.Hidden          = true;

            //done button
            DoneButton.SetTitle("Done", UIControlState.Normal);
            DoneButton.SetTitleColor(UIColor.Blue, UIControlState.Normal);
            DoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            DoneButton.TouchUpInside      += (object sender, EventArgs e) =>
            {
                PickerStartDate.Hidden     = true;
                PickerEndDate.Hidden       = true;
                StartTimeZonePicker.Hidden = true;
                EndTimeZonePicker.Hidden   = true;
                DoneButton.Hidden          = true;

                LabelEnds.Hidden           = false;
                ButtonEndDate.Hidden       = false;
                ButtonStartDate.Hidden     = false;
                LabelStarts.Hidden         = false;
                EndTimeZoneLabel.Hidden    = false;
                StartTimeZoneLabel.Hidden  = false;
                AllDaylabel.Hidden         = false;
                AllDaySwitch.Hidden        = false;
                StartTimeZoneButton.Hidden = false;
                EndTimeZoneButton.Hidden   = false;
                ButtonCancel.Hidden        = false;
                ButtonSave.Hidden          = false;

                String _sDate = DateTime.Parse(PickerStartDate.Date.ToString()).ToString();
                ButtonStartDate.SetTitle(_sDate, UIControlState.Normal);

                String _eDate = DateTime.Parse(PickerEndDate.Date.ToString()).ToString();
                ButtonEndDate.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(LabelSubject);
            ScrollView.Add(LabelLocation);
            ScrollView.Add(LabelStarts);
            ScrollView.Add(ButtonStartDate);
            ScrollView.Add(StartTimeZoneLabel);
            ScrollView.Add(StartTimeZoneButton);
            ScrollView.Add(LabelEnds);
            ScrollView.Add(ButtonEndDate);
            ScrollView.Add(EndTimeZoneLabel);
            ScrollView.Add(EndTimeZoneButton);
            ScrollView.Add(StartTimeZonePicker);
            ScrollView.Add(EndTimeZonePicker);
            ScrollView.Add(PickerEndDate);
            ScrollView.Add(PickerStartDate);
            ScrollView.Add(DoneButton);
            ScrollView.Add(AllDaylabel);
            ScrollView.Add(AllDaySwitch);
            ScrollView.Add(ButtonCancel);
            ScrollView.Add(ButtonSave);

            Editor.Add(ScrollView);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Initializes all the parts and controls of the parallaxing screen.
        /// </summary>
        /// <param name="background"></param>
        void Initialize()
        {
            // Set up the parallax.
            parallaxScrollView = new UIScrollView(this.Frame);

            // Set the default scroll height for the frame.
            // This is the offset where the content goes when it's snapped to the top.
            defaultScrollOffset = this.Frame.Height - 130 - 60 - 40;

            // Set up our darkening layer.
            darkerLayer = new UIView(this.Frame);
            darkerLayer.BackgroundColor = UIColor.Black;
            darkerLayer.Alpha           = 0;

            // Set up our scrolling.
            scrollView = new Views.FadingScrollView(this.Frame)
            {
                ShowsHorizontalScrollIndicator = false,
                ShowsVerticalScrollIndicator   = false,
                DecelerationRate = UIScrollView.DecelerationRateNormal
            };

            // Add some events to handle the scrolling.
            scrollView.Scrolled          += ScrollViewDidScroll;
            scrollView.DraggingEnded     += ScrollViewDraggingEnded;
            scrollView.DecelerationEnded += ScrollViewDecelerationEnded;

            // Makes sure that a tap scrolls the view up a bit.
            var tap = new UITapGestureRecognizer();

            tap.AddTarget(() => { if (scrollView.ContentOffset.Y == 0)
                                  {
                                      ScrollTo(0, defaultScrollOffset);
                                  }
                          });
            scrollView.AddGestureRecognizer(tap);

            // Setup the picture frame. We make it higher then the view is due to parallax.
            RectangleF frame = this.Frame;

            frame.Size = new SizeF(frame.Width, frame.Height + frame.Height / parallaxSpeedRatio);

            // Set up the pictures.
            backgroundPhoto = new UIImageView(frame)
            {
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight,
                ContentMode      = UIViewContentMode.ScaleAspectFill
            };

            backgroundPhotoWithImageEffects = new UIImageView(frame)
            {
                ContentMode      = UIViewContentMode.ScaleAspectFill,
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight,
                Alpha            = 0
            };

            // Create the header.
            header           = new ParallaxBlurHeaderView(new RectangleF(0, 0, 320, 50));
            header.OnTapped += HeaderOnTapped;

            // Add our items to the view.
            parallaxScrollView.Add(backgroundPhoto);
            parallaxScrollView.Add(backgroundPhotoWithImageEffects);

            // Do the actual cross dissolve effect.
            CrossDissolvePhotos(backgroundPhoto.Image, backgroundPhotoWithImageEffects.Image);

            // Add our elements to the view.
            this.Add(parallaxScrollView);
            this.Add(darkerLayer);
            this.Add(scrollView);
            this.Add(header);
        }
Ejemplo n.º 22
0
        void InitSubviews()
        {
            scrollView = new UIScrollView (View.Bounds) {
                BackgroundColor = UIColor.Clear,
                AutoresizingMask = UIViewAutoresizing.All,
                ContentSize = View.Bounds.Size
            };

            progressBar = new PopoverProgressBar (new RectangleF (10, 30, 292, 28));
            progressBar.Progress = 0.5f;
            progressBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;

            scrollView.Add (progressBar);

            var label = new UILabel (new RectangleF (10, 70, 292, 28)) {
                Text = "Move slider below to see progress",

                //Font = UIFont.SystemFontOfSize (14),
                BackgroundColor = UIColor.Clear,
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth
            };

            scrollView.Add (label);

            slider = new UISlider (new RectangleF (10, 110, 292, 28)) {
                MaxValue = 1,
                MinValue = 0,
                Value = 0.5f,
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth
            };

            slider.ValueChanged += OnValueChanged;

            // Applies theme styles on specified element
            ProlificTheme.Apply (slider);

            scrollView.Add (slider);

            var segments = new List<object> (3) { "Featured", "Top Charts", "Categories" };

            var segmentControl = new SegmentedControl (segments) {
                Frame = new RectangleF (10, 140, 292, 44),
                SelectedIndex = 1,
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth
            };

            scrollView.Add (segmentControl);

            var switchControl = new SwitchOnOff (new RectangleF (120, 230, 80, 27));
            switchControl.SetState (true, false);
            switchControl.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;

            scrollView.Add (switchControl);

            var textField = new UITextField (new RectangleF (10, 300, 292, 31)) {
                LeftView = new UIView (new RectangleF (0, 0, 5, 20)),
                LeftViewMode = UITextFieldViewMode.Always,
                Text = "Type your text!",
                TextColor = UIColor.DarkGray,
                VerticalAlignment = UIControlContentVerticalAlignment.Center,
                Background = ProlificTheme.SharedTheme.TextFielBackground,
                Delegate = new TextFieldDelegate (),
                Font = UIFont.SystemFontOfSize (14),
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth
                //this.textField.text = "";

            };

            scrollView.Add (textField);

            InitLabels ();

            View.Add (scrollView);

            base.ViewDidLoad ();
        }
Ejemplo n.º 23
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            //pull movie lists from api
            await GetMovies();

            double xOffset = 0, yOffset = 50;
            double xPadding = 10, yPadding = 10;
            double posterWidth  = AppDelegate.ScreenWidth / 3 - 2 * xPadding;
            double posterHeight = AppDelegate.ScreenHeight / 3 - 2 * yPadding - 25;

            //vertical scroll to hold multiple rows of movies
            var verticalScroll = new UIScrollView(new CGRect(0, 0, AppDelegate.ScreenWidth, AppDelegate.ScreenHeight));

            verticalScroll.ContentSize             = new CGSize(AppDelegate.ScreenWidth, posterHeight * APIUrls.Count);
            verticalScroll.CanCancelContentTouches = false;

            int headerIndex = 0;

            foreach (MovieListResponse response in Movies)
            {
                //layout each row of movies
                var rowLabel = new UILabel(new CGRect(10, yOffset - 20, AppDelegate.ScreenWidth - 30, 25));
                rowLabel.Text      = Strings.MasterHeaders[headerIndex]; headerIndex++;
                rowLabel.Font      = UIFont.FromName("Arial-BoldMT", 16);
                rowLabel.TextColor = UIColor.White;
                rowLabel.SizeToFit();

                verticalScroll.Add(rowLabel);

                var row = new UIScrollView(new CGRect(xPadding, yOffset, AppDelegate.ScreenWidth, posterHeight));
                row.CanCancelContentTouches = true;
                row.ContentSize             = new CGSize(AppDelegate.ScreenWidth * response.results.Count, posterHeight);
                row.PagingEnabled           = true;

                xOffset = 0;

                foreach (Movie m in response.results)
                {
                    if (!string.IsNullOrEmpty(m.poster_path))
                    {
                        var poster = new UIImageView(new CGRect(xOffset, 0, posterWidth, posterHeight));
                        poster.UserInteractionEnabled = true;
                        poster.AddGestureRecognizer(new UITapGestureRecognizer(() => {
                            PresentViewController(new MovieDetailController(m), true, null);
                        }));

                        var manager    = SDWebImageManager.SharedManager.ImageDownloader;
                        var imageNSUrl = new NSUrl("https://image.tmdb.org/t/p/w600_and_h900_bestv2/" + m.poster_path.Replace("\\", ""));

                        manager.DownloadImage(imageNSUrl, SDWebImageDownloaderOptions.UseNSUrlCache, (s, e) =>
                        {
                        },
                                              ((UIImage image, NSData data, NSError error, bool finished) =>
                        {
                            if (image != null && finished)
                            {
                                BeginInvokeOnMainThread(() =>
                                {
                                    poster.Image = image;
                                });
                            }
                        })
                                              );

                        row.Add(poster);
                        xOffset += posterWidth + 2 * xPadding;
                    }
                }

                verticalScroll.Add(row);
                yOffset += posterHeight + 2 * yPadding + 10;
            }
            View.Add(verticalScroll);
        }
Ejemplo n.º 24
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.White;

            scrollView = new UIScrollView();
            View.Add(scrollView);
            scrollView.TranslatesAutoresizingMaskIntoConstraints                = false;
            scrollView.TopAnchor.ConstraintEqualTo(View.TopAnchor).Active       = true;
            scrollView.LeftAnchor.ConstraintEqualTo(View.LeftAnchor).Active     = true;
            scrollView.RightAnchor.ConstraintEqualTo(View.RightAnchor).Active   = true;
            scrollView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active = true;

            containerView = new UIView();
            scrollView.Add(containerView);
            containerView.TranslatesAutoresizingMaskIntoConstraints = false;
            containerView.TopAnchor.ConstraintEqualTo(containerView.Superview.TopAnchor).Active       = true;
            containerView.LeftAnchor.ConstraintEqualTo(containerView.Superview.LeftAnchor).Active     = true;
            containerView.RightAnchor.ConstraintEqualTo(containerView.Superview.RightAnchor).Active   = true;
            containerView.BottomAnchor.ConstraintEqualTo(containerView.Superview.BottomAnchor).Active = true;
            containerView.WidthAnchor.ConstraintEqualTo(scrollView.WidthAnchor).Active   = true;
            containerView.HeightAnchor.ConstraintEqualTo(View.Frame.Height + 100).Active = true;

            taskNameLabel = new UILabel();
            containerView.Add(taskNameLabel);
            taskNameLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            taskNameLabel.TopAnchor.ConstraintEqualTo(taskNameLabel.Superview.TopAnchor, 10).Active      = true;
            taskNameLabel.LeftAnchor.ConstraintEqualTo(taskNameLabel.Superview.LeftAnchor, 10).Active    = true;
            taskNameLabel.RightAnchor.ConstraintEqualTo(taskNameLabel.Superview.RightAnchor, -10).Active = true;
            taskNameLabel.HeightAnchor.ConstraintEqualTo(30).Active = true;
            taskNameLabel.Text      = "Задача задачееца";
            taskNameLabel.TextColor = UIColor.DarkTextColor;
            taskNameLabel.Font      = UIFont.SystemFontOfSize(14);

            commentDescriptionLabel      = new UILabel();
            commentDescriptionLabel.Text = "Комментарий";
            containerView.Add(commentDescriptionLabel);
            commentDescriptionLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            commentDescriptionLabel.TopAnchor.ConstraintEqualTo(taskNameLabel.BottomAnchor, 10).Active = true;
            commentDescriptionLabel.LeftAnchor.ConstraintEqualTo(commentDescriptionLabel.Superview.LeftAnchor, 10).Active    = true;
            commentDescriptionLabel.RightAnchor.ConstraintEqualTo(commentDescriptionLabel.Superview.RightAnchor, -10).Active = true;
            commentDescriptionLabel.HeightAnchor.ConstraintEqualTo(14).Active = true;
            commentDescriptionLabel.Font      = UIFont.SystemFontOfSize(12);
            commentDescriptionLabel.TextColor = UIColor.DarkTextColor.ColorWithAlpha(0.6f);

            commentTextView = new UITextView();
            containerView.Add(commentTextView);
            commentTextView.TranslatesAutoresizingMaskIntoConstraints = false;
            commentTextView.TopAnchor.ConstraintEqualTo(commentDescriptionLabel.BottomAnchor, 5).Active      = true;
            commentTextView.LeftAnchor.ConstraintEqualTo(commentTextView.Superview.LeftAnchor, 10).Active    = true;
            commentTextView.RightAnchor.ConstraintEqualTo(commentTextView.Superview.RightAnchor, -10).Active = true;
            commentTextView.HeightAnchor.ConstraintEqualTo(60).Active = true;
            commentTextView.Layer.CornerRadius = 5;
            commentTextView.Layer.BorderWidth  = 1;
            commentTextView.Layer.BorderColor  = UIColor.FromRGB(229, 228, 229).CGColor;
            commentTextView.Editable           = false;

            subtasksButton = new UIButton();
            containerView.AddSubview(subtasksButton);
            subtasksButton.TranslatesAutoresizingMaskIntoConstraints = false;
            subtasksButton.TopAnchor.ConstraintEqualTo(commentTextView.BottomAnchor, 10).Active            = true;
            subtasksButton.RightAnchor.ConstraintEqualTo(subtasksButton.Superview.RightAnchor, -10).Active = true;
            subtasksButton.SetTitle("Список подзадач", UIControlState.Normal);
            subtasksButton.SetTitleColor(View.TintColor, UIControlState.Normal);
            subtasksButton.TouchUpInside += SubtasksButton_TouchUpInside;


            imageView = new UIImageView();

            //imageView.Frame = new RectangleF(250, 200, 100, 100);
            imageView.BackgroundColor = UIColor.Gray;

            containerView.Add(imageView);
            imageView.TranslatesAutoresizingMaskIntoConstraints = false;
            imageView.TopAnchor.ConstraintEqualTo(subtasksButton.BottomAnchor, 10).Active        = true;
            imageView.RightAnchor.ConstraintEqualTo(imageView.Superview.RightAnchor, -10).Active = true;
            imageView.HeightAnchor.ConstraintEqualTo(70).Active = true;
            imageView.WidthAnchor.ConstraintEqualTo(70).Active  = true;

            showLocation = new UIButton(UIButtonType.System);
            showLocation.SetTitle("Геопозиция", UIControlState.Normal);
            showLocation.Font.WithSize(10);
            map = new MKMapView(UIScreen.MainScreen.Bounds);
            showLocation.TouchUpInside += (sender, e) =>
            {
                View.AddSubview(map);
            };
            containerView.Add(showLocation);
            showLocation.TranslatesAutoresizingMaskIntoConstraints = false;
            showLocation.TopAnchor.ConstraintEqualTo(imageView.BottomAnchor, 10).Active = true;
            showLocation.RightAnchor.ConstraintEqualTo(showLocation.Superview.RightAnchor, -10).Active = true;
        }
        //https://developer.apple.com/library/ios/technotes/tn2154/_index.html
        //Pure approach
        public AutoLayoutContentView AddScrollView(string name, UIColor color)
        {
            var scrollView = new UIScrollView ();
            this.Add (scrollView);
            scrollView.Frame = new RectangleF (10, 10, 10, 10);// TODO: Is this still required?
            AutoLayoutContentView contentView = new AutoLayoutContentView (name, color, Font);
            contentView.Frame = new RectangleF (10, 10, 10, 10);// TODO: Is this still required?
            scrollView.Add (contentView);

            // Setup constraints
            scrollView.TranslatesAutoresizingMaskIntoConstraints = false;
            contentView.TranslatesAutoresizingMaskIntoConstraints = false;
            OurConstraints.ViewNames.Add (new NSString ("PrivateScrollView"));
            OurConstraints.Views.Add (scrollView);
            int width = (int)this.Bounds.Size.Width;
            int height = (int)this.Bounds.Size.Height;

            AddConstraint ("H:|[PrivateScrollView(" + width + ")]|");
            AddConstraint ("V:|[PrivateScrollView(>=" + height + ")]|");
            AutoLayoutConstraints ScrollViewConstraints = new AutoLayout.AutoLayoutConstraints ();
            ScrollViewConstraints.ViewNames.Add (new NSString ("PrivateContentView"));
            ScrollViewConstraints.Views.Add (contentView);
            AddConstraint ("H:|[PrivateContentView(" + width + ")]|", scrollView, ScrollViewConstraints);
            AddConstraint ("V:|[PrivateContentView(>=" + height + ")]|", scrollView, ScrollViewConstraints);

            OurConstraints.ViewNames.Add (new NSString (name));
            OurConstraints.Views.Add (contentView);
            contentView.Parent = Parent;
            return contentView;
        }
Ejemplo n.º 26
0
        //********************************************
        //public GroupGoalScreenView GroupGoalView{ get; set;}
        public RaffleDetailScreenView(Tap5050Event raffle,UIImage raffleImage,UIInterfaceOrientation UIInterfaceOrientation)
        {
            this.raffle = raffle;
            this.raffleImage = raffleImage;

            BackgroundColor = UIColor.FromRGB (235, 235, 235);
            ScrollEnabled = false;
            //GUI component***********************************************
            PersonalBtn=UIButton.FromType(UIButtonType.System);
            PersonalBtn.BackgroundColor = UIColor.Clear;
            PersonalBtn.SetTitle (RaffleDetailData.PersonalGoalBtnTitle, UIControlState.Normal);
            PersonalBtn.SetTitleColor (UIColor.Black, UIControlState.Normal);
            Add(PersonalBtn);

            GrpBtn=UIButton.FromType(UIButtonType.System);
            GrpBtn.BackgroundColor = UIColor.Clear;
            GrpBtn.SetTitle (RaffleDetailData.GroupGoalBtnTitle, UIControlState.Normal);
            GrpBtn.SetTitleColor (UIColor.Black, UIControlState.Normal);
            Add(GrpBtn);

            RaffleDetailBtn=UIButton.FromType(UIButtonType.System);
            RaffleDetailBtn.BackgroundColor = UIColor.Clear;
            RaffleDetailBtn.SetTitle (RaffleDetailData.RaffleDetailBtnTitle, UIControlState.Normal);
            RaffleDetailBtn.SetTitleColor (UIColor.Black, UIControlState.Normal);
            Add(RaffleDetailBtn);

            RaffleDetailBarView= new UIView () {
                BackgroundColor=UIColor.FromRGB (245, 245, 245),
            };
            Add (RaffleDetailBarView);
            PersonalBarView= new UIView () {
                BackgroundColor=UIColor.FromRGB (245, 245, 245),
            };
            Add (PersonalBarView);
            GrpBarView= new UIView () {
                BackgroundColor=UIColor.FromRGB (245, 245, 245),
            };
            Add (GrpBarView);

            raffleDetailView = new UIScrollView () {
                BackgroundColor=UIColor.Clear,
            };
            Add (raffleDetailView);

            GoalView = new  GoalScreenView ();
            Add (GoalView);

            jackPotLabel = new UILabel ()
            {
                TextColor = UIColor.Red,
                TextAlignment=UITextAlignment.Center,
                Text="$"+raffle.jackpot_total,
                Hidden=(raffle.has_jackpot == "Y"?false:true)
            };
            raffleDetailView.Add(jackPotLabel);

            jackPotDescriptionLabel = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                Text=raffle.jackpot_description,
                Hidden=(raffle.has_jackpot == "Y"?false:true)
            };
            raffleDetailView.Add(jackPotDescriptionLabel);

            raffleImageView=new UIImageView()
            {
                ContentMode = UIViewContentMode.ScaleAspectFit,
                Image = raffleImage
            };
            raffleDetailView.Add (raffleImageView);

            raffleNameTextView = new UITextView ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                Text=raffle.event_name,
                Editable=false,
                BackgroundColor=UIColor.Clear,
                ScrollEnabled=false
            };
            raffleDetailView.Add(raffleNameTextView);

            licenseNumberLabel = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                Text=RaffleDetailData.LicenseNumberLabelText,
            };
            raffleDetailView.Add(licenseNumberLabel);

            licenseNumberLabel2 = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                Text=raffle.licence_number
            };
            raffleDetailView.Add(licenseNumberLabel2);

            organizationLabel = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                Text=raffle.organization,
            };
            raffleDetailView.Add(organizationLabel);

            descriptionTextView = new UITextView ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Left,
                Text=raffle.description,
                Editable=false,
                BackgroundColor=UIColor.Clear,
                ScrollEnabled=false
            };
            raffleDetailView.Add(descriptionTextView);

            seePrizeBtn =new CustomBtn();
            seePrizeBtn.SetTitle (RaffleDetailData.SeePrizeBtnTitle, UIControlState.Normal);
            seePrizeBtn.SetTitleColor (UIColor.White, UIControlState.Normal);
            seePrizeBtn.Hidden = (String.IsNullOrEmpty (raffle.prize_url)||(!raffle.prize_url.ToLower ().Contains ("https://")) ? true : false);
            raffleDetailView.Add(seePrizeBtn);

            sellTicketBtn =new CustomBtn();
            sellTicketBtn.SetTitle (RaffleDetailData.SellTicketBtnTitle, UIControlState.Normal);
            sellTicketBtn.SetTitleColor (UIColor.White, UIControlState.Normal);
            sellTicketBtn.Hidden = (raffle.have_contract == "Y" ? false : true);
            raffleDetailView.Add(sellTicketBtn);

            applyContractBtn =new CustomBtn();
            applyContractBtn.SetTitle (RaffleDetailData.ApplyContractBtnTitle, UIControlState.Normal);
            applyContractBtn.SetTitleColor (UIColor.White, UIControlState.Normal);
            applyContractBtn.Hidden = (raffle.have_contract == "Y" ? true : false);
            raffleDetailView.Add(applyContractBtn);

            //GroupGoalView = new  GroupGoalScreenView ();
            //Add (GroupGoalView);

            //move the view when the keyboard is up
            NSNotificationCenter.DefaultCenter.AddObserver
            (UIKeyboard.DidShowNotification,KeyBoardUpNotification);

            Rotate (UIInterfaceOrientation);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Initializes all the parts and controls of the parallaxing screen.
        /// </summary>
        /// <param name="background"></param>
        void Initialize()
        {
            // Set up the parallax.
            parallaxScrollView = new UIScrollView(this.Frame);

            // Set the default scroll height for the frame.
            // This is the offset where the content goes when it's snapped to the top.
            defaultScrollOffset = this.Frame.Height - 130 - 60 - 40;

            // Set up our darkening layer.
            darkerLayer = new UIView(this.Frame);
            darkerLayer.BackgroundColor = UIColor.Black;
            darkerLayer.Alpha = 0;

            // Set up our scrolling.
            scrollView = new Views.FadingScrollView(this.Frame)
            {
                ShowsHorizontalScrollIndicator = false,
                ShowsVerticalScrollIndicator = false,
                DecelerationRate = UIScrollView.DecelerationRateNormal
            };

            // Add some events to handle the scrolling.
            scrollView.Scrolled += ScrollViewDidScroll;
            scrollView.DraggingEnded += ScrollViewDraggingEnded;
            scrollView.DecelerationEnded += ScrollViewDecelerationEnded;

            // Makes sure that a tap scrolls the view up a bit.
            var tap = new UITapGestureRecognizer();
            tap.AddTarget(() => { if (scrollView.ContentOffset.Y == 0) ScrollTo(0, defaultScrollOffset); });
            scrollView.AddGestureRecognizer(tap);

            // Setup the picture frame. We make it higher then the view is due to parallax.
            RectangleF frame = this.Frame;
            frame.Size = new SizeF(frame.Width, frame.Height + frame.Height / parallaxSpeedRatio);

            // Set up the pictures.
            backgroundPhoto = new UIImageView(frame) {
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight,
                ContentMode = UIViewContentMode.ScaleAspectFill
            };

            backgroundPhotoWithImageEffects = new UIImageView(frame) {
                ContentMode = UIViewContentMode.ScaleAspectFill,
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight,
                Alpha = 0
            };

            // Create the header.
            header = new ParallaxBlurHeaderView(new RectangleF(0, 0, 320, 50));
            header.OnTapped += HeaderOnTapped;

            // Add our items to the view.
            parallaxScrollView.Add(backgroundPhoto);
            parallaxScrollView.Add(backgroundPhotoWithImageEffects);

            // Do the actual cross dissolve effect.
            CrossDissolvePhotos(backgroundPhoto.Image, backgroundPhotoWithImageEffects.Image);

            // Add our elements to the view.
            this.Add(parallaxScrollView);
            this.Add(darkerLayer);
            this.Add(scrollView);
            this.Add(header);
        }
        public KeyboardInputView (RectangleF frame)
            : base(frame)
        {
            _toolbar = new UIToolbar (frame);

            var toolbarItems = new UIBarButtonItem[] {
                new UIBarButtonItem (UIBarButtonSystemItem.Cancel, CancelButton_Tapped),
                new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace, null),
                new UIBarButtonItem (UIBarButtonSystemItem.Done, DoneButton_Tapped)
            };

            _toolbar.SetItems (toolbarItems, false);
            _toolbar.SizeToFit ();

            _textFieldContainer = new UIScrollView(new RectangleF(0, 0, 100, 100));

            _textField = new UITextField (_textFieldContainer.Bounds);
            _textField.AutoresizingMask =
                UIViewAutoresizing.FlexibleWidth |
                UIViewAutoresizing.FlexibleHeight;
            _textField.BorderStyle = UITextBorderStyle.RoundedRect;
            _textField.Delegate = new TextFieldDelegate (this);

            // Change this to be capitalization of all characters.  Does not really seem to work
            _textField.AutocapitalizationType = UITextAutocapitalizationType.AllCharacters;

            _textFieldContainer.Add (_textField);

            Add (_toolbar);
            Add (_textFieldContainer);

            AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            AutosizesSubviews = false;
            Opaque = true;
            BackgroundColor = UIColor.FromRGB (0xC5, 0xCC, 0xD4);

            SetNeedsLayout ();
        }
        public AvatarSelectorView(RectangleF rect, UIImage originalImage)
            : base(rect)
        {
            this.BackgroundColor = UIColor.Black;
            this.AutoresizingMask = UIViewAutoresizing.All;
            this.MultipleTouchEnabled = true;

            _tipLabel = new UILabel (new RectangleF (this.Frame.GetMidX () - 150, 10, 300, 40));
            _tipLabel.BackgroundColor = UIColor.Clear;
            _tipLabel.TextColor = UIColor.LightTextColor;
            _tipLabel.Text = "Move and Scale";
            _tipLabel.Font = UIFont.BoldSystemFontOfSize (30);
            _tipLabel.TextAlignment = UITextAlignment.Center;

            RectangleF scrollRect = new RectangleF (this.Frame.GetMidX () - 100, 60, _windowWidth, _windowWidth);;

            _scrollView = new UIScrollView (scrollRect);
            _scrollView.ClipsToBounds = true;
            _scrollView.ShowsHorizontalScrollIndicator = false;
            _scrollView.ShowsVerticalScrollIndicator = false;

            UIImage image = originalImage;

            _imageView = new UIImageView (new RectangleF (new PointF (), image.Size));

            _scrollView.ContentSize = image.Size;
            _imageView.Image = image;

            _scrollView.Delegate = new foo () {View = _imageView};

            SetScrollZoomInfo (scrollRect, true);

            _scrollView.Add(_imageView);
            this.Add (_scrollView);

            _applyChanges = AddNewCustomButton ();
            _applyChanges.Frame = new RectangleF (20,rect.Height-63*2,
                                                    rect.Width-40, 44);
            _applyChanges.SetTitle ("Apply Changes", UIControlState.Normal);
            _applyChanges.TouchUpInside += ApplyChangesTap;

            this.Add (_applyChanges);

            _selectNewPhoto = AddNewCustomButton ();
            _selectNewPhoto.Frame = new RectangleF (20,rect.Height-63,
                                              rect.Width-40, 44);
            _selectNewPhoto.SetTitle ("Change Photo", UIControlState.Normal);
            _selectNewPhoto.TouchUpInside += ChangePhotoTap;

            this.Add (_selectNewPhoto);
            this.Add (_tipLabel);
        }
        public override void LoadView ()
        {
            durationButton = new UIButton ().Apply (Style.NavTimer.DurationButton);
            durationButton.SetTitle (DefaultDurationText, UIControlState.Normal); // Dummy content to use for sizing of the label
            durationButton.SizeToFit ();
            durationButton.TouchUpInside += OnDurationButtonTouchUpInside;
            NavigationItem.TitleView = durationButton;

            var scrollView = new UIScrollView ().Apply (Style.Screen);

            scrollView.Add (wrapper = new UIView () {
                TranslatesAutoresizingMaskIntoConstraints = false,
            });

            wrapper.Add (startStopView = new StartStopView {
                TranslatesAutoresizingMaskIntoConstraints = false,
                StartTime = ViewModel.StartDate,
                StopTime = ViewModel.StopDate,
            });
            startStopView.SelectedChanged += OnStartStopViewSelectedChanged;

            wrapper.Add (datePicker = new UIDatePicker {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Hidden = DatePickerHidden,
                Alpha = 0,
            } .Apply (Style.EditTimeEntry.DatePicker));
            datePicker.ValueChanged += OnDatePickerValueChanged;

            wrapper.Add (projectButton = new ProjectClientTaskButton {
                TranslatesAutoresizingMaskIntoConstraints = false,
            });
            projectButton.TouchUpInside += OnProjectButtonTouchUpInside;

            wrapper.Add (descriptionTextField = new TextField {
                TranslatesAutoresizingMaskIntoConstraints = false,
                AttributedPlaceholder = new NSAttributedString (
                    "EditEntryDesciptionTimerHint".Tr (),
                    foregroundColor: Color.Gray
                ),
                ShouldReturn = tf => tf.ResignFirstResponder (),
            } .Apply (Style.EditTimeEntry.DescriptionField));

            descriptionTextField.ShouldBeginEditing += (s) => {
                ForceDimissDatePicker();
                return true;
            };
            descriptionTextField.ShouldEndEditing += s => {
                return true;
            };

            wrapper.Add (tagsButton = new UIButton () {
                TranslatesAutoresizingMaskIntoConstraints = false,
            } .Apply (Style.EditTimeEntry.TagsButton));
            tagsButton.TouchUpInside += OnTagsButtonTouchUpInside;

            wrapper.Add (billableSwitch = new LabelSwitchView () {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Text = "EditEntryBillable".Tr (),
            } .Apply (Style.EditTimeEntry.BillableContainer));
            billableSwitch.Label.Apply (Style.EditTimeEntry.BillableLabel);

            wrapper.Add (deleteButton = new UIButton () {
                TranslatesAutoresizingMaskIntoConstraints = false,
            } .Apply (Style.EditTimeEntry.DeleteButton));
            deleteButton.SetTitle ("EditEntryDelete".Tr (), UIControlState.Normal);
            deleteButton.TouchUpInside += OnDeleteButtonTouchUpInside;

            ResetWrapperConstraints ();
            scrollView.AddConstraints (
                wrapper.AtTopOf (scrollView),
                wrapper.AtBottomOf (scrollView),
                wrapper.AtLeftOf (scrollView),
                wrapper.AtRightOf (scrollView),
                wrapper.WithSameWidth (scrollView),
                wrapper.Height ().GreaterThanOrEqualTo ().HeightOf (scrollView).Minus (64f),
                null
            );

            View = scrollView;
        }
Ejemplo n.º 31
0
		private void InitSubviews ()
		{
			FitpulseTheme.Apply (View);

			scrollView = new UIScrollView (UIScreen.MainScreen.Bounds);
			Add (scrollView);

			if (UISwitch.Appearance.RespondsToSelector (new Selector ("onImage"))) {
			} else {
				bool showSwitchText = !UIDevice.CurrentDevice.CheckSystemVersion (7, 0);
				var onRect = new CGRect (72, 20, 76, 42);
				var offRect = new CGRect (176, 20, 76, 42);

				if (!showSwitchText) {
				  onRect.X += 20;
				  onRect.Width -= 20;
				  offRect.Width -= 20;
				}

				var onSwitch = new SwitchOnOff (onRect);
				onSwitch.SetOn (true);

				var offSwitch = new SwitchOnOff (offRect);
				offSwitch.SetOn (false);

				onSwitch.ShowText (showSwitchText);
				offSwitch.ShowText (showSwitchText);

				scrollView.AddSubviews (onSwitch, offSwitch);
			}

			progressBar = new PercentageProgressBar (new CGRect (20, 68, 280, 24));
			progressBar.Progress = 0.5f;

			scrollView.Add (progressBar);

			var loadingLabel = new UILabel (new CGRect (118, 91, 84, 19));
			loadingLabel.Text = "Loading...";
			loadingLabel.Font = UIFont.BoldSystemFontOfSize (15);
			loadingLabel.TextColor = UIColor.FromRGB (135, 141, 138);
			loadingLabel.BackgroundColor = UIColor.Clear;
			loadingLabel.TextAlignment = UITextAlignment.Center;

			scrollView.Add (loadingLabel);		

			slider = new UISlider (new CGRect (18, 121, 284, 23));
			slider.MinValue = 0;
			slider.MaxValue = 1;
			slider.Value = 0.5f;
			slider.ValueChanged += (sender, e) => {
				progressBar.Progress = slider.Value; };

			scrollView.Add (slider);	

			var uiSegmentedControl = new UISegmentedControl (new [] {"Yes", "No", "Maybe"}) {
				SelectedSegment = 0
			};

			FitpulseTheme.Apply (uiSegmentedControl);
			uiSegmentedControl.SetWidth (80.0f, 0);
			uiSegmentedControl.SetWidth (80.0f, 1);				
			
			uiSegmentedControl.Frame = new CGRect (26, 161, 268, 44);

			scrollView.Add (uiSegmentedControl);

			textField = new UITextField (new CGRect (20, 221, 280, 31));
			textField.LeftView = new UIView (new CGRect (0, 0, 5, 31));
			textField.LeftViewMode = UITextFieldViewMode.Always;
			textField.Font = UIFont.SystemFontOfSize (14);
			textField.TextColor = UIColor.White;
			textField.Background = UIImage.FromFile ("text-input.png");
			textField.VerticalAlignment = UIControlContentVerticalAlignment.Center;
			textField.Placeholder = "Text";
			FitpulseTheme.Apply (textField);

			textField.Delegate = new TextFieldDelegate ();

			scrollView.Add (textField);

			var leftTopButton = Buttons.ElementsButton ("Button", FitpulseTheme.SharedTheme.GrayButtonImage);
			var rightTopButton = Buttons.ElementsButton ("Button", FitpulseTheme.SharedTheme.GrayPressedButtonImage);

			var leftBottomButton = Buttons.ElementsButton ("Button", FitpulseTheme.SharedTheme.BlueButtonImage);
			var rightBottomButton = Buttons.ElementsButton ("Button", FitpulseTheme.SharedTheme.BluePressedButtonImage);

			leftBottomButton.SetTitleColor (UIColor.White, UIControlState.Normal);
			leftBottomButton.SetTitleColor (UIColor.DarkGray, UIControlState.Highlighted);
			rightBottomButton.SetTitleColor (UIColor.White, UIControlState.Normal);
			rightBottomButton.SetTitleColor (UIColor.DarkGray, UIControlState.Highlighted);

			leftBottomButton.SetTitleShadowColor (UIColor.DarkGray, UIControlState.Normal);
			leftBottomButton.SetTitleShadowColor (UIColor.Gray, UIControlState.Highlighted);
			rightBottomButton.SetTitleShadowColor (UIColor.DarkGray, UIControlState.Normal);
			rightBottomButton.SetTitleShadowColor (UIColor.Gray, UIControlState.Highlighted);

			leftTopButton.Frame = new CGRect (20, 268, 126, 42);
			leftBottomButton.Frame = new CGRect (20, 318, 126, 42);
			rightTopButton.Frame = new CGRect (174, 268, 126, 42);
			rightBottomButton.Frame = new CGRect (174, 318, 126, 42);

			scrollView.AddSubviews (leftTopButton, leftBottomButton, rightTopButton, rightBottomButton);
			
		}
Ejemplo n.º 32
0
        public GoalScreenView()
        {
            BackgroundColor = UIColor.FromRGB (235, 235, 235);
            //GUI component***********************************************
            raffleImageView=new UIImageView()
            {
                ContentMode = UIViewContentMode.ScaleAspectFit,
                Image=UIImage.FromFile (GoalScreenData.raffleDefaultImageFileName)
            };
            Add (raffleImageView);

            raffleNameTextView = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                BackgroundColor=UIColor.Clear,
            };
            Add(raffleNameTextView);

            organizationLabel = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
            };
            Add(organizationLabel);

            dataScrollView=new UIScrollView ()
            {
                BackgroundColor = UIColor.FromRGB (235, 235, 235),
            };
            Add(dataScrollView);

            //***************************************************************
            progressBackgroundView= new UIView ()
            {
                BackgroundColor = UIColor.White,
            };
            dataScrollView.Add(progressBackgroundView);

            timeLeftBackgroundView = new UIView ()
            {
                BackgroundColor = UIColor.FromRGB(0,122,255),
            };
            dataScrollView.Add(timeLeftBackgroundView);

            timeLeftLabel = new UILabel ()
            {
                TextColor = UIColor.White,
                TextAlignment=UITextAlignment.Center,
            };
            dataScrollView.Add(timeLeftLabel);

            //***************************************************************

            personalProgressLabel = new UILabel ()
            {
                Text=GoalScreenData.personalProgressLabelText,
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
            };
            dataScrollView.Add(personalProgressLabel);

            totalRaiseLabel = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
            };
            dataScrollView.Add(totalRaiseLabel);

            raiseToDateLabel = new UILabel ()
            {
                Text=GoalScreenData.raiseToDateText,
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
            };
            dataScrollView.Add(raiseToDateLabel);

            barView= new UIView ()
            {
                BackgroundColor = UIColor.FromRGB(180,180,180),
            };
            dataScrollView.Add(barView);

            goalLabel = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
            };
            dataScrollView.Add(goalLabel);

            goalAmountLabel = new UILabel ()
            {
                Text=GoalScreenData.goalAmountText,
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
            };
            dataScrollView.Add(goalAmountLabel);

            //***************************************************************

            progressBackgroundCircleView=new CustomCircleView(UIColor.FromRGB(180,180,180),2.0f);
            dataScrollView.Add (progressBackgroundCircleView);

            progressPercentCompletedView = new CustomCircleView (UIColor.FromRGB(0,122,255),0f);
            dataScrollView.Add (progressPercentCompletedView);

            progressCoverView= new CustomCircleView (UIColor.White,2.0f);
            dataScrollView.Add (progressCoverView);

            clickToSeeGoalPrizeLabel = new UITextView ()
            {
                Text=GoalScreenData.clickToSeeGoalPrizeLabel,
                TextColor = UIColor.FromRGB(255,165,0),
                TextAlignment=UITextAlignment.Center,
                Hidden=true,
                Editable=false,
                BackgroundColor=UIColor.Clear,
                ScrollEnabled=false,
            };
            dataScrollView.Add(clickToSeeGoalPrizeLabel);

            progressPersonImageView=new UIImageView()
            {
                ContentMode = UIViewContentMode.ScaleAspectFill,
                Image=UIImage.FromFile (GoalScreenData.progressPersonImageFileName)
            };
            dataScrollView.Add (progressPersonImageView);

            progressPercentageLabel = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
            };
            dataScrollView.Add(progressPercentageLabel);

            //***************************************************************
            goalPrizeDescription = new UITextView ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                Hidden=true,
                Editable=false,
                BackgroundColor=UIColor.White,
                ScrollEnabled=false,
                Alpha = 0.0f
            };
            dataScrollView.Add(goalPrizeDescription);

            goalPrizeImageView= new UIImageView ()
            {
                BackgroundColor = UIColor.White,
                Alpha = 0.0f,
                ContentMode = UIViewContentMode.ScaleAspectFit,
                Image=UIImage.FromFile (GoalScreenData.goalPrizeDefaultImageFileName),
                Hidden=true,
            };
            dataScrollView.Add(goalPrizeImageView);

            goalPrizeBtn =UIButton.FromType (UIButtonType.RoundedRect);
            goalPrizeBtn.BackgroundColor = UIColor.Clear;
            goalPrizeBtn.Hidden = true;
            dataScrollView.Add(goalPrizeBtn);

            //***************************************************************
            sellerPositionBgView = new UIView () {
                BackgroundColor = UIColor.White,
            };
            dataScrollView.Add(sellerPositionBgView);

            SellerPositionLabel = new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
                Text=GoalScreenData.SellerPositionText,
            };
            dataScrollView.Add(SellerPositionLabel);

            positionImageView= new UIImageView () {
                ContentMode = UIViewContentMode.ScaleAspectFit,
            };
            dataScrollView.Add (positionImageView);

            positionLabel= new UILabel ()
            {
                TextColor = UIColor.Black,
                TextAlignment=UITextAlignment.Center,
            };
            dataScrollView.Add(positionLabel);

            leaderBoard = new UITableView (){
                Hidden=true,
                ScrollEnabled=false,
            };
            dataScrollView.Add (leaderBoard);

            rightArrow = UIButton.FromType (UIButtonType.RoundedRect);
            rightArrow.SetImage (UIImage.FromFile (GoalScreenData.rightArrowImageFileName), UIControlState.Normal);
            rightArrow.Alpha = 0.5f;
            Add (rightArrow);

            leftArrow = UIButton.FromType (UIButtonType.RoundedRect);
            leftArrow.SetImage (UIImage.FromFile (GoalScreenData.leftArrowImageFileName), UIControlState.Normal);
            leftArrow.Alpha = 0.5f;
            Add (leftArrow);

            Rotate ();
        }
        UIView InitializeTabContent(string tabName, int count)
        {
            tabContentView = new UIScrollView();
            tabContentView.BackgroundColor = UIColor.FromRGB(232, 235, 240);
            var height = 0;

            switch (tabName)
            {
            case "Furniture":
                for (int i = 0; i < count; i++)
                {
                    var view = InitializeTemplateView(FurnitureList[i].Image, FurnitureList[i].Title, FurnitureList[i].Price, FurnitureList[i].Offer, FurnitureList[i].Rating, FurnitureList[i].Description);
                    view.Frame = new CGRect(5, 5 + (i * 175), this.Frame.Width - 10, 170);
                    tabContentView.Add(view);
                    height = (int)(view.Frame.Y + view.Frame.Height);
                }
                break;

            case "Toys":
                for (int i = 0; i < count; i++)
                {
                    var view = InitializeTemplateView(ToysList[i].Image, ToysList[i].Title, ToysList[i].Price, ToysList[i].Offer, ToysList[i].Rating, ToysList[i].Description);
                    view.Frame = new CGRect(5, 5 + (i * 175), this.Frame.Width - 10, 170);
                    tabContentView.Add(view);
                    height = (int)(view.Frame.Y + view.Frame.Height);
                }
                break;

            case "Clothing":
                for (int i = 0; i < count; i++)
                {
                    var view = InitializeTemplateView(ClothingList[i].Image, ClothingList[i].Title, ClothingList[i].Price, ClothingList[i].Offer, ClothingList[i].Rating, ClothingList[i].Description);
                    view.Frame = new CGRect(5, 5 + (i * 175), this.Frame.Width - 10, 170);
                    tabContentView.Add(view);
                    height = (int)(view.Frame.Y + view.Frame.Height);
                }
                break;

            case "Shoes":
                for (int i = 0; i < count; i++)
                {
                    var view = InitializeTemplateView(ShoesList[i].Image, ShoesList[i].Title, ShoesList[i].Price, ShoesList[i].Offer, ShoesList[i].Rating, ShoesList[i].Description);
                    view.Frame = new CGRect(5, 5 + (i * 175), this.Frame.Width - 10, 170);
                    tabContentView.Add(view);
                    height = (int)(view.Frame.Y + view.Frame.Height);
                }
                break;

            case "Fruits":
                for (int i = 0; i < count; i++)
                {
                    var view = InitializeTemplateView(FruitsList[i].Image, FruitsList[i].Title, FruitsList[i].Price, FruitsList[i].Offer, FruitsList[i].Rating, FruitsList[i].Description);
                    view.Frame = new CGRect(5, 5 + (i * 175), this.Frame.Width - 10, 170);
                    tabContentView.Add(view);
                    height = (int)(view.Frame.Y + view.Frame.Height);
                }
                break;
            }
            tabContentView.ContentSize = new CGSize(this.Frame.Width, height);
            return(tabContentView);
        }