Ejemplo n.º 1
0
        void TriggerRefresh(bool showStatus)
        {
            if (refreshRequested == null)
            {
                return;
            }

            if (reloading)
            {
                return;
            }

            reloading = true;
            if (refreshView != null)
            {
                refreshView.SetActivity(true);
            }
            refreshRequested(this, EventArgs.Empty);

            if (reloading && showStatus && refreshView != null)
            {
                UIView.BeginAnimations("reloadingData");
                UIView.SetAnimationDuration(0.2);
                TableView.ContentInset = new UIEdgeInsets(60, 0, 0, 0);
                UIView.CommitAnimations();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Invoke this method to signal that a reload has completed, this will update the UI accordingly.
        /// </summary>
        public void ReloadComplete()
        {
            if (refreshView != null)
            {
                refreshView.LastUpdate = DateTime.Now;
            }
            if (!reloading)
            {
                return;
            }

            reloading = false;
            if (refreshView == null)
            {
                return;
            }

            refreshView.SetActivity(false);
            refreshView.Flip(false);
            UIView.BeginAnimations("doneReloading");
            UIView.SetAnimationDuration(0.3f);
            TableView.ContentInset = new UIEdgeInsets(0, 0, 0, 0);
            refreshView.SetStatus(RefreshViewStatus.PullToReload);
            UIView.CommitAnimations();
        }
Ejemplo n.º 3
0
 void ConfigureTableView()
 {
     if (refreshRequested != null)
     {
         // The dimensions should be large enough so that even if the user scrolls, we render the
         // whole are with the background color.
         var bounds = View.Bounds;
         refreshView = MakeRefreshTableHeaderView(new RectangleF(0, -bounds.Height, bounds.Width, bounds.Height));
         if (reloading)
         {
             refreshView.SetActivity(true);
         }
         TableView.AddSubview(refreshView);
     }
 }
Ejemplo n.º 4
0
		void ConfigureTableView ()
		{
			if (refreshRequested != null)
			{
				// The dimensions should be large enough so that even if the user scrolls, we render the
				// whole area with the background color.
				var bounds = View.Bounds;
				var frame = new RectangleF (0, -bounds.Height, bounds.Width, bounds.Height);
				refreshView = MakeRefreshTableHeaderView(frame);
				if (reloading)
				{
					refreshView.SetActivity (true);
				}					
				TableView.AddSubview (refreshView);
			}
		}