Inheritance: MonoBehaviour
Example #1
0
 private void Awake()
 {
     this.rechargeScrollView = base.transform.FindChild("contentsPanel").GetComponent<UIScrollView>();
     this.rechargeTable = this.rechargeScrollView.transform.FindChild("infoContents").gameObject.AddComponent<UITable>();
     this.rechargeTable.columns = 3;
     this.rechargeTable.direction = UITable.Direction.Down;
     this.rechargeTable.sorting = UITable.Sorting.None;
     this.rechargeTable.hideInactive = true;
     this.rechargeTable.keepWithinPanel = true;
     this.rechargeTable.padding = new Vector2(6f, 0f);
     int privilege = Globals.Instance.CliSession.Privilege;
     foreach (PayInfo current in Globals.Instance.AttDB.PayDict.Values)
     {
         if (!current.Test || privilege > 0)
         {
             if (current.Type == 0)
             {
                 UIRechargeItem uIRechargeItem = UIRechargeItem.CreateItem(this.rechargeTable.transform, this.rechargeScrollView);
                 uIRechargeItem.Init(current);
             }
             else
             {
                 UIMonthCard uIMonthCard = UIMonthCard.CreateItem(this.rechargeTable.transform, this.rechargeScrollView);
                 uIMonthCard.Init(current);
             }
         }
     }
 }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			scrollView = new UIScrollView (new RectangleF (0, 0, 320, 480));
			this.View.AddSubview (scrollView);
			//scrollView.Delegate = new ViewControllerForDuplicateEndCapsDelegate ();
			
			
			// add the last image (image4) into the first position
			this.AddImageWithName ("Images/image4.jpg", 0);
			
			// add all of the images to the scroll view
			for (int i = 1; i < 5; i++) {
				this.AddImageWithName (string.Format ("Images/image{0}.jpg", i), i);
			}
			
			// add the first image (image1) into the last position
			this.AddImageWithName ("Images/image1.jpg", 5);
			
			scrollView.PagingEnabled = true;
			scrollView.Bounces = true;
			scrollView.DelaysContentTouches = true;
			scrollView.ShowsHorizontalScrollIndicator = false;
			
			scrollView.ContentSize = new System.Drawing.SizeF (1920, 480);
			scrollView.ScrollRectToVisible (new RectangleF (320, 0, 320, 480), true);
			scrollView.DecelerationEnded += HandleDecelerationEnded;
			
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="SuperKoikoukesse.iOS.CardsController"/> class.
        /// </summary>
        /// <param name="scrollView">Scroll view.</param>
        /// <param name="pageControl">Page control.</param>
        public CardsController(UIScrollView scrollView, UIPageControl pageControl)
        {
            _scrollView = scrollView;
              _pageControl = pageControl;

              _cards = new List<AbstractCardViewController>();
        }
Example #4
0
		public override void LayoutSubviews ()
		{
			// layout the stock UIAlertView control
			base.LayoutSubviews ();
			
			if(this.Subviews.Count() == 3)
			{
				// build out the text field
				_UserName = ComposeTextFieldControl (false);
				_Password = ComposeTextFieldControl (true);

				// add the text field to the alert view
				
				UIScrollView view = new UIScrollView(this.Frame);
				
				view.AddSubview(ComposeLabelControl("Username"));
				view.AddSubview (_UserName);
				view.AddSubview(ComposeLabelControl("Password"));
				view.AddSubview (_Password);
				
				this.AddSubview(view);
				
			}
			
			// shift the contents of the alert view around to accomodate the extra text field
			AdjustControlSize ();
			
		}
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            float h = 50.0f;
            float w = 50.0f;
            float padding = 10.0f;
            int n = 25;

            _scrollView = new UIScrollView {
                Frame = new RectangleF (0, 0, View.Frame.Width, h + 2 * padding),
                ContentSize = new SizeF ((w + padding) * n, h),
                BackgroundColor = UIColor.DarkGray,
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth
            };

            for (int i=0; i<n; i++) {
                var button = UIButton.FromType (UIButtonType.RoundedRect);
                button.SetTitle (i.ToString (), UIControlState.Normal);
                button.Frame = new RectangleF (padding * (i + 1) + (i * w), padding, w, h);
                _scrollView.AddSubview (button);
                _buttons.Add (button);
            }

            View.AddSubview (_scrollView);
        }
    private static void MovePanelToTargetPos(UIScrollView mScrollView, Transform target, Vector3 panelPos)
    {
        Transform panelTrans = mScrollView.panel.cachedTransform;

        // Figure out the difference between the chosen child and the panel's center in local coordinates
        Vector3 cp = panelTrans.InverseTransformPoint(target.position);
        Vector3 cc = panelTrans.InverseTransformPoint(panelPos);
        Vector3 localOffset = cp - cc;

        // Offset shouldn't occur if blocked
        if (!mScrollView.canMoveHorizontally) localOffset.x = 0f;
        if (!mScrollView.canMoveVertically) localOffset.y = 0f;
        localOffset.z = 0f;

        // Spring the panel to this calculated position
#if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            SetPanelPosition(panelTrans, localOffset, mScrollView.panel);
        }
        else
#endif
        {
            // restrict with in bounds
            // SetPanelPosition(panelTrans, localOffset, mScrollView.panel);
            // mScrollView.RestrictWithinBounds(true);

            // spring panel without restrict with bounds
            SpringPanel.Begin(mScrollView.panel.cachedGameObject, panelTrans.localPosition - localOffset, 8f);
        }
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _canvasView = new UIView
            {
                BackgroundColor = CanvasBackgroundColor,
                Bounds = new CGRect(CGPoint.Empty, CanvasSize),
            };

            _scrollView = new UIScrollView()
            {
                ContentSize = CanvasSize,
                ViewForZoomingInScrollView = sv => _canvasView,
                BackgroundColor = ScrollViewBackgroundColor,
            };

            _scrollView.AddSubview(_canvasView);

            View.AddSubview(_scrollView);

            AddGestures();

            AddInitialElements();
        }
Example #8
0
 protected internal override void NativeInit()
 {
     if (Parent != null)
     {
         if (this.NativeUIElement == null)
         {
             var scroll = new UIScrollView();
             scroll.BackgroundColor = UIColor.Clear;
             this.NativeUIElement = scroll;
             this.NativeUIElement.ClipsToBounds = true;
             this.lastContentOfset = CGPoint.Empty;
             scroll.Scrolled += (sender, e) =>
             {
                 this.OnScrollChanged(new ScrollChangedEventArgs
                 {
                     VerticalOffset = scroll.ContentOffset.Y,
                     HorizontalOffset = scroll.ContentOffset.X,
                     VerticalChange = scroll.ContentOffset.Y - this.lastContentOfset.Y,
                     HorizontalChange = scroll.ContentOffset.X - this.lastContentOfset.X,
                 });
                 this.lastContentOfset = scroll.ContentOffset;
             };
         }
         base.NativeInit();
     }
 }
Example #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            scrollView = new UIScrollView (
                new RectangleF (0, 0, View.Frame.Width,
                    View.Frame.Height));
            View.AddSubview (scrollView);

            imageView = new UIImageView (UIImage.FromBundle ("heinz-map.png"));

            scrollView.ContentSize = imageView.Image.Size;
            scrollView.AddSubview (imageView);
            scrollView.MaximumZoomScale = 0.7f;
            scrollView.MinimumZoomScale = 0.4f;
            scrollView.ContentOffset = new PointF (0, 500);
            scrollView.ZoomScale = 5f;
            scrollView.ViewForZoomingInScrollView += (UIScrollView svm) => {
                return imageView;
            };

            UITapGestureRecognizer doubletap =  new UITapGestureRecognizer(OnDoubleTap) {
                NumberOfTapsRequired = 2 // double tap
            };
            scrollView.AddGestureRecognizer(doubletap);
        }
	void Start()
	{
		_uiPanel = GetComponent<UIPanel>();
		_uiScrollView = GetComponent<UIScrollView>();
		if(_uiScrollView != null)
			_originalUiScrollViewMomentum = _uiScrollView.currentMomentum;
	}
