public class CarNowPlayingTemplate
- Object
- CarTemplate
- CarNowPlayingTemplate
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.Constructors
public CarNowPlayingTemplate() |
Methods
public CarNowPlayingTemplate addAction(CarAction action) | Adds an app-specific now-playing button (e.g. shuffle / repeat / like). |
public List<CarAction> getActions() | Returns the app-specific now-playing buttons, in order. |
public boolean isUpNextVisible() | Returns true when an “Up next” affordance should be offered. |
public CarNowPlayingTemplate setUpNextVisible(boolean upNextVisible) | Sets whether the head unit offers an “Up next” button that lets the driver browse the queue. |
Inherited methods
From CarTemplate
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
actionCarAction- 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
upNextVisibleboolean- true to show the up-next affordance
Returns
this template, for chaining