Customize Media Plugin Fragments
The TomTom Digital Cockpit SDK is not available for general use.
Please contact us for more information.
This guide is based on the custom-fragment tutorial.
The off-the-shelf media plugin comes with default fragments to show media content or playback state.
By customizing the media plugin fragment it is possible to change the look and feel of an existing
media panel contained in com.tomtom.ivi.appsuite.media.api.common.frontend.panels
.
This can be done in the following 3 steps:
- Define a custom
IviFragment
, see anexample
. - Define a
CustomFragmentRule
to replace the desired panel, see an example ofMediaExpandedProcessPanelBase
replacement
. - Use the custom fragment rule in a custom
SystemUiHost
by overriding theIviFragmentFactory
, see anexample
.
The off-the-shelf media plugin fragments are adaptive UI and support multiple layouts depending on the panel container size and orientation. When replacing a fragment with a custom one it is possible to keep this adaptive layout capability for the custom fragment. The TomTom Digital Cockpit platform offers an
AdaptiveFragmentHelper
class to manage multiple layouts for different view variants.
There are multiple examples of media fragments customization:
- A custom dashboard example can be found at
customdashboard
. - A custom mini player example can be found at
customminiplayer
. - A custom now playing example can be found at
customnowplaying
.