Ejemplo n.º 1
0
 /// <summary>
 /// Configure all the controllers
 /// </summary>
 private void ConfigureControllers()
 {
     AlbumsController.GetControllerData();
     ArtistsController.GetControllerData();
     PlaylistsController.GetControllerData();
     LibraryNameDisplayController.GetControllerData();
     FilterManagementController.GetControllerData();
     PlaybackSelectionController.GetControllerData();
     AutoplayController.GetControllerData();
     PlaybackModeController.GetControllerData();
     PlaybackManagementController.GetControllerData();
     MediaControllerController.GetControllerData();
     MediaNotificationController.GetControllerData();
     NowPlayingController.GetControllerData();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Bind to the specified view.
        /// </summary>
        /// <param name="menu"></param>
        public override void BindToView(View view, Context context)
        {
            if (view != null)
            {
                // Get references to the collapsed and expanded layouts
                collapsedLayout = view.FindViewById <LinearLayout>(Resource.Id.collapsed_layout);
                expandedLayout  = view.FindViewById <LinearLayout>(Resource.Id.expanded_layout);

                // Get a reference to the song title text view and set it selected to start the marquee going
                songTitle          = view.FindViewById <TextView>(Resource.Id.long_text);
                songTitle.Selected = true;
                songTitle.Text     = "";

                // Get references to the other controls
                collapsedProgress = collapsedLayout.FindViewById <ProgressBar>(Resource.Id.progressBar);
                expandedProgress  = expandedLayout.FindViewById <ProgressBar>(Resource.Id.progressBar);
                duration          = expandedLayout.FindViewById <TextView>(Resource.Id.textDuration);
                position          = expandedLayout.FindViewById <TextView>(Resource.Id.textCurrentPosition);

                // Respond to non-command layout clicks to collapse and expande the view
                collapsedLayout.SetOnClickListener(this);
                expandedLayout.SetOnClickListener(this);

                // Respond to play/pause buitton presses
                playButton        = view.FindViewById <ImageButton>(Resource.Id.play);
                playButton.Click += (sender, args) =>
                {
                    if (MediaControllerViewModel.IsPlaying == true)
                    {
                        MediaControllerController.Pause();
                    }
                    else
                    {
                        MediaControllerController.Start();
                    }
                };

                // Process play next button clicks
                view.FindViewById <ImageButton>(Resource.Id.skip_next).Click += (sender, args) =>
                {
                    MediaControllerController.PlayNext();
                };

                // Process play previous button clicks
                view.FindViewById <ImageButton>(Resource.Id.skip_prev).Click += (sender, args) =>
                {
                    MediaControllerController.PlayPrevious();
                };

                // Assume no playback device available at startup. Hide everything
                DeviceAvailable();

                // Display the appropriate playing/not playing icons
                PlayStateChanged();

                // Link in to the controller
                MediaControllerController.DataReporter = this;
            }
            else
            {
                // Unlink from the controller
                MediaControllerController.DataReporter = null;
            }
        }