Customize Media Plugin Fragments
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
This can be done in the following 3 steps:
- Define a custom
IviFragment, see an
- Define a
CustomFragmentRuleto replace the desired panel, see an example of
- Use the custom fragment rule in a custom
SystemUiHostby overriding the
IviFragmentFactory, see an
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
AdaptiveFragmentHelperclass to manage multiple layouts for different view variants.
There are multiple examples of media fragments customization: