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
|_____________________________|__________________________________|

Constructors

Link copied to clipboard
fun <P : ModalPanel> ModalViewModel(panel: P)

Properties

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
@IviExperimental(reasons = [])
open val tag: Int? = null

ID tag which can be overridden to find a specific modal panel during tests by use of the withIdTag() matcher.

Inherited properties

Link copied to clipboard
Link copied to clipboard
open override val panel: P

Functions

Link copied to clipboard

The close button click callback. By default dismisses only the current modal panel. If a different behavior is needed, this can be overridden.

Inherited functions

Link copied to clipboard
Link copied to clipboard
override fun getLifecycle(): Lifecycle