Пример #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            var rootView = inflater.Inflate(Resource.Layout.fragment_list, container, false);

            skipPrevious         = rootView.FindViewById <ImageButton> (Resource.Id.skip_previous);
            skipPrevious.Enabled = false;
            skipPrevious.Click  += OnClick;

            skipNext         = rootView.FindViewById <ImageButton> (Resource.Id.skip_next);
            skipNext.Enabled = false;
            skipNext.Click  += OnClick;

            playPause         = rootView.FindViewById <ImageButton> (Resource.Id.play_pause);
            playPause.Enabled = true;
            playPause.Click  += OnClick;

            queueAdapter = new QueueAdapter(Activity);

            var listView = rootView.FindViewById <ListView> (Resource.Id.list_view);

            listView.Adapter    = queueAdapter;
            listView.Focusable  = true;
            listView.ItemClick += (sender, e) => {
                var item = queueAdapter.GetItem(e.Position);
                transportControls.SkipToQueueItem(item.QueueId);
            };

            mediaBrowser = new MediaBrowser(Activity,
                                            new ComponentName(Activity, Java.Lang.Class.FromType(typeof(MusicService))),
                                            connectionCallback, null);

            return(rootView);
        }