ModalViewModel
A view model which can be used to populate R.layout.ttivi_modal_fragment.
The modal panel consists of several components. Most components can be populated by their own view model. However, the content area section is not populated by a view model and has to be populated by the ModalFragment using the ModalFragment.contentViewFactory.
A schematic overview of the modal panel template:
________________________________________________________________
| navigationBarViewModel iconButtonsViewModel closeButton|
| ________ ___ ___ ___ |
| | title | | | | | | X | | Header section
| |_______| |___| |___| |___| |
|________________________________________________________________|
| |
| ************************************************************* |
| ************************************************************* |
| *********************** Content area *********************** | Content area section
| ************************************************************* |
| ************************************************************* |
|________________________________________________________________|
| ____________________ | ____________________ |
| | Secondary | | | Primary | | Action buttons section
| | action button | | | action button | | populated with
| |____________________| | |____________________| | actionButtonsViewModel
|_____________________________|__________________________________|
Properties
The view model for the action buttons containing the actions for the buttons. If no buttons are set, the action button section shall not be populated. By default, no action buttons are set.
The view model for the icon buttons. If no buttons are set, the icon button section shall not be populated. By default, no icon buttons are set.
ID tag which can be overridden to find a specific modal panel during tests by use of the withIdTag()
matcher.
Functions
The close button click callback. By default dismisses only the current modal panel. If a different behavior is needed, this can be overridden.