private void SourceChanged(Status status) { if (sliderCollection.Hidden) { _gridDelegate.GenerateVariables(); collectionView.ReloadData(); } else { _sliderGridDelegate.GenerateVariables(); sliderCollection.ReloadData(); } }
protected override void SourceChanged(Status status) { if (!feedCollection.Hidden) { _gridDelegate.GenerateVariables(); feedCollection.ReloadData(); } else { _sliderGridDelegate.GenerateVariables(); sliderCollection.ReloadData(); } }
public bool ClosePost() { if (!sliderCollection.Hidden) { var visibleRect = new CGRect(); visibleRect.Location = sliderCollection.ContentOffset; visibleRect.Size = sliderCollection.Bounds.Size; var visiblePoint = new CGPoint(visibleRect.GetMidX(), visibleRect.GetMidY()); var index = sliderCollection.IndexPathForItemAtPoint(visiblePoint); collectionView.ScrollToItem(index, UICollectionViewScrollPosition.Top, false); collectionView.Hidden = false; sliderCollection.Hidden = true; _gridDelegate.GenerateVariables(); collectionView.ReloadData(); return(true); } return(false); }
private void SourceChanged(Status status) { _gridDelegate.GenerateVariables(); feedCollection.ReloadData(); }
private void CellAction(ActionType type, Post post) { switch (type) { case ActionType.Profile: if (post.Author == BasePresenter.User.Login) { return; } var myViewController = new ProfileViewController(); myViewController.Username = post.Author; NavigationController.PushViewController(myViewController, true); break; case ActionType.Preview: if (collectionView.Hidden) { //NavigationController.PushViewController(new PostViewController(post, _gridDelegate.Variables[_presenter.IndexOf(post)], _presenter), false); NavigationController.PushViewController(new ImagePreviewViewController(post.Body) { HidesBottomBarWhenPushed = true }, true); } else { collectionView.Hidden = true; sliderCollection.Hidden = false; _sliderGridDelegate.GenerateVariables(); sliderCollection.ReloadData(); sliderCollection.ScrollToItem(NSIndexPath.FromRowSection(_presenter.IndexOf(post), 0), UICollectionViewScrollPosition.CenteredHorizontally, false); } break; case ActionType.Voters: NavigationController.PushViewController(new VotersViewController(post, VotersType.Likes), true); break; case ActionType.Flagers: NavigationController.PushViewController(new VotersViewController(post, VotersType.Flags), true); break; case ActionType.Comments: var myViewController4 = new CommentsViewController(); myViewController4.Post = post; myViewController4.HidesBottomBarWhenPushed = true; NavigationController.PushViewController(myViewController4, true); break; case ActionType.Like: Vote(post); break; case ActionType.More: Flagged(post); break; case ActionType.Close: collectionView.Hidden = false; sliderCollection.Hidden = true; _gridDelegate.GenerateVariables(); collectionView.ReloadData(); collectionView.ScrollToItem(NSIndexPath.FromRowSection(_presenter.IndexOf(post), 0), UICollectionViewScrollPosition.Top, false); break; default: break; } }