Class CarNowPlayingTemplate

java.lang.Object
com.codename1.car.CarTemplate
com.codename1.car.CarNowPlayingTemplate

public class CarNowPlayingTemplate extends CarTemplate
The system now-playing surface for audio apps. On both platforms the track metadata, artwork, transport controls and scrubber are driven by the platform media session -- on Android by the MediaSession behind Codename One's background audio service, on iOS by MPNowPlayingInfoCenter / the remote command center -- so this template carries no metadata of its own. It exists to (a) route the head unit to the now-playing screen and (b) add up-to-two app-specific buttons (shuffle, repeat, like, rate). Maps to CPNowPlayingTemplate and the Android Auto now-playing view.
  • Constructor Details

    • CarNowPlayingTemplate

      public CarNowPlayingTemplate()
  • Method Details

    • addAction

      public CarNowPlayingTemplate addAction(CarAction action)

      Adds an app-specific now-playing button (e.g. shuffle / repeat / like). The head unit shows a small fixed number of these alongside the system transport controls.

      Parameters
      • action: the button to add
      Returns

      this template, for chaining

    • getActions

      public List<CarAction> getActions()
      Returns the app-specific now-playing buttons, in order.
    • isUpNextVisible

      public boolean isUpNextVisible()
      Returns true when an "Up next" affordance should be offered.
    • setUpNextVisible

      public CarNowPlayingTemplate setUpNextVisible(boolean upNextVisible)

      Sets whether the head unit offers an "Up next" button that lets the driver browse the queue.

      Parameters
      • upNextVisible: true to show the up-next affordance
      Returns

      this template, for chaining