private void CellAction(ActionType type, Post post)
        {
            switch (type)
            {
            case ActionType.Profile:
                if (post.Author == AppSettings.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
                {
                    OpenPost(post);
                }
                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:
                ClosePost();
                break;

            default:
                break;
            }
        }
        private void CellAction(ActionType type, Post post)
        {
            if (_postToEdit != null && _postToEdit.Editing && type != ActionType.Edit)
            {
                return;
            }

            switch (type)
            {
            case ActionType.Profile:
                if (post.Author == AppSettings.User.Login)
                {
                    return;
                }
                var myViewController = new ProfileViewController();
                myViewController.Username = post.Author;
                NavigationController.PushViewController(myViewController, true);
                break;

            case ActionType.Voters:
                NavigationController.PushViewController(new VotersViewController(post, VotersType.Likes, true), true);
                break;

            case ActionType.Flagers:
                NavigationController.PushViewController(new VotersViewController(post, VotersType.Flags, true), true);
                break;

            case ActionType.Like:
                if (post.Body != Core.Constants.DeletedPostText)
                {
                    Vote(post);
                }
                break;

            case ActionType.Delete:
                DeleteComment(post);
                break;

            case ActionType.Reply:
                if (post.Body != Core.Constants.DeletedPostText)
                {
                    Reply(post);
                }
                break;

            case ActionType.Edit:
                EditComment(post);
                break;

            case ActionType.Flag:
                FlagComment(post);
                break;

            default:
                break;
            }
        }
Esempio n. 3
0
        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:
                var myViewController2 = new ImagePreviewViewController();
                //TODO: pass image
                myViewController2.ImageForPreview = null;
                myViewController2.ImageUrl        = post.Body;
                TabBarController.NavigationController.PushViewController(myViewController2, true);
                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:
                Flag(post);
                break;

            default:
                break;
            }
        }
Esempio n. 4
0
        private void CellAction(ActionType type, Post post)
        {
            switch (type)
            {
            case ActionType.Profile:
                if (post.Author == AppSettings.User.Login)
                {
                    return;
                }
                var myViewController = new ProfileViewController();
                myViewController.Username = post.Author;
                myViewController.HidesBottomBarWhenPushed = false;
                NavigationController.PushViewController(myViewController, true);
                break;

            case ActionType.Preview:
                NavigationController.PushViewController(new ImagePreviewViewController(post.Body, _cell.PostImage)
                {
                    HidesBottomBarWhenPushed = true
                }, true);
                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.HidesBottomBarWhenPushed = true;
                myViewController4.Post = post;
                NavigationController.PushViewController(myViewController4, true);
                break;

            case ActionType.Like:
                Vote(post);
                break;

            case ActionType.More:
                Flagged(post);
                break;

            default:
                break;
            }
        }
Esempio n. 5
0
        private void CellAction(ActionType type, Post post)
        {
            switch (type)
            {
            case ActionType.Profile:
                if (post.Author == AppSettings.User.Login)
                {
                    return;
                }
                var myViewController = new ProfileViewController();
                myViewController.Username = post.Author;
                NavigationController.PushViewController(myViewController, true);
                break;

            case ActionType.Voters:
                NavigationController.PushViewController(new VotersViewController(post, VotersType.Likes, true), true);
                break;

            case ActionType.Flagers:
                NavigationController.PushViewController(new VotersViewController(post, VotersType.Flags, true), true);
                break;

            case ActionType.Like:
                Vote(post);
                break;

            case ActionType.Delete:
                DeleteComment(post);
                break;

            case ActionType.Reply:
                Reply(post);
                break;

            case ActionType.Edit:
                EditComment(post);
                break;

            case ActionType.Flag:
                FlagComment(post);
                break;

            default:
                break;
            }
        }
Esempio n. 6
0
        private void CellAction(ActionType type, UserFriend user)
        {
            switch (type)
            {
            case ActionType.Profile:
                if (user.Author == AppSettings.User.Login)
                {
                    return;
                }
                var myViewController = new ProfileViewController();
                myViewController.Username = user.Author;
                NavigationController.PushViewController(myViewController, true);
                break;

            case ActionType.Follow:
                Follow(user);
                break;

            default:
                break;
            }
        }
Esempio n. 7
0
        private void SetupHistoryCollection()
        {
            _historyCollection = new UICollectionView(CGRect.Null, new UICollectionViewFlowLayout()
            {
                MinimumLineSpacing  = 0,
                FooterReferenceSize = new CGSize(0, 0),
            })
            {
                BackgroundColor = UIColor.Clear,
            };
            _historyCollection.RegisterClassForCell(typeof(TransactionCollectionViewCell), nameof(TransactionCollectionViewCell));
            _historyCollection.RegisterClassForCell(typeof(TransactionShimmerCollectionViewCell), nameof(TransactionShimmerCollectionViewCell));
            _historyCollection.RegisterClassForCell(typeof(ClaimTransactionCollectionViewCell), nameof(ClaimTransactionCollectionViewCell));
            _historyCollection.RegisterClassForSupplementaryView(typeof(TransactionHeaderCollectionViewCell), UICollectionElementKindSection.Header, nameof(TransactionHeaderCollectionViewCell));
            _historyCollection.RegisterClassForSupplementaryView(typeof(CardsContainerHeader), UICollectionElementKindSection.Header, nameof(CardsContainerHeader));

            View.Add(_historyCollection);

            _historySource = new TransferCollectionViewSource(_presenter, NavigationController);

            _historySource.CellAction += (string obj) =>
            {
                if (obj == AppSettings.User.Login)
                {
                    return;
                }
                var myViewController = new ProfileViewController();
                myViewController.Username = obj;
                NavigationController.PushViewController(myViewController, true);
            };

            _historyCollection.Source   = _historySource;
            _historyCollection.Delegate = new TransactionHistoryCollectionViewFlowDelegate(_historySource);

            _historyCollection.AutoPinEdgeToSuperviewEdge(ALEdge.Top);
            _historyCollection.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom);
            _historyCollection.AutoPinEdgeToSuperviewEdge(ALEdge.Left);
            _historyCollection.AutoPinEdgeToSuperviewEdge(ALEdge.Right);
        }
Esempio n. 8
0
        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.Voters:
                NavigationController.PushViewController(new VotersViewController(post, VotersType.Likes, true), true);
                break;

            case ActionType.Flagers:
                NavigationController.PushViewController(new VotersViewController(post, VotersType.Flags, true), true);
                break;

            case ActionType.Like:
                Vote(post);
                break;

            case ActionType.More:
                Flag(post);
                break;

            case ActionType.Reply:
                Reply(post);
                break;

            default:
                break;
            }
        }
        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;
            }
        }