Example #11
0
		public PdfViewController (NSUrl url) : base()
		{
			Url = url;
			View = new UIView ();
			View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
			View.AutosizesSubviews = true;
			
			PdfDocument = CGPDFDocument.FromUrl (Url.ToString ());
			
			// For demo purposes, show first page only.
			PdfPage = PdfDocument.GetPage (1);
			PdfPageRect = PdfPage.GetBoxRect (CGPDFBox.Crop);
			
			// Setup tiled layer.
			TiledLayer = new CATiledLayer ();
			TiledLayer.Delegate = new TiledLayerDelegate (this);
			TiledLayer.TileSize = new SizeF (1024f, 1024f);
			TiledLayer.LevelsOfDetail = 5;
			TiledLayer.LevelsOfDetailBias = 5;
			TiledLayer.Frame = PdfPageRect;
			
			ContentView = new UIView (PdfPageRect);
			ContentView.Layer.AddSublayer (TiledLayer);
			
			// Prepare scroll view.
			ScrollView = new UIScrollView (View.Frame);
			ScrollView.AutoresizingMask = View.AutoresizingMask;
			ScrollView.Delegate = new ScrollViewDelegate (this);
			ScrollView.ContentSize = PdfPageRect.Size;
			ScrollView.MaximumZoomScale = 10f;
			ScrollView.MinimumZoomScale = 1f;
			ScrollView.ScrollEnabled = true;
			ScrollView.AddSubview (ContentView);
			View.AddSubview (ScrollView);
		}
        public override void ViewDidLoad()
        {
            View.BackgroundColor = UIColor.White;
            nameLabel = new UILabel () {
                TextAlignment = UITextAlignment.Left,
                Font = UIFont.FromName ("Helvetica-Light", AppDelegate.Font16pt),
                BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f)
            };
            descriptionTextView = new UITextView () {
                TextAlignment = UITextAlignment.Left,
                Font = UIFont.FromName ("Helvetica-Light", AppDelegate.Font10_5pt),
                BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f),
                Editable = false
            };
            image = new UIImageView () { ContentMode = UIViewContentMode.ScaleAspectFit };

            if (AppDelegate.IsPad) {
                View.AddSubview (nameLabel);

                View.AddSubview (descriptionTextView);
                View.AddSubview (image);
            } else {
                scrollView = new UIScrollView();

                scrollView.AddSubview (nameLabel);

                scrollView.AddSubview (descriptionTextView);
                scrollView.AddSubview (image);

                Add (scrollView);
            }
        }
 public void Init()
 {
     this.ResetTimer = base.transform.Find("time1").GetComponent<UILabel>();
     Transform transform = base.transform.Find("RewardBK");
     this.Title = transform.transform.Find("Title").GetComponent<UILabel>();
     this.Reward = transform.transform.Find("Reward");
     this.Price = transform.transform.Find("Price").GetComponent<UILabel>();
     this.OffPrice = transform.transform.Find("OffPrice").GetComponent<UILabel>();
     this.BuyVIPLevel = transform.transform.Find("BuyVIPLevel").GetComponent<UILabel>();
     this.CurVipLevel = transform.transform.Find("CurVipLevel").GetComponent<UILabel>();
     this.ToBuy = transform.transform.Find("GoBtn");
     this.Buyed = transform.transform.Find("Buy");
     UIEventListener expr_105 = UIEventListener.Get(this.ToBuy.gameObject);
     expr_105.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_105.onClick, new UIEventListener.VoidDelegate(this.OnBuyVipWeekReward));
     this.rewardScrollView = base.transform.Find("rewardPanel").GetComponent<UIScrollView>();
     this.rewardTable = this.rewardScrollView.transform.Find("rewardContents").GetComponent<UITable>();
     for (int i = 0; i <= 15; i++)
     {
         this.VIPLevel[i] = this.rewardTable.transform.Find(string.Format("{0:D2}", i)).GetComponent<UISprite>();
         UIEventListener expr_1A7 = UIEventListener.Get(this.VIPLevel[i].gameObject);
         expr_1A7.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_1A7.onClick, new UIEventListener.VoidDelegate(this.OnVIPLevelClicked));
     }
     this.mTabBtnScrollBar = base.transform.Find("scrollBar").GetComponent<UIScrollBar>();
     EventDelegate.Add(this.mTabBtnScrollBar.onChange, new EventDelegate.Callback(this.OnScrollBarValueChange));
     this.leftBtn = base.transform.Find("LeftBtn").gameObject;
     this.rightBtn = base.transform.Find("RightBtn").gameObject;
     UIEventListener expr_24D = UIEventListener.Get(this.leftBtn);
     expr_24D.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_24D.onClick, new UIEventListener.VoidDelegate(this.OnLeftBtnClicked));
     UIEventListener expr_279 = UIEventListener.Get(this.rightBtn);
     expr_279.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_279.onClick, new UIEventListener.VoidDelegate(this.OnRightBtnClicked));
     this.RefreshCurLevelToggle();
     this.RefreshCurLevelInfo();
 }
        //
        // 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);
            UIApplication.SharedApplication.SetStatusBarHidden(true, true);

            var scrollView = new UIScrollView(window.Bounds);
            window.AddSubview(scrollView);

            var view = new HypnosisView() { Frame = window.Bounds };

            scrollView.AddSubview(view);
            scrollView.ContentSize = window.Bounds.Size;

            scrollView.MinimumZoomScale = 1.0f;
            scrollView.MaximumZoomScale = 5.0f;
            scrollView.Delegate = new HSAnonScrollViewerDelegate(sv => {
                return view;
            });

            window.BackgroundColor = UIColor.White;

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

            return true;
        }
        public ImageGalleryView (RectangleF frame, ObservableCollection<string> images = null) : base (frame)
        {
            this.AutoresizingMask = UIViewAutoresizing.All;
            this.ContentMode = UIViewContentMode.ScaleToFill;
            FadeImages = true;
            this.BackgroundColor = UIColor.White;
            if (frame == default(RectangleF))
                this.Frame = UIScreen.MainScreen.Bounds;
            else
                this.Frame = frame;

            if (images == null)
                Images = new ObservableCollection<string> ();
            else
                Images = images;

            pageControl = new UIPageControl ();
            pageControl.AutoresizingMask = UIViewAutoresizing.All;
            pageControl.ContentMode = UIViewContentMode.ScaleToFill;
            pageControl.ValueChanged += (object sender, EventArgs e) => UpdateScrollPositionBasedOnPageControl();

            scroller = new UIScrollView ();
            scroller.AutoresizingMask = UIViewAutoresizing.All;
            scroller.ShowsHorizontalScrollIndicator = scroller.ShowsVerticalScrollIndicator = false;
            scroller.ContentMode = UIViewContentMode.ScaleToFill;
            scroller.PagingEnabled = true;
            scroller.Bounces = false;


            this.Add (scroller);
            this.Add (pageControl);


        }
		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);
		}
Example #17
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

             // set the background color of the view to white
             this.View.BackgroundColor = UIColor.White;

             this.Title = "Mecut Dosya";

             // create our scroll view
             scrollView = new UIScrollView (
            new RectangleF (0, 0, View.Frame.Width
               , View.Frame.Height - NavigationController.NavigationBar.Frame.Height));
             View.AddSubview (scrollView);

             string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
             string localFilename = "original.jpg";
             string localPath = Path.Combine(documentsPath, localFilename);

             // create our image view
             imageView = new UIImageView (UIImage.FromFile (localPath));
             scrollView.ContentSize = imageView.Image.Size;
             scrollView.AddSubview (imageView);

             // set allow zooming
             scrollView.MaximumZoomScale = 3f;
             scrollView.MinimumZoomScale = .1f;
             scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return imageView; };

             // configure a double-tap gesture recognizer
             UITapGestureRecognizer doubletap = new UITapGestureRecognizer();
             doubletap.NumberOfTapsRequired = 2;
             doubletap.AddTarget (this, new MonoTouch.ObjCRuntime.Selector("DoubleTapSelector"));
             scrollView.AddGestureRecognizer(doubletap);
        }
Example #18
0
 public void Init()
 {
     if (this.mScrollView == null)
     {
         this.mScrollView = NGUITools.FindInParents<UIScrollView>(base.gameObject);
         if (this.mScrollView == null)
         {
             global::Debug.LogWarning(new object[]
             {
                 string.Concat(new object[]
                 {
                     base.GetType(),
                     " requires ",
                     typeof(UIScrollView),
                     " on a parent object in order to work"
                 }),
                 this
             });
             base.enabled = false;
             return;
         }
         if (this.mScrollView)
         {
             UIScrollView expr_94 = this.mScrollView;
             expr_94.onDragFinished = (UIScrollView.OnDragNotification)Delegate.Combine(expr_94.onDragFinished, new UIScrollView.OnDragNotification(this.OnDragFinished));
         }
     }
 }
 private void Awake()
 {
     if (this.Target == null)
     {
         this.Target = this.GetComponent<UIScrollView>();
     }
 }
Example #20
0
    /// <summary>
    /// Recenter the draggable list on the center-most child.
    /// </summary>

    public void Recenter()
    {
        var trans = transform;
        if (trans.childCount == 0) return;

        if (uiGrid == null)
        {
            uiGrid = GetComponent<UIGrid>();
        }

        if (mScrollView == null)
        {
            mScrollView = NGUITools.FindInParents<UIScrollView>(gameObject);

            if (mScrollView == null)
            {
                Debug.LogWarning(GetType() + " requires " + typeof(UIScrollView) + " on a parent object in order to work", this);
                enabled = false;
                return;
            }
            mScrollView.onDragFinished = OnDragFinished;

            if (mScrollView.horizontalScrollBar != null)
                mScrollView.horizontalScrollBar.onDragFinished = OnDragFinished;

            if (mScrollView.verticalScrollBar != null)
                mScrollView.verticalScrollBar.onDragFinished = OnDragFinished;
        }
        if (mScrollView.panel == null) return;
        // Calculate the panel's center in world coordinates
        var corners = mScrollView.panel.worldCorners;
        var panelCenter = (corners[2] + corners[0]) * 0.5f;

        // Offset this value by the momentum
        var pickingPoint = panelCenter - mScrollView.currentMomentum * (mScrollView.momentumAmount * 0.1f);
        mScrollView.currentMomentum = Vector3.zero;

        var visibleItems = 0;
        if (mScrollView.movement == UIScrollView.Movement.Horizontal)
        {
            visibleItems = Mathf.FloorToInt(mScrollView.panel.width / uiGrid.cellWidth);
        }
        if (mScrollView.movement == UIScrollView.Movement.Vertical)
        {
            visibleItems = Mathf.FloorToInt(mScrollView.panel.height / uiGrid.cellHeight);
        }
        var maxPerLine = uiGrid.maxPerLine != 0
                  ? uiGrid.maxPerLine
                  : (uiGrid.arrangement == UIGrid.Arrangement.Horizontal
                         ? Mathf.FloorToInt(mScrollView.panel.width / uiGrid.cellWidth)
                         : Mathf.FloorToInt(mScrollView.panel.height / uiGrid.cellHeight));
        if(uiGrid.transform.childCount <= maxPerLine * visibleItems)
        {
            return;
        }
        var closestPos = visibleItems % 2 == 0
                             ? FindClosestForEven(pickingPoint, maxPerLine, visibleItems / 2)
                             : FindClosestForOdd(pickingPoint, maxPerLine, visibleItems / 2);
        CenterOnPos(closestPos);
    }
		void ReleaseDesignerOutlets ()
		{
			if (btnConnectWithFacebook != null) {
				btnConnectWithFacebook.Dispose ();
				btnConnectWithFacebook = null;
			}
			if (btnConnectWithGoogle != null) {
				btnConnectWithGoogle.Dispose ();
				btnConnectWithGoogle = null;
			}
			if (imgLogo != null) {
				imgLogo.Dispose ();
				imgLogo = null;
			}
			if (lblPromise != null) {
				lblPromise.Dispose ();
				lblPromise = null;
			}
			if (lblTitle != null) {
				lblTitle.Dispose ();
				lblTitle = null;
			}
			if (scrollView != null) {
				scrollView.Dispose ();
				scrollView = null;
			}
		}
