Example #1
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);
        }
Example #2
0
 public TransactionHistoryCollectionViewFlowDelegate(TransferCollectionViewSource source)
 {
     _source = source;
 }