Esempio n. 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TableView.SetEditing(true, true);
            TableView.ScrollEnabled    = true;
            CloseButton.TouchUpInside += (sender, e) =>
            {
                this.DismissViewController(true, null);
            };

            var songsTableViewSource = new SongsTableViewSource();

            TableView.Source = songsTableViewSource;

            var viewFlowLayout = new CenterCellCollectionViewFlowLayout
            {
                ScrollDirection = UICollectionViewScrollDirection.Horizontal
            };

            FavouriteSongsCollectionView.SetCollectionViewLayout(viewFlowLayout, false);

            var songsCollectionViewSource = new SongsCollectionViewSource();

            FavouriteSongsCollectionView.RegisterNibForCell(FavouriteSongCollectionViewCell.Nib, FavouriteSongCollectionViewCell.Key);
            songsCollectionViewSource.AddSongAction = AddSongToQueue;
            FavouriteSongsCollectionView.Source     = songsCollectionViewSource;
            FavouriteSongsCollectionView.ReloadData();
        }
Esempio n. 2
0
        private void AddSongToQueue(FavouriteSongCollectionViewCell cell)
        {
            var cellToMoveFromFavouritesToQueue = DataSource.FavouriteSongs[cell.RowIndex];

            DataSource.SongsQueue.Insert(0, cellToMoveFromFavouritesToQueue);

            var collectionCellToRemove = FavouriteSongsCollectionView.IndexPathForCell(cell);

            DataSource.FavouriteSongs.RemoveAt(cell.RowIndex);
            FavouriteSongsCollectionView.DeleteItems(new Foundation.NSIndexPath[] { collectionCellToRemove });

            if (IsFirstRowVisible)
            {
                TableView.ReloadData();
                PerformAnimation();
            }
            else
            {
                TableView.BeginUpdates();
                TableView.InsertRows(new NSIndexPath[] { NSIndexPath.FromRowSection(0, 0) }, UITableViewRowAnimation.Bottom);
                TableView.EndUpdates();
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BackgroundView != null)
            {
                BackgroundView.Dispose();
                BackgroundView = null;
            }

            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

            if (ContentView != null)
            {
                ContentView.Dispose();
                ContentView = null;
            }

            if (FavouriteSongsCollectionView != null)
            {
                FavouriteSongsCollectionView.Dispose();
                FavouriteSongsCollectionView = null;
            }

            if (FavouritesTitle != null)
            {
                FavouritesTitle.Dispose();
                FavouritesTitle = null;
            }

            if (FooterView != null)
            {
                FooterView.Dispose();
                FooterView = null;
            }

            if (MaskView != null)
            {
                MaskView.Dispose();
                MaskView = null;
            }

            if (NextLabel != null)
            {
                NextLabel.Dispose();
                NextLabel = null;
            }

            if (PlayerBlurScreen != null)
            {
                PlayerBlurScreen.Dispose();
                PlayerBlurScreen = null;
            }

            if (PlayingSongCoverImageView != null)
            {
                PlayingSongCoverImageView.Dispose();
                PlayingSongCoverImageView = null;
            }

            if (ProgressView != null)
            {
                ProgressView.Dispose();
                ProgressView = null;
            }

            if (SongArtist != null)
            {
                SongArtist.Dispose();
                SongArtist = null;
            }

            if (SongsQueueTitle != null)
            {
                SongsQueueTitle.Dispose();
                SongsQueueTitle = null;
            }

            if (SongsQueueView != null)
            {
                SongsQueueView.Dispose();
                SongsQueueView = null;
            }

            if (SongTitle != null)
            {
                SongTitle.Dispose();
                SongTitle = null;
            }

            if (SubContentViewClipped != null)
            {
                SubContentViewClipped.Dispose();
                SubContentViewClipped = null;
            }

            if (SunContentView != null)
            {
                SunContentView.Dispose();
                SunContentView = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }
        }