Example #22
0
        public override void InitWindowOnAwake()
        {
            this.windowID = WindowID.WindowID_Rank;
            this.preWindowID = WindowID.WindowID_MainMenu;
            InitWindowData();
            base.InitWindowOnAwake();

            // this.RegisterReturnLogic(RetrunPreLogic);

            objEffect = GameUtility.FindDeepChild(this.gameObject, "EffectParent");
            itemsGrid = GameUtility.FindDeepChild(this.gameObject, "LeftAnchor/LeftMain/Scroll View/Grid");
            trsAnimation = GameUtility.FindDeepChild(this.gameObject, "LeftAnchor/LeftMain");
            scrollView = GameUtility.FindDeepChild<UIScrollView>(this.gameObject, "LeftAnchor/LeftMain/Scroll View");
            btnGoToMatch = GameUtility.FindDeepChild(this.gameObject, "Btn_GotoMatch").gameObject;
            
            rankWindowManager = this.gameObject.GetComponent<UIRankManager>();
            if (rankWindowManager == null)
            {
                rankWindowManager = this.gameObject.AddComponent<UIRankManager>();
                rankWindowManager.InitWindowManager();
            }

            UIEventListener.Get(btnGoToMatch).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("AnimationCurve",
                    delegate
                    {
                        UIManager.GetInstance().ShowWindow(WindowID.WindowID_Matching);
                        UIManager.GetInstance().GetGameWindowScript<UIMatching>(WindowID.WindowID_Matching).SetMatchingData(this.windowID);
                    });
            };
        }
		void ReleaseDesignerOutlets ()
		{
			if (_notificationsSwitch != null) {
				_notificationsSwitch.Dispose ();
				_notificationsSwitch = null;
			}
			if (_scrollView != null) {
				_scrollView.Dispose ();
				_scrollView = null;
			}
			if (ConnectionDetail != null) {
				ConnectionDetail.Dispose ();
				ConnectionDetail = null;
			}
			if (ConnectionStatus != null) {
				ConnectionStatus.Dispose ();
				ConnectionStatus = null;
			}
			if (ServerUpdateRate != null) {
				ServerUpdateRate.Dispose ();
				ServerUpdateRate = null;
			}
			if (TraderId != null) {
				TraderId.Dispose ();
				TraderId = null;
			}
			if (UILatency != null) {
				UILatency.Dispose ();
				UILatency = null;
			}
			if (UIUpdateRate != null) {
				UIUpdateRate.Dispose ();
				UIUpdateRate = null;
			}
		}
 void ReleaseDesignerOutlets()
 {
     if (scrollView != null) {
         scrollView.Dispose ();
         scrollView = null;
     }
 }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			pickerDataModel = new PickerDataModel ();

			// set our initial selection on the label
			this.labelListitems.Text = pickerDataModel.SelectedItem.ToString();

			_scrollViewSyllabus = new UIScrollView {
				Frame = new RectangleF (0, 100, View.Frame.Width,
					h + 2 * padding),
				ContentSize = new SizeF ((w + padding) * n, h),
				BackgroundColor = UIColor.Orange,
				AutoresizingMask = UIViewAutoresizing.FlexibleWidth
			};
			_scrollViewYear = new UIScrollView {
				Frame = new RectangleF (0, 20, View.Frame.Width,
					h + 2 * padding),
				ContentSize = new SizeF ((w + padding) * n, h),
				BackgroundColor = UIColor.Orange,
				AutoresizingMask = UIViewAutoresizing.FlexibleWidth
			};

			PreapareScrollers ();
			//View.AddSubviews (pickeritems);
			// Perform any additional setup after loading the view, typically from a nib.
		}
		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);
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="ImageGalleryView"/> class.
		/// </summary>
		/// <param name="frame">The frame.</param>
		/// <param name="images">The images.</param>
		public ImageGalleryView(CGRect frame, ObservableCollection<string> images = null)
			: base(frame)
		{
			AutoresizingMask = UIViewAutoresizing.All;
			ContentMode = UIViewContentMode.ScaleToFill;
			
			FadeImages = true;
			
			BackgroundColor = UIColor.White;
			
			Frame = frame == default(CGRect) ? UIScreen.MainScreen.Bounds : frame;

			Images = images ?? new ObservableCollection<string>();

			_pageControl = new UIPageControl
				               {
					               AutoresizingMask = UIViewAutoresizing.All,
					               ContentMode = UIViewContentMode.ScaleToFill
				               };

			_pageControl.ValueChanged += (object sender, EventArgs e) => UpdateScrollPositionBasedOnPageControl();

			_scroller = new UIScrollView
				            {
					            AutoresizingMask = UIViewAutoresizing.All,
					            ContentMode = UIViewContentMode.ScaleToFill,
					            PagingEnabled = true,
					            Bounces = false,
					            ShowsHorizontalScrollIndicator = false,
					            ShowsVerticalScrollIndicator = false
				            };

			Add(_scroller);
			Add(_pageControl);
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			// set the background color of the view to white
			this.View.BackgroundColor = UIColor.White;
			
			this.Title = "Scroll View";
			
			// create our scroll view
			scrollView = new UIScrollView (
				new CGRect (0, 0, View.Frame.Width
				, View.Frame.Height - NavigationController.NavigationBar.Frame.Height));
			View.AddSubview (scrollView);
			
			// create our image view
			imageView = new UIImageView (UIImage.FromFile ("halloween.jpg"));
			scrollView.ContentSize = imageView.Image.Size;
			scrollView.AddSubview (imageView);
			
			// set allow zooming
			scrollView.MaximumZoomScale = 3f;
			scrollView.MinimumZoomScale = .1f;			
			scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return imageView; };

			// Create a new Tap Gesture Recognizer
			UITapGestureRecognizer doubletap = new UITapGestureRecognizer(OnDoubleTap) {
				NumberOfTapsRequired = 2 // double tap
			};
			scrollView.AddGestureRecognizer(doubletap); // detect when the scrollView is double-tapped
		}
        public void DraggingEnded(UIScrollView scrollView, bool willDecelerate)
        {
            if (_table.ContentOffset.Y <= -65f) {

                //ReloadTimer = NSTimer.CreateRepeatingScheduledTimer (new TimeSpan (0, 0, 0, 10, 0), () => dataSourceDidFinishLoadingNewData ());
                _reloadTimer = NSTimer.CreateScheduledTimer (TimeSpan.FromSeconds (2f), delegate {
                    // for this demo I cheated and am just going to pretend data is reloaded
                    // in real world use this function to really make sure data is reloaded

                    _reloadTimer = null;
                    Console.WriteLine ("dataSourceDidFinishLoadingNewData() called from NSTimer");

                    _reloading = false;
                    _refreshHeaderView.FlipImageAnimated (false);
                    _refreshHeaderView.ToggleActivityView ();
                    UIView.BeginAnimations ("DoneReloadingData");
                    UIView.SetAnimationDuration (0.3);
                    _table.ContentInset = new UIEdgeInsets (0f, 0f, 0f, 0f);
                    _refreshHeaderView.SetStatus (TableViewPullRefresh.RefreshTableHeaderView.RefreshStatus.PullToReloadStatus);
                    UIView.CommitAnimations ();
                    _refreshHeaderView.SetCurrentDate ();
                });

                _reloading = true;
                _table.ReloadData ();
                _refreshHeaderView.ToggleActivityView ();
                UIView.BeginAnimations ("ReloadingData");
                UIView.SetAnimationDuration (0.2);
                _table.ContentInset = new UIEdgeInsets (60f, 0f, 0f, 0f);
                UIView.CommitAnimations ();
            }

            _checkForRefresh = false;
        }
Example #30
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // set the background color of the view to white
            this.View.BackgroundColor = UIColor.White;

            this.Title = "Scroll View";

            // create our scroll view
            scrollView = new UIScrollView (
                new RectangleF (0, 0, View.Frame.Width
                , View.Frame.Height - NavigationController.NavigationBar.Frame.Height));
            View.AddSubview (scrollView);

            // create our image view
            imageView = new UIImageView (UIImage.FromFile ("halloween.jpg"));
            scrollView.ContentSize = imageView.Image.Size;
            scrollView.AddSubview (imageView);

            // set allow zooming
            scrollView.MaximumZoomScale = 3f;
            scrollView.MinimumZoomScale = .1f;
            scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return imageView; };
        }
