public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState) { View rootView = inflater.Inflate(Resource.Layout.media_player, container, false); _btnPrevious = rootView.FindViewById <Button>(Resource.Id.btnPrevious); _btnPrevious.Enabled = false; _btnPrevious.Click += OnClick; _btnNext = rootView.FindViewById <Button>(Resource.Id.btnNext); _btnNext.Enabled = false; _btnNext.Click += OnClick; _btnPlay = rootView.FindViewById <Button>(Resource.Id.btnPlay); _btnPlay.Enabled = true; _btnPlay.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); }
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); }