Пример #1
0
		public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
		{
			if (indexPath.Item == CurrentIndex) return;

			ButtonBarView.MoveTo(indexPath.Item, true, SwipeDirection.None, PagerScroll.Yes);
			ShouldUpdateButtonBarView = false;

			var oldCell = ButtonBarView.CellForItem(NSIndexPath.FromItemSection(CurrentIndex, 0)) as ButtonBarViewCell;
			var newCell = ButtonBarView.CellForItem(NSIndexPath.FromItemSection(indexPath.Item, 0)) as ButtonBarViewCell;
			if (PagerBehaviour.ProgressiveIndicator)
			{
				if (ChangeCurrentIndexProgressive != null)
				{
					ChangeCurrentIndexProgressive(oldCell, newCell, 1f, true, true);
				}
			}
			else
			{
				if (ChangeCurrentIndex != null)
				{
					ChangeCurrentIndex(oldCell, newCell, true);
				}
			}

			MoveToViewController(indexPath.Item);
        }
Пример #2
0
		public void UpdateIndicator(PagerTabStripViewController viewController, nint fromIndex, nint toIndex, nfloat progressPercentage, bool indexWasChanged)
		{
			if (!ShouldUpdateButtonBarView) return;
			ButtonBarView.Move(fromIndex, toIndex, progressPercentage, PagerScroll.Yes);
			if (ChangeCurrentIndexProgressive != null)
			{
				var oldCell = ButtonBarView.CellForItem(NSIndexPath.FromItemSection(CurrentIndex != fromIndex ? fromIndex : toIndex, 0)) as ButtonBarViewCell;
				var newCell = ButtonBarView.CellForItem(NSIndexPath.FromItemSection(CurrentIndex, 0)) as ButtonBarViewCell;
				ChangeCurrentIndexProgressive(oldCell, newCell, progressPercentage, indexWasChanged, true);
			}
		}
Пример #3
0
		public void UpdateIndicator(PagerTabStripViewController viewController, nint fromIndex, nint toIndex)
		{
			if (!ShouldUpdateButtonBarView) return;
			ButtonBarView.MoveTo(toIndex, true, toIndex < fromIndex ? SwipeDirection.Right : SwipeDirection.Left, PagerScroll.Yes);

			if (ChangeCurrentIndex != null)
			{
				var oldCell = ButtonBarView.CellForItem(NSIndexPath.FromItemSection(CurrentIndex != fromIndex ? fromIndex : toIndex, 0)) as ButtonBarViewCell;
				var newCell = ButtonBarView.CellForItem(NSIndexPath.FromItemSection(CurrentIndex, 0)) as ButtonBarViewCell;
				ChangeCurrentIndex(oldCell, newCell, true);
			}
		}