CustomFragmentRule

@IviExperimental(reasons = [])
interface CustomFragmentRule<P : AnyPanel>

A rule to replace the normal Fragment of a Panel of type P with a custom fragment. This makes it possible to not only change the layout of a panel, but also to display additional information and/or add custom interaction.

The rules are used by a PanelContainer. The rules are part of the PanelContainerContext, and can be configured in PanelContainer.ttiviPanelContainerContext.

Functions

Link copied to clipboard
abstract fun accepts(panel: P): Boolean

Whether this rule accepts the responsibility of creating the fragment of panel.

Link copied to clipboard

Creates the custom fragment for panel. Only called if accepts returned true.

Extensions

Link copied to clipboard

Creates the custom fragment for panel. Only called if CustomFragmentRule.accepts returned true. The fragment may be recreated by the system UI upon configuration changes.