Example #31
0
        //internal Sort[] DefaultSorts;

        public ItemBrowser()
        {
            this.CanMove = true;
            //Height = 420;

            _expandTexture   = HEROsMod.instance.GetTexture("Images/ExpandIcon");
            _collapseTexture = HEROsMod.instance.GetTexture("Images/CollapseIcon");
            _spacerTexture   = HEROsMod.instance.GetTexture("Images/spacer");

            //UILabel lTitle = new UILabel("Item Browser");
            //lTitle.Scale = .6f;
            //lTitle.X = LargeSpacing;
            //lTitle.Y = LargeSpacing;
            //lTitle.OverridesMouse = false;
            //AddChild(lTitle);

            _itemView   = new ItemCollectionView();
            Height      = LargeSpacing * 2 + _itemView.Height + 32;
            _itemView.X = LargeSpacing;
            _itemView.Y = Height - LargeSpacing - _itemView.Height;
            AddChild(_itemView);

            _categoryView        = new UIScrollView();
            _categoryView.X      = _itemView.X + _itemView.Width + LargeSpacing;
            _categoryView.Y      = _itemView.Y;
            _categoryView.Width  = 45 + numberCategoryColumns * 100;
            _categoryView.Height = _itemView.Height;
            AddChild(_categoryView);

            Width = _categoryView.X + _categoryView.Width + LargeSpacing;

            _bClose              = new UIImage(HEROsMod.instance.GetTexture("Images/closeButton"));
            _bClose.Anchor       = AnchorPosition.TopRight;
            _bClose.Position     = new Vector2(Width - LargeSpacing, LargeSpacing);
            _bClose.onLeftClick += bClose_onLeftClick;
            AddChild(_bClose);

            SearchBox             = new UITextbox();
            SearchBox.Width       = 125;
            SearchBox.X           = _itemView.X + _itemView.Width - SearchBox.Width;
            SearchBox.Y           = _itemView.Y - SearchBox.Height - Spacing - 4;
            SearchBox.KeyPressed += textbox_KeyPressed;
            AddChild(SearchBox);

            _filterView          = new UIView();
            _filterView.Position = new Vector2(LargeSpacing, Spacing);
            //_filterView.onLeftClick += _bViewAllItems_onLeftClick;
            //{
            //	UIImage test = new UIImage(HEROsMod.instance.GetTexture("Images/closeButton"));
            //	test.onLeftClick += bClose_onLeftClick;
            //	_filterView.AddChild(test);
            //	UIImage test2 = new UIImage(HEROsMod.instance.GetTexture("Images/closeButton"));
            //	test2.onLeftClick += bClose_onLeftClick;
            //	test2.Position = test.Position;
            //	test2.X += test.Width;
            //	test2.ForegroundColor = Color.Azure;
            //	_filterView.AddChild(test2);
            //}
            //	_filterView.ForegroundColor = Color.Red;
            //	_filterView.BackgroundColor = Color.Pink;
            //	_filterView.Width = 100;
            _filterView.Height = 40;
            AddChild(_filterView);

            _spacer          = new UIImage(_spacerTexture);
            _spacer.Position = new Vector2(Spacing, LargeSpacing);
            _spacer.Height   = 40;
            AddChild(_spacer);

            _sortView          = new UIView();
            _sortView.Position = new Vector2(Spacing, Spacing);
            //_sortView.onLeftClick += _bViewAllItems_onLeftClick;
            //	_sortView.ForegroundColor = Color.Red;
            //	_sortView.BackgroundColor = Color.Red;
            //	_sortView.Width = 30;
            _sortView.Height = 40;
            AddChild(_sortView);

            //_trashCan = new Slot(0);
            //_trashCan.IsTrachCan = true;
            //_trashCan.X = _itemView.X;
            //_trashCan.Y = _itemView.Y - _trashCan.Height - SmallSpacing/2;
            //AddChild(_trashCan);

            _bBack              = new UIButton("Back");
            _bBack.X            = _categoryView.X;
            _bBack.Y            = _categoryView.Y - _bBack.Height - Spacing;
            _bBack.onLeftClick += _bViewAllItems_onLeftClick;
            AddChild(_bBack);

            _bCollapseCategories              = new UIImage(_collapseTexture);
            _bCollapseCategories.X            = this.Width - _bCollapseCategories.Width - LargeSpacing;
            _bCollapseCategories.Y            = _categoryView.Y - _bCollapseCategories.Height - Spacing;
            _bCollapseCategories.onLeftClick += _bCollapseCategories_onLeftClick;
            AddChild(_bCollapseCategories);

            shownWidth  = _categoryView.X + _categoryView.Width + LargeSpacing;
            hiddenWidth = _itemView.X + _itemView.Width + LargeSpacing;

            //ParseList2();
            SelectedCategory = null;
        }
Example #32
0
        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;

            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;

            ResetTrackedObservables();
        }
Example #33
0
    void Awake()
    {
        _grayList.Clear();
        _greenList.Clear();
        _orangeList.Clear();
        _Container = transform.Find("PVPContainer");
        _close_Btn = _Container.Find("close_Btn").GetComponent <UIButton>();
        UIHelper.AddBtnClick(_close_Btn, OnClose);
        _namePanel = _Container.Find("panelName_Label").GetComponent <UILabel>();
        _grayList.Add(_namePanel);

        _info_Container = _Container.Find("info_Container");
        _rank_Btn       = _info_Container.Find("Btn_1/btn").GetComponent <UIButton>();
        _report_Btn     = _info_Container.Find("Btn_2/btn").GetComponent <UIButton>();
        _exchange_Btn   = _info_Container.Find("Btn_3/btn").GetComponent <UIButton>();
        _enemy_Btn      = _info_Container.Find("Btn_4/btn").GetComponent <UIButton>();
        UIHelper.AddBtnClick(_rank_Btn, OnRank);
        UIHelper.AddBtnClick(_report_Btn, OnReport);
        UIHelper.AddBtnClick(_exchange_Btn, OnExchage);
        UIHelper.AddBtnClick(_enemy_Btn, OnEnemy);

        _headIcon        = _info_Container.Find("headIcon_Bg/headIcon").GetComponent <UISprite>();
        _playLevel_Label = _info_Container.Find("headIcon_Bg/playLevel_Label").GetComponent <UILabel>();
        _grayList.Add(_playLevel_Label);
        _currentRank_Lable = _info_Container.Find("rank_bg/Label").GetComponent <UILabel>();
        _fight_Lable       = _info_Container.Find("fight_bg/Label").GetComponent <UILabel>();
        _rankReward_Label  = _info_Container.Find("rankReward_Label").GetComponent <UILabel>();
        _grayList.Add(_rankReward_Label);
        _rankRewardtimes_Label = _info_Container.Find("rankReward_Label/Label").GetComponent <UILabel>();
        _greenList.Add(_rankRewardtimes_Label);
        _record = _info_Container.Find("Label_1").GetComponent <UILabel>();
        _grayList.Add(_record);
        _recordValue = _info_Container.Find("Label_1/Label").GetComponent <UILabel>();
        _orangeList.Add(_recordValue);
        _diamond = _info_Container.Find("Label_2").GetComponent <UILabel>();
        _grayList.Add(_diamond);
        _diamondValue = _info_Container.Find("Label_2/Label").GetComponent <UILabel>();
        _orangeList.Add(_diamondValue);


        _play_Container = _Container.Find("play_Container");
        _times_Label    = _play_Container.Find("times_Label").GetComponent <UILabel>();
        _grayList.Add(_times_Label);
        _timesValue_Label = _play_Container.Find("times_Label/Label").GetComponent <UILabel>();
        _cd_Label         = _play_Container.Find("cd_Label").GetComponent <UILabel>();
        _grayList.Add(_cd_Label);
        _cdValue_Label = _play_Container.Find("cd_Label/Label").GetComponent <UILabel>();
        _greenList.Add(_cdValue_Label);

        _clear              = _Container.Find("clear_btn/Label").GetComponent <UILabel>();
        _clear.color        = UICommon.FONT_COLOR_GOLDEN;
        _refreshLabel       = _Container.Find("refresh_btn/refresh_Label").GetComponent <UILabel>();
        _refreshLabel.color = UICommon.FONT_COLOR_GOLDEN;
        _refreshtimes_Label = _Container.Find("refresh_btn/times_Label").GetComponent <UILabel>();
        _orangeList.Add(_refreshtimes_Label);
        _clear_btn = _Container.Find("clear_btn").GetComponent <UIButton>();
        UIHelper.AddBtnClick(_clear_btn, OnClear);
        _refresh_btn = _Container.Find("refresh_btn").GetComponent <UIButton>();
        UIHelper.AddBtnClick(_refresh_btn, OnRefresh);

        _Grid       = _play_Container.Find("ScrollView/Grid").GetComponent <UIGrid>();
        _scrollview = _play_Container.Find("ScrollView").GetComponent <UIScrollView>();
        foreach (UILabel label in _grayList)
        {
            label.color = UICommon.FONT_COLOR_GREY;
        }
        foreach (UILabel label in _greenList)
        {
            label.color = UICommon.FONT_COLOR_GREEN;
        }
        foreach (UILabel label in _orangeList)
        {
            label.color = UICommon.FONT_COLOR_ORANGE;
        }
    }
Example #34
0
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        NGUIEditorTools.SetLabelWidth(90f);

        string       fieldName = "Item Size";
        string       error     = null;
        UIScrollView sv        = null;

        if (!serializedObject.isEditingMultipleObjects)
        {
            UIWrapContent list = target as UIWrapContent;
            sv = NGUITools.FindInParents <UIScrollView>(list.gameObject);

            if (sv == null)
            {
                error = "UIWrappedList needs a Scroll View on its parent in order to work properly";
            }
            else if (sv.movement == UIScrollView.Movement.Horizontal)
            {
                fieldName = "Item Width";
            }
            else if (sv.movement == UIScrollView.Movement.Vertical)
            {
                fieldName = "Item Height";
            }
            else
            {
                error = "Scroll View needs to be using Horizontal or Vertical movement";
            }
        }

        serializedObject.Update();
        GUILayout.BeginHorizontal();
        NGUIEditorTools.DrawProperty(fieldName, serializedObject, "itemSize", GUILayout.Width(130f));
        GUILayout.Label("pixels");
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        SerializedProperty sp1 = NGUIEditorTools.DrawProperty("Range Limit", serializedObject, "minIndex", GUILayout.Width(130f));

        NGUIEditorTools.SetLabelWidth(20f);
        SerializedProperty sp2 = NGUIEditorTools.DrawProperty("to", serializedObject, "maxIndex", GUILayout.Width(60f));

        NGUIEditorTools.SetLabelWidth(90f);
        if (sp1.intValue == sp2.intValue)
        {
            GUILayout.Label("unlimited");
        }
        GUILayout.EndHorizontal();

        serializedObject.DrawProperty("hideInactive");

        NGUIEditorTools.DrawProperty("Cull Content", serializedObject, "cullContent");

        if (!string.IsNullOrEmpty(error))
        {
            EditorGUILayout.HelpBox(error, MessageType.Error);
            if (sv != null && GUILayout.Button("Select the Scroll View"))
            {
                Selection.activeGameObject = sv.gameObject;
            }
        }

        serializedObject.ApplyModifiedProperties();

        if (sp1.intValue != sp2.intValue)
        {
            if ((target as UIWrapContent).GetComponent <UICenterOnChild>() != null)
            {
                EditorGUILayout.HelpBox("Limiting indices doesn't play well with UICenterOnChild. You should either not limit the indices, or not use UICenterOnChild.", MessageType.Warning);
            }
        }
    }
