예제 #1
0
        //Header more click
        public bool OnMenuItemClick(IMenuItem menuItem)
        {
            switch (menuItem.ItemId)
            {
            case Resource.Id.download:
                YoutubeManager.DownloadPlaylist(item, true, true);
                break;

            case Resource.Id.fork:
                if (isForked)
                {
                    PlaylistManager.Unfork(item);
                }
                else
                {
                    PlaylistManager.ForkPlaylist(item);
                }

                isForked = !isForked;
                break;

            case Resource.Id.addToQueue:
                if (useHeader)
                {
                    PlaylistManager.AddToQueue(item);
                }
                else
                {
                    SongManager.AddToQueue(adapter.tracks);
                }
                break;

            case Resource.Id.name:
                PlaylistManager.Rename(item, () =>
                {
                    MainActivity.instance.FindViewById <TextView>(Resource.Id.headerTitle).Text = item.Name;
                });
                break;

            case Resource.Id.sync:
                PlaylistManager.StopSyncingDialog(item, () =>
                {
                    MainActivity.instance.SupportFragmentManager.PopBackStack();
                });
                break;

            case Resource.Id.delete:
                PlaylistManager.Delete(item, () =>
                {
                    MainActivity.instance.SupportFragmentManager.PopBackStack();
                });
                break;
            }
            return(true);
        }