HeaderViewModel
open class HeaderViewModel( val imageDescriptor: LiveData<ImageDescriptor?> = EmptyLiveData(), val title: LiveData<StringResolver?> = EmptyLiveData(), val description: LiveData<StringResolver?> = EmptyLiveData())
Content copied to clipboard
A view model used to populate the header section of the notification template. The header summarizes the main contents of the notification. E.g., the image and the name of the contact of an incoming call.
A schematic overview of the header section:
__________________________________________________________
| _______ | |
| | | | Header title |
| | Image | | Header description |
| |_______| | |
|_____________|____________________________________________|
Content copied to clipboard
Parameters
imageDescriptor
The information to display in the image field. When set to null
, the image field will not be visible.
title
A StringResolver for the header title in the header section. When set to null
, the header title text field will not be visible.
description
A StringResolver for the header description in the header section. When set to null
, the header description text field will not be visible.
Constructors
Link copied to clipboard
fun HeaderViewModel( imageDescriptor: ImageDescriptor? = null, title: StringResolver? = null, description: StringResolver? = null)
Content copied to clipboard
A convenience constructor for creating a HeaderViewModel with non-live data.
Link copied to clipboard
fun HeaderViewModel( imageDescriptor: LiveData<ImageDescriptor?> = EmptyLiveData(), title: LiveData<StringResolver?> = EmptyLiveData(), description: LiveData<StringResolver?> = EmptyLiveData())
Content copied to clipboard