Example #35
0
 public override void Scrolled(UIScrollView scrollView)
 {
     ScrolledEvent?.Invoke(this, scrollView);
 }
 private UIView GetZoomSubView(UIScrollView scrollView)
 {
     return(scrollView.Subviews?.FirstOrDefault());
 }
Example #37
0
 public void DidEndDecelerating(UIScrollView scrollView)
 {
     ((PeopleGroupsDataSource)tableView.DataSource).LoadImagesForOnscreenRows(tableView);
 }
Example #38
0
 public void UpdateScrollSprites(UIScrollView scrollView, float scrollPosition, bool isScrollable)
 {
 }
Example #39
0
 void Init()
 {
     mInitDone = true;
     mPanel    = NGUITools.FindInParents <UIPanel>(gameObject);
     mDrag     = NGUITools.FindInParents <UIScrollView>(gameObject);
 }
Example #40
0
 public void InitScrollSprites(UXFactory source, UIScrollView scrollView, float scrollPosition, bool isScrollable)
 {
 }
 public override void DidZoom(UIScrollView scrollView)
 {
     // Note: untested, more may be needed to support zooming. On ScrollContentPresenter we set ViewForZoomingInScrollView (not
     // obvious what it would be in the case of a list).
     Owner.XamlParent?.ScrollViewer?.OnZoomInternal((float)Owner.ZoomScale);
 }
Example #42
0
 public override void DecelerationEnded(UIScrollView scrollView)
 {
     UpdateCurrentPage(scrollView);
 }
 // Called when user starts dragging
 public override void DraggingStarted(UIScrollView scrollView)
 {
     _isInAnimatedScroll = true;
 }
Example #44
0
        public static void KeyboardWillShow(this NSNotification notification, ref bool keyboardIsShown, UIScrollView containerView)
        {
            if (keyboardIsShown)
            {
                return;
            }

            var keyboardFrame = UIKeyboard.FrameEndFromNotification(notification);

            Action animation = () => {
                containerView.SetContentOffset(new CGPoint(containerView.ContentOffset.X, containerView.ContentOffset.Y + keyboardFrame.Height - 30), true);
            };

            UIScrollView.Animate(200d, 0d, UIViewAnimationOptions.CurveLinear, animation, null);

            keyboardIsShown = true;
        }
Example #45
0
        public void loadOptionView()
        {
            //PrecisionButton
            precisionButton = new UIButton();
            precisionButton.SetTitle("Standard", UIControlState.Normal);
            precisionButton.Font = UIFont.FromName("Helvetica", 14f);
            precisionButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            precisionButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            precisionButton.Layer.CornerRadius  = 8;
            precisionButton.Layer.BorderWidth   = 2;
            precisionButton.TouchUpInside      += ShowPicker1;
            precisionButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //TooltipButton
            toolTipButton = new UIButton();
            toolTipButton.SetTitle("None", UIControlState.Normal);
            toolTipButton.Font = UIFont.FromName("Helvetica", 14f);
            toolTipButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            toolTipButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            toolTipButton.Layer.CornerRadius  = 8;
            toolTipButton.Layer.BorderWidth   = 2;
            toolTipButton.TouchUpInside      += ShowPicker2;
            toolTipButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //DoneButton
            doneButton.SetTitle("Done\t", UIControlState.Normal);
            doneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            doneButton.Font            = UIFont.FromName("Helvetica", 14f);
            doneButton.TouchUpInside  += HidePicker;
            doneButton.Hidden          = true;
            doneButton.BackgroundColor = UIColor.FromRGB(240, 240, 240);

            //Picker
            precisionPicker       = new UIPickerView();
            toolTipPicker         = new UIPickerView();
            model                 = new PickerModel(precisionList);
            precisionPicker.Model = model;
            model1                = new PickerModel(toottipplace);
            toolTipPicker.Model   = model1;
            model.PickerChanged  += SelectedIndexChanged;
            model1.PickerChanged += SelectedIndexChanged1;
            precisionPicker.ShowSelectionIndicator = true;
            precisionPicker.Hidden               = true;
            toolTipPicker.Hidden                 = true;
            precisionPicker.BackgroundColor      = UIColor.Gray;
            toolTipPicker.BackgroundColor        = UIColor.Gray;
            toolTipPicker.ShowSelectionIndicator = true;

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

            //adding to controlView
            controlView.AddSubview(rating1);
            controlView.AddSubview(rating2);
            controlView.AddSubview(movieRateLabel);
            controlView.AddSubview(walkLabel);
            controlView.AddSubview(timeLabel);
            controlView.AddSubview(descriptionLabel);
            controlView.AddSubview(rateLabel);
            controlView.AddSubview(valueLabel);
            controlView.AddSubview(image1);
            controlView.AddSubview(itemCountTextfield);
            this.AddSubview(controlView);

            //Adding to content view
            contentView.AddSubview(precisionLabel);
            contentView.AddSubview(toolTipLabel);
            contentView.AddSubview(precisionButton);
            contentView.AddSubview(itemCountLabel);
            contentView.AddSubview(toolTipButton);
            contentView.AddSubview(precisionPicker);
            contentView.AddSubview(toolTipPicker);
            contentView.AddSubview(doneButton);
            contentView.AddSubview(itemCountTextfield);
            contentView.BackgroundColor = UIColor.FromRGB(240, 240, 240);


            //PropertyLabel
            propertiesLabel      = new UILabel();
            propertiesLabel.Text = " OPTIONS";


            //ShowpropertyButton
            showPropertyButton        = new UIButton();
            showPropertyButton.Hidden = true;
            showPropertyButton.SetTitle("OPTIONS\t", UIControlState.Normal);
            showPropertyButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            showPropertyButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            showPropertyButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            showPropertyButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                subView.Hidden            = false;
                showPropertyButton.Hidden = true;
            };
            this.AddSubview(showPropertyButton);

            //CloseButton
            closeButton = new UIButton();
            closeButton.SetTitle("X\t", UIControlState.Normal);
            closeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            closeButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            closeButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            closeButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                subView.Hidden            = true;
                showPropertyButton.Hidden = false;
            };


            //AddingGesture
            UITapGestureRecognizer tapgesture = new UITapGestureRecognizer(() =>
            {
                subView.Hidden            = true;
                showPropertyButton.Hidden = false;
            }
                                                                           );

            propertiesLabel.UserInteractionEnabled = true;
            propertiesLabel.AddGestureRecognizer(tapgesture);

            //Adding to subvieww
            subView             = new UIScrollView();
            subView.ContentSize = new CGSize(Frame.Width, 350);
            subView.AddSubview(contentView);
            subView.AddSubview(propertiesLabel);
            subView.AddSubview(closeButton);
            subView.BackgroundColor = UIColor.FromRGB(230, 230, 230);
            this.AddSubview(subView);
        }
 // Called at the end of a programmatic animated scroll
 public override void ScrollAnimationEnded(UIScrollView scrollView)
 {
     OnAnimatedScrollEnded();
 }
Example #47
0
 public ScrollViewTouchesManager(UIScrollView scrollView)
 {
     _scrollView = scrollView;
 }
 public override void Scrolled(UIScrollView scrollView)
 {
     InvokeOnScroll();
 }
Example #49
0
 public static void registEvent(UIScrollView uIScrollView, Action function)
 {
     uIScrollView.onScrolled = new UIScrollView.OnDragNotification(function);
 }
Example #50
0
        public Pointers()
        {
            scroll = new UIScrollView();
            gauge1 = new SFCircularGauge();
            SFGaugeHeader header1 = new SFGaugeHeader();

            header1.Position  = new CGPoint(0.5, 0.6);
            header1.TextStyle = UIFont.SystemFontOfSize(14);
            header1.Text      = (Foundation.NSString) "Inverted Triangle";
            header1.TextColor = UIColor.Black;
            gauge1.Headers.Add(header1);

            SFCircularScale scale1 = new SFCircularScale();

            scale1.StartAngle            = 90;
            scale1.SweepAngle            = 270;
            scale1.ScaleStartOffset      = 0.7f;
            scale1.ScaleEndOffSet        = 0.68f;
            scale1.StartValue            = 0;
            scale1.EndValue              = 100;
            scale1.RimColor              = UIColor.Gray;
            scale1.Interval              = 50;
            scale1.ShowLabels            = false;
            scale1.ShowTicks             = false;
            scale1.MinorTicksPerInterval = 0;

            SFMarkerPointer pointer1 = new SFMarkerPointer();

            pointer1.Value       = 80;
            pointer1.Offset      = 0.7f;
            pointer1.MarkerShape = MarkerShape.InvertedTriangle;
            pointer1.Color       = UIColor.FromRGB(0, 180, 174);
            scale1.Pointers.Add(pointer1);

            gauge1.Scales.Add(scale1);


            gauge2 = new SFCircularGauge();
            SFGaugeHeader header2 = new SFGaugeHeader();

            header2.Position  = new CGPoint(0.5, 0.6);
            header2.TextStyle = UIFont.SystemFontOfSize(14);
            header2.Text      = (Foundation.NSString) "Triangle";
            header2.TextColor = UIColor.Black;
            gauge2.Headers.Add(header2);

            SFCircularScale scale2 = new SFCircularScale();

            scale2.StartAngle            = 90;
            scale2.SweepAngle            = 270;
            scale2.ScaleStartOffset      = 0.7f;
            scale2.ScaleEndOffSet        = 0.68f;
            scale2.StartValue            = 0;
            scale2.EndValue              = 100;
            scale2.RimColor              = UIColor.Gray;
            scale2.Interval              = 50;
            scale2.ShowLabels            = false;
            scale2.ShowTicks             = false;
            scale2.MinorTicksPerInterval = 0;

            SFMarkerPointer pointer2 = new SFMarkerPointer();

            pointer2.Value       = 80;
            pointer2.Offset      = 0.68f;
            pointer2.MarkerShape = MarkerShape.Triangle;
            pointer2.Color       = UIColor.Green;
            scale2.Pointers.Add(pointer2);

            gauge2.Scales.Add(scale2);

            gauge3 = new SFCircularGauge();
            SFGaugeHeader header3 = new SFGaugeHeader();

            header3.Position  = new CGPoint(0.5, 0.6);
            header3.TextStyle = UIFont.SystemFontOfSize(14);
            header3.Text      = (Foundation.NSString) "Range Pointer";
            header3.TextColor = UIColor.Black;
            gauge3.Headers.Add(header3);

            SFCircularScale scale3 = new SFCircularScale();

            scale3.StartAngle            = 90;
            scale3.SweepAngle            = 270;
            scale3.ScaleStartOffset      = 0.7f;
            scale3.ScaleEndOffSet        = 0.68f;
            scale3.StartValue            = 0;
            scale3.EndValue              = 100;
            scale3.RimColor              = UIColor.Gray;
            scale3.Interval              = 50;
            scale3.ShowLabels            = false;
            scale3.ShowTicks             = false;
            scale3.MinorTicksPerInterval = 0;

            SFRangePointer pointer3 = new SFRangePointer();

            pointer3.Value  = 60;
            pointer3.Offset = 0.6f;
            pointer3.Width  = 15;
            pointer3.Color  = UIColor.FromRGB(255, 38, 128);
            scale3.Pointers.Add(pointer3);
            gauge3.Scales.Add(scale3);


            gauge4 = new SFCircularGauge();
            SFGaugeHeader header4 = new SFGaugeHeader();

            header4.Position  = new CGPoint(0.5, 0.7);
            header4.TextStyle = UIFont.SystemFontOfSize(14);
            header4.Text      = (Foundation.NSString) "Multiple Needle";
            header4.TextColor = UIColor.Black;
            gauge4.Headers.Add(header4);

            SFCircularScale scale4 = new SFCircularScale();

            scale4.StartAngle            = 90;
            scale4.SweepAngle            = 270;
            scale4.ScaleStartOffset      = 0.7f;
            scale4.ScaleEndOffSet        = 0.68f;
            scale4.StartValue            = 0;
            scale4.EndValue              = 100;
            scale4.RimColor              = UIColor.Gray;
            scale4.Interval              = 50;
            scale4.ShowLabels            = false;
            scale4.ShowTicks             = false;
            scale4.MinorTicksPerInterval = 0;


            SFNeedlePointer pointer4 = new SFNeedlePointer();

            pointer4.Value        = 80;
            pointer4.Color        = UIColor.Purple;
            pointer4.LengthFactor = 0.7f;
            pointer4.KnobRadius   = 0;
            pointer4.Width        = 10;
            pointer4.PointerType  = SFCiruclarGaugePointerType.SFCiruclarGaugePointerTypeTriangle;
            scale4.Pointers.Add(pointer4);

            gauge4.Scales.Add(scale4);

            gauge5 = new SFCircularGauge();
            SFGaugeHeader header5 = new SFGaugeHeader();

            header5.Position  = new CGPoint(0.5, 0.6);
            header5.TextStyle = UIFont.SystemFontOfSize(14);
            header5.Text      = (Foundation.NSString) "Needle Pointer";
            header5.TextColor = UIColor.Black;
            gauge5.Headers.Add(header5);

            SFCircularScale scale5 = new SFCircularScale();

            scale5.StartAngle            = 90;
            scale5.SweepAngle            = 270;
            scale5.ScaleStartOffset      = 0.7f;
            scale5.ScaleEndOffSet        = 0.68f;
            scale5.StartValue            = 0;
            scale5.EndValue              = 100;
            scale5.RimColor              = UIColor.Gray;
            scale5.Interval              = 50;
            scale5.ShowLabels            = false;
            scale5.ShowTicks             = false;
            scale5.MinorTicksPerInterval = 0;


            SFNeedlePointer pointer5 = new SFNeedlePointer();

            pointer5.Value            = 40;
            pointer5.Color            = UIColor.Purple;
            pointer5.LengthFactor     = 0.5f;
            pointer5.KnobRadiusFactor = 0.05f;
            pointer5.Width            = 10;
            pointer5.KnobColor        = UIColor.White;
            pointer5.KnobStrokeColor  = UIColor.FromRGB(237, 125, 49);
            pointer5.KnobStrokeWidth  = 2f;
            pointer5.TailLengthFactor = 0.2f;
            pointer5.TailColor        = UIColor.FromRGB(237, 125, 49);
            pointer5.TailStrokeColor  = UIColor.FromRGB(237, 125, 49);
            pointer5.PointerType      = SFCiruclarGaugePointerType.SFCiruclarGaugePointerTypeTriangle;
            scale5.Pointers.Add(pointer5);

            SFNeedlePointer pointer6 = new SFNeedlePointer();

            pointer6.Value            = 70;
            pointer6.Color            = UIColor.Purple;
            pointer6.LengthFactor     = 0.6f;
            pointer6.KnobRadiusFactor = 0.05f;
            pointer6.Width            = 10;
            pointer6.KnobColor        = UIColor.White;
            pointer6.KnobStrokeColor  = UIColor.FromRGB(237, 125, 49);
            pointer6.KnobStrokeWidth  = 2f;
            pointer6.TailLengthFactor = 0.25f;
            pointer6.TailColor        = UIColor.FromRGB(237, 125, 49);
            pointer6.TailStrokeColor  = UIColor.FromRGB(237, 125, 49);
            pointer6.PointerType      = SFCiruclarGaugePointerType.SFCiruclarGaugePointerTypeTriangle;
            scale5.Pointers.Add(pointer6);

            gauge5.Scales.Add(scale5);

            scroll.AddSubview(gauge1);
            scroll.AddSubview(gauge2);
            scroll.AddSubview(gauge3);
            scroll.AddSubview(gauge4);
            scroll.AddSubview(gauge5);

            this.AddSubview(scroll);
        }
Example #51
0
    /// <summary>
    /// Cache the transform.
    /// </summary>

    void Start()
    {
        mPanel = GetComponent <UIPanel>();
        mDrag  = GetComponent <UIScrollView>();
        mTrans = transform;
    }
Example #52
0
        public TicketBooking()
        {
            maps         = new SFMap();
            view         = new UIView();
            container    = new UIView();
            subcontainer = new UIView();
            LayoutA      = new UIView();
            LayoutB      = new UIView();
            LayoutC      = new UIView();
            LayoutD      = new UIView();

            button1    = new UIButton();
            button2    = new UIButton();
            button3    = new UIButton();
            button4    = new UIButton();
            label1     = new UILabel();
            label2     = new UILabel();
            label3     = new UILabel();
            label4     = new UILabel();
            label5     = new UILabel();
            text1      = new UITextView();
            scrollView = new UIScrollView();


            view.BackgroundColor = UIColor.White;

            NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(0.3), delegate
            {
                container.AddSubview(maps);
            });



            view.Frame          = new CGRect(0, 0, 300, 400);
            label               = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Ticketing System";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new CGRect(0, 0, 300, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            //container.BackgroundColor = UIColor.Red;
            container.Layer.CornerRadius = 5;
            container.Layer.BorderWidth  = 3;
            container.Layer.BorderColor  = UIColor.Gray.CGColor;


            layer = new SFShapeFileLayer();
            layer.ShapeSettings.SelectedShapeColor = UIColor.FromRGB(98, 170, 95);
            layer.Uri             = (NSString)NSBundle.MainBundle.PathForResource("Custom", "shp");
            layer.EnableSelection = true;
            layer.ShapeSettings.SelectedShapeStrokeThickness = 0;
            layer.DataSource = GetDataSource();

            SetColorMapping(layer.ShapeSettings);
            layer.GeometryType  = SFGeometryType.SFGeometryTypePoints;
            layer.SelectionMode = SFSelectionMode.SFSelectionModeMultiple;
            layer.ShapeIDPath   = (NSString)"SeatNumber";
            layer.ShapeSettings.ColorValuePath = (NSString)"SeatNumber";

            layer.ShapeSettings.valuePath = (NSString)"SeatNumber";
            layer.ShapeSettings.Fill      = UIColor.Gray;
            layer.ShapeIDTableField       = (NSString)"seatno";


            maps.Delegate = new MapsCustomDelegate(this, layer);
            maps.Layers.Add(layer);
            container.Add(maps);

            view.Add(container);



            subcontainer.BackgroundColor    = UIColor.White;
            subcontainer.Layer.CornerRadius = 5;

            //LayoutA.BackgroundColor = UIColor.Green;
            LayoutA.Layer.CornerRadius = 5;
            button1.BackgroundColor    = UIColor.Gray;
            button1.Layer.CornerRadius = 5;


            LayoutA.Add(button1);
            label1.Text      = "Available";
            label1.Font      = UIFont.SystemFontOfSize(12);
            label1.TextColor = UIColor.Black;

            LayoutA.Add(label1);
            subcontainer.Add(LayoutA);



            //LayoutB.BackgroundColor = UIColor.Purple;
            LayoutB.Layer.CornerRadius = 5;
            button2.BackgroundColor    = UIColor.FromRGB(98, 170, 95);
            button2.Layer.CornerRadius = 5;
            LayoutB.Add(button2);
            label2.Text      = "Selected";
            label2.TextColor = UIColor.Black;
            label2.Font      = UIFont.SystemFontOfSize(12);
            LayoutB.Add(label2);
            subcontainer.Add(LayoutB);



            LayoutC.Layer.CornerRadius = 5;
            button3.BackgroundColor    = UIColor.FromRGB(255, 165, 0);
            button3.Layer.CornerRadius = 5;
            LayoutC.Add(button3);
            label3.Text      = "Booked";
            label3.TextColor = UIColor.Black;
            label3.Font      = UIFont.SystemFontOfSize(12);
            LayoutC.Add(label3);
            subcontainer.Add(LayoutC);


            LayoutD.BackgroundColor    = UIColor.Gray;
            LayoutD.Layer.CornerRadius = 5;
            subcontainer.Add(LayoutD);

            label4.Text          = "Seats Selected";
            label4.TextAlignment = UITextAlignment.Center;
            label4.TextColor     = UIColor.Blue;
            label4.Font          = UIFont.SystemFontOfSize(12);
            subcontainer.Add(label4);

            label5.Text          = "";
            label5.TextAlignment = UITextAlignment.Left;
            label5.TextColor     = UIColor.Black;
            label5.Font          = UIFont.SystemFontOfSize(20);
            subcontainer.Add(label5);



            text1.Text = "";
            //text1.BackgroundColor = UIColor.Blue;
            text1.TextAlignment = UITextAlignment.Center;
            text1.TextColor     = UIColor.Black;
            text1.Font          = UIFont.SystemFontOfSize(12);

            subcontainer.Add(text1);



            button4.BackgroundColor    = UIColor.Clear;
            button4.Enabled            = false;
            button4.Alpha              = (float)0.5;
            button4.Layer.CornerRadius = 5;
            button4.Layer.BorderColor  = UIColor.Gray.CGColor;
            button4.Layer.BorderWidth  = 2;
            button4.SetTitle("Clear Selection", UIControlState.Normal);
            button4.SetTitleColor(UIColor.Red, UIControlState.Normal);
            button4.TouchDown += (sender, e) => {
                layer.SelectedItems = new NSMutableArray();
                button4.Enabled     = false;
                button4.Alpha       = (float)0.5;
                label5.Text         = " ";
                text1.Text          = " ";
            };
            subcontainer.Add(button4);


            view.Add(subcontainer);



            AddSubview(view);
        }
Example #53
0
    public void Recenter()
    {
        if (this.mScrollView == (UnityEngine.Object)null)
        {
            this.mScrollView = NGUITools.FindInParents <UIScrollView>(base.gameObject);
            if (this.mScrollView == (UnityEngine.Object)null)
            {
                global::Debug.LogWarning(String.Concat(new Object[]
                {
                    base.GetType(),
                    " requires ",
                    typeof(UIScrollView),
                    " on a parent object in order to work"
                }), this);
                base.enabled = false;
                return;
            }
            if (this.mScrollView)
            {
                this.mScrollView.centerOnChild = this;
                UIScrollView uiscrollView = this.mScrollView;
                uiscrollView.onDragFinished = (UIScrollView.OnDragNotification)Delegate.Combine(uiscrollView.onDragFinished, new UIScrollView.OnDragNotification(this.OnDragFinished));
            }
            if (this.mScrollView.horizontalScrollBar != (UnityEngine.Object)null)
            {
                UIProgressBar horizontalScrollBar = this.mScrollView.horizontalScrollBar;
                horizontalScrollBar.onDragFinished = (UIProgressBar.OnDragFinished)Delegate.Combine(horizontalScrollBar.onDragFinished, new UIProgressBar.OnDragFinished(this.OnDragFinished));
            }
            if (this.mScrollView.verticalScrollBar != (UnityEngine.Object)null)
            {
                UIProgressBar verticalScrollBar = this.mScrollView.verticalScrollBar;
                verticalScrollBar.onDragFinished = (UIProgressBar.OnDragFinished)Delegate.Combine(verticalScrollBar.onDragFinished, new UIProgressBar.OnDragFinished(this.OnDragFinished));
            }
        }
        if (this.mScrollView.panel == (UnityEngine.Object)null)
        {
            return;
        }
        Transform transform = base.transform;

        if (transform.childCount == 0)
        {
            return;
        }
        Vector3[]        worldCorners = this.mScrollView.panel.worldCorners;
        Vector3          vector       = (worldCorners[2] + worldCorners[0]) * 0.5f;
        Vector3          vector2      = this.mScrollView.currentMomentum * this.mScrollView.momentumAmount;
        Vector3          a            = NGUIMath.SpringDampen(ref vector2, 9f, 2f);
        Vector3          b            = vector - a * 0.01f;
        Single           num          = Single.MaxValue;
        Transform        target       = (Transform)null;
        Int32            index        = 0;
        Int32            num2         = 0;
        UIGrid           component    = base.GetComponent <UIGrid>();
        List <Transform> list         = null;

        if (component != (UnityEngine.Object)null)
        {
            list = component.GetChildList();
            Int32 i     = 0;
            Int32 count = list.Count;
            Int32 num3  = 0;
            while (i < count)
            {
                Transform transform2 = list[i];
                if (transform2.gameObject.activeInHierarchy)
                {
                    Single num4 = Vector3.SqrMagnitude(transform2.position - b);
                    if (num4 < num)
                    {
                        num    = num4;
                        target = transform2;
                        index  = i;
                        num2   = num3;
                    }
                    num3++;
                }
                i++;
            }
        }
        else
        {
            Int32 j          = 0;
            Int32 childCount = transform.childCount;
            Int32 num5       = 0;
            while (j < childCount)
            {
                Transform child = transform.GetChild(j);
                if (child.gameObject.activeInHierarchy)
                {
                    Single num6 = Vector3.SqrMagnitude(child.position - b);
                    if (num6 < num)
                    {
                        num    = num6;
                        target = child;
                        index  = j;
                        num2   = num5;
                    }
                    num5++;
                }
                j++;
            }
        }
        if (this.nextPageThreshold > 0f && UICamera.currentTouch != null && this.mCenteredObject != (UnityEngine.Object)null && this.mCenteredObject.transform == ((list == null) ? transform.GetChild(index) : list[index]))
        {
            Vector3 point = UICamera.currentTouch.totalDelta;
            point = base.transform.rotation * point;
            UIScrollView.Movement movement = this.mScrollView.movement;
            Single num7;
            if (movement != UIScrollView.Movement.Horizontal)
            {
                if (movement != UIScrollView.Movement.Vertical)
                {
                    num7 = point.magnitude;
                }
                else
                {
                    num7 = point.y;
                }
            }
            else
            {
                num7 = point.x;
            }
            if (Mathf.Abs(num7) > this.nextPageThreshold)
            {
                if (num7 > this.nextPageThreshold)
                {
                    if (list != null)
                    {
                        if (num2 > 0)
                        {
                            target = list[num2 - 1];
                        }
                        else
                        {
                            target = ((!(base.GetComponent <UIWrapContent>() == (UnityEngine.Object)null)) ? list[list.Count - 1] : list[0]);
                        }
                    }
                    else if (num2 > 0)
                    {
                        target = transform.GetChild(num2 - 1);
                    }
                    else
                    {
                        target = ((!(base.GetComponent <UIWrapContent>() == (UnityEngine.Object)null)) ? transform.GetChild(transform.childCount - 1) : transform.GetChild(0));
                    }
                }
                else if (num7 < -this.nextPageThreshold)
                {
                    if (list != null)
                    {
                        if (num2 < list.Count - 1)
                        {
                            target = list[num2 + 1];
                        }
                        else
                        {
                            target = ((!(base.GetComponent <UIWrapContent>() == (UnityEngine.Object)null)) ? list[0] : list[list.Count - 1]);
                        }
                    }
                    else if (num2 < transform.childCount - 1)
                    {
                        target = transform.GetChild(num2 + 1);
                    }
                    else
                    {
                        target = ((!(base.GetComponent <UIWrapContent>() == (UnityEngine.Object)null)) ? transform.GetChild(0) : transform.GetChild(transform.childCount - 1));
                    }
                }
            }
        }
        this.CenterOn(target, vector);
    }
Example #54
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:SampleBrowser.LoadMoreSample"/> class.
        /// </summary>
        public LoadMoreSample()
        {
            carouselScrollview = new UIScrollView();
            alertWindow        = new UIAlertView();
            alertWindow.AddButton("OK");
            carouselViewModel = new CarouselViewModel();

            LoadMoreLayout = new UIView();
            LoadMoreLayout.BackgroundColor     = UIColor.FromRGB(249, 249, 249);
            carouselScrollview.BackgroundColor = UIColor.FromRGB(249, 249, 249);
            applicationLabel           = new UILabel();
            applicationLabel.Text      = "Application";
            applicationLabel.TextColor = UIColor.FromRGBA(nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse("0.9764705882352941"));
            applicationLabel.Font      = UIFont.FromName("Helvetica", 18f);

            applicationCarousel                    = new SfCarousel();
            applicationCarousel.ItemWidth          = 150;
            applicationCarousel.ItemHeight         = 150;
            applicationCarousel.AllowLoadMore      = true;
            applicationCarousel.LoadMoreItemsCount = 4;
            UILabel loadmore2 = new UILabel()
            {
                TextColor = UIColor.Black, Text = "Load More...", Font = UIFont.FromName("Helvetica-Bold", 13f), TextAlignment = UITextAlignment.Center
            };

            loadmore2.Frame = new CoreGraphics.CGRect(12, 61, 150, 17);
            UIView loadView2 = new UIView();

            loadView2.BackgroundColor = UIColor.FromRGB(255, 255, 255);
            loadView2.AddSubview(loadmore2);
            applicationCarousel.LoadMoreView = loadView2;
            applicationCarousel.ViewMode     = SFCarouselViewMode.SFCarouselViewModeLinear;
            applicationCarousel.ItemsSource  = carouselViewModel.ApplicationCollection;
            applicationCarousel.ItemSpacing  = 15;
            applicationCarousel.DrawView    += DrawAdapterView;

            foodLabel           = new UILabel();
            foodLabel.Text      = "Food";
            foodLabel.TextColor = UIColor.FromRGBA(nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse("0.9764705882352941"));
            foodLabel.Font      = UIFont.FromName("Helvetica", 18f);

            foodCarousel                    = new SfCarousel();
            foodCarousel.ItemWidth          = 150;
            foodCarousel.ItemHeight         = 150;
            foodCarousel.AllowLoadMore      = true;
            foodCarousel.LoadMoreItemsCount = 4;
            UILabel loadmore = new UILabel()
            {
                TextColor = UIColor.Black, Text = "Load More...", Font = UIFont.FromName("Helvetica-Bold", 13f), TextAlignment = UITextAlignment.Center
            };
            UIView loadView = new UIView();

            loadmore.Frame           = new CoreGraphics.CGRect(12, 61, 150, 17);
            loadView.BackgroundColor = UIColor.FromRGB(255, 255, 255);
            loadView.AddSubview(loadmore);
            foodCarousel.LoadMoreView = loadView;

            foodCarousel.ItemSpacing = 15;
            foodCarousel.ViewMode    = SFCarouselViewMode.SFCarouselViewModeLinear;
            foodCarousel.ItemsSource = carouselViewModel.TransportCollection;
            foodCarousel.DrawView   += DrawFoodAdapterView;

            LoadMoreLayout.AddSubview(applicationLabel);
            LoadMoreLayout.AddSubview(applicationCarousel);
            LoadMoreLayout.AddSubview(foodLabel);
            LoadMoreLayout.AddSubview(foodCarousel);

            bankingLabel           = new UILabel();
            bankingLabel.Text      = "Banking";
            bankingLabel.TextColor = UIColor.FromRGBA(nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse((51 / 255.0).ToString()), nfloat.Parse("0.9764705882352941"));
            bankingLabel.Font      = UIFont.FromName("Helvetica", 18f);

            bankCarousel                    = new SfCarousel();
            bankCarousel.ItemWidth          = 150;
            bankCarousel.ItemHeight         = 150;
            bankCarousel.AllowLoadMore      = true;
            bankCarousel.LoadMoreItemsCount = 4;
            UILabel loadmore1 = new UILabel()
            {
                TextColor = UIColor.Black, Text = "Load More...", Font = UIFont.FromName("Helvetica-Bold", 13f), TextAlignment = UITextAlignment.Center
            };
            UIView loadView1 = new UIView();

            loadmore1.Frame           = new CoreGraphics.CGRect(12, 61, 150, 17);
            loadView1.BackgroundColor = UIColor.FromRGB(255, 255, 255);
            loadView1.AddSubview(loadmore1);
            bankCarousel.LoadMoreView = loadView1;

            bankCarousel.ItemSpacing = 15;
            bankCarousel.ViewMode    = SFCarouselViewMode.SFCarouselViewModeLinear;
            bankCarousel.ItemsSource = carouselViewModel.OfficeCollection;
            bankCarousel.DrawView   += DrawBankAdapterView;

            LoadMoreLayout.AddSubview(applicationLabel);
            LoadMoreLayout.AddSubview(applicationCarousel);
            LoadMoreLayout.AddSubview(foodLabel);
            LoadMoreLayout.AddSubview(foodCarousel);
            LoadMoreLayout.AddSubview(bankingLabel);
            LoadMoreLayout.AddSubview(bankCarousel);


            carouselScrollview.AddSubview(LoadMoreLayout);
            this.AddSubview(carouselScrollview);
        }
Example #55
0
 public override void DraggingEnded(UIScrollView scrollView, bool willDecelerate)
 {
     Carousel.SetIsDragging(false);
     _isDragging = false;
 }
Example #56
0
 public override bool ShouldScrollToTop(UIScrollView scrollView) => true;
 public override void Scrolled(UIScrollView scrollView)
 {
     UpdateCachedAssets();
 }
Example #58
0
 public static void BeginRefreshingWithBugFix(this UIRefreshControl refreshControl, UIScrollView tableViewToAdjust)
 {
     CoreUtility.ExecuteMethod("BeginRefreshingWithBugFix", delegate()
     {
         if (refreshControl != null)
         {
             refreshControl.BeginRefreshing();
             if (tableViewToAdjust.ContentOffset.Y == 0)
             {
                 UIView.Animate(.25, delegate()
                 {
                     tableViewToAdjust.ContentOffset = new CGPoint(0, -refreshControl.Frame.Size.Height);
                 });
             }
         }
     });
 }
        public FeedCellBuilder(UIView contentView)
        {
            _contentView = contentView;

            _moreButton       = new UIButton();
            _moreButton.Frame = new CGRect(_contentView.Frame.Width - moreButtonWidth, 0, moreButtonWidth, likeButtonWidthConst);
            _moreButton.SetImage(UIImage.FromBundle("ic_more"), UIControlState.Normal);
            //_moreButton.BackgroundColor = UIColor.Black;
            _contentView.AddSubview(_moreButton);

            _avatarImage = new UIImageView(new CGRect(leftMargin, 20, 30, 30));
            _contentView.AddSubview(_avatarImage);

            var authorX = _avatarImage.Frame.Right + 10;

            _author      = new UILabel(new CGRect(authorX, _avatarImage.Frame.Top - 2, _moreButton.Frame.Left - authorX, 18));
            _author.Font = Constants.Semibold14;
            //_author.BackgroundColor = UIColor.Yellow;
            _author.LineBreakMode = UILineBreakMode.TailTruncation;
            _author.TextColor     = Constants.R15G24B30;
            _contentView.AddSubview(_author);

            _timestamp      = new UILabel(new CGRect(authorX, _author.Frame.Bottom, _moreButton.Frame.Left - authorX, 16));
            _timestamp.Font = Constants.Regular12;
            //_timestamp.BackgroundColor = UIColor.Green;
            _timestamp.LineBreakMode = UILineBreakMode.TailTruncation;
            _timestamp.TextColor     = Constants.R151G155B158;
            _contentView.AddSubview(_timestamp);

            _photoScroll = new UIScrollView();
            _photoScroll.ShowsHorizontalScrollIndicator = false;
            _photoScroll.Bounces       = false;
            _photoScroll.PagingEnabled = true;
            contentView.AddSubview(_photoScroll);

            _likes                        = new UILabel();
            _likes.Font                   = Constants.Semibold14;
            _likes.LineBreakMode          = UILineBreakMode.TailTruncation;
            _likes.TextColor              = Constants.R15G24B30;
            _likes.UserInteractionEnabled = true;
            _contentView.AddSubview(_likes);

            _flags      = new UILabel();
            _flags.Font = Constants.Semibold14;
            //_flags.BackgroundColor = UIColor.Orange;
            _flags.LineBreakMode          = UILineBreakMode.TailTruncation;
            _flags.TextColor              = Constants.R15G24B30;
            _flags.UserInteractionEnabled = true;
            _contentView.AddSubview(_flags);

            _rewards      = new UILabel();
            _rewards.Font = Constants.Semibold14;
            //_rewards.BackgroundColor = UIColor.Orange;
            _rewards.LineBreakMode          = UILineBreakMode.TailTruncation;
            _rewards.TextColor              = Constants.R15G24B30;
            _rewards.UserInteractionEnabled = true;
            _contentView.AddSubview(_rewards);

            _like             = new UIImageView();
            _like.ContentMode = UIViewContentMode.Center;
            _contentView.AddSubview(_like);

            _verticalSeparator = new UIView();
            _verticalSeparator.BackgroundColor = Constants.R244G244B246;
            _contentView.AddSubview(_verticalSeparator);

            _topSeparator = new UIView();
            _topSeparator.BackgroundColor = Constants.R244G244B246;
            _contentView.AddSubview(_topSeparator);

            _attributedLabel = new TTTAttributedLabel();
            _attributedLabel.EnabledTextCheckingTypes = NSTextCheckingType.Link;
            var prop = new NSDictionary();

            _attributedLabel.LinkAttributes       = prop;
            _attributedLabel.ActiveLinkAttributes = prop;
            _attributedLabel.Font  = Constants.Regular14;
            _attributedLabel.Lines = 0;
            _attributedLabel.UserInteractionEnabled = true;
            _attributedLabel.Enabled = true;
            //_attributedLabel.BackgroundColor = UIColor.Blue;
            _contentView.AddSubview(_attributedLabel);

            _comments      = new UILabel();
            _comments.Font = Constants.Regular14;
            //_comments.BackgroundColor = UIColor.DarkGray;
            _comments.LineBreakMode          = UILineBreakMode.TailTruncation;
            _comments.TextColor              = Constants.R151G155B158;
            _comments.UserInteractionEnabled = true;
            _comments.TextAlignment          = UITextAlignment.Center;
            _contentView.AddSubview(_comments);

            _bottomSeparator = new UIView();
            _bottomSeparator.BackgroundColor = Constants.R244G244B246;
            _contentView.AddSubview(_bottomSeparator);

            _profileTapView = new UIView(new CGRect(0, 0, UIScreen.MainScreen.Bounds.Width / 2, likeButtonWidthConst));
            _profileTapView.UserInteractionEnabled = true;
            _contentView.AddSubview(_profileTapView);

            _likersTapView = new UIView();
            _likersTapView.UserInteractionEnabled = true;
            _contentView.AddSubview(_likersTapView);

            likersY            = underPhotoPanelHeight / 2 - likersImageSide / 2;
            likersCornerRadius = likersImageSide / 2;

            var liketap = new UITapGestureRecognizer(LikeTap);

            _like.AddGestureRecognizer(liketap);

            UITapGestureRecognizer tap = new UITapGestureRecognizer(() =>
            {
                CellAction?.Invoke(ActionType.Preview, _currentPost);
            });

            _photoScroll.AddGestureRecognizer(tap);

            var profileTap = new UITapGestureRecognizer(() =>
            {
                CellAction?.Invoke(ActionType.Profile, _currentPost);
            });
            var headerTap = new UITapGestureRecognizer(() =>
            {
                CellAction?.Invoke(ActionType.Profile, _currentPost);
            });

            _profileTapView.AddGestureRecognizer(headerTap);
            _rewards.AddGestureRecognizer(profileTap);

            var commentTap = new UITapGestureRecognizer(() =>
            {
                CellAction?.Invoke(ActionType.Comments, _currentPost);
            });

            _comments.AddGestureRecognizer(commentTap);

            var netVotesTap = new UITapGestureRecognizer(() =>
            {
                CellAction?.Invoke(ActionType.Voters, _currentPost);
            });

            _likersTapView.AddGestureRecognizer(netVotesTap);

            var flagersTap = new UITapGestureRecognizer(() =>
            {
                CellAction?.Invoke(ActionType.Flagers, _currentPost);
            });

            _flags.AddGestureRecognizer(flagersTap);

            _moreButton.TouchDown += FlagButton_TouchDown;
        }
Example #60
0
 public override void DraggingStarted(UIScrollView scrollView)
 {
     _isDragging = true;
     Carousel.SetIsDragging(true);
 }