MainProcessPanel

abstract class MainProcessPanel(frontendContext: FrontendContext, priority: MainProcessPanel.Priority) : GenericPanel<PanelContext>

A panel which visualizes processes in the UI. For example, an ongoing audio streaming process.

A MainProcessPanel changes its priority when there are changes in how much attention the process requires.

The system UI is expected to directly react on priority changes. Sometimes it is necessary to keep showing a MainProcessPanel for some time after the process becomes less relevant, for example to keep showing the contact who has just tried calling the user. In such cases, the frontend is expected to delay lowering its own priority.

Setting the priority to the same level it was set previously also signals the system UI that the process was somehow updated, and allows it to evaluate the relevance of the MainProcessPanel once again.

To understand how the system UI uses the priority level, see UniquePriority.

Parameters

frontendContext

An entry point for this Panel to communicate with the rest of the system.

priority

The initial Priority level of the panel.

Constructors

Link copied to clipboard
fun MainProcessPanel(frontendContext: FrontendContext, priority: MainProcessPanel.Priority)

Types

Link copied to clipboard
enum Priority : Enum<MainProcessPanel.Priority>

The priority level of the process.

Link copied to clipboard
class UniquePriority(val priority: MainProcessPanel.Priority) : Comparable<MainProcessPanel.UniquePriority>

A UniquePriority assigned to a MainProcessPanel offers the ability to sort panels not just by priority, but also by which priority level was most recently set.

Properties

Link copied to clipboard
val priority: LiveData<MainProcessPanel.UniquePriority>

The current Priority of the panel.

Inherited properties

Link copied to clipboard
val frontendContext: FrontendContext
Link copied to clipboard
val id: Long

Unique identifier of a GenericPanel. Each ID is an increment of the previously created panel's ID, allowing this value to be used for sorting purposes.

Link copied to clipboard
val isOccluded: LiveData<Boolean?>

Whether the panel is partially or fully occluded:

Link copied to clipboard
override val panelContext: LiveData<PanelContext?>

The PanelContext given when the panel is attached to the system UI.

Link copied to clipboard
val tag: String

The tag to recognise this panel with. Useful in combination with fragment tags to detect which fragment belongs to which panel.

Link copied to clipboard
var transitionDestination: PanelTransitionDestination?

A destination that the information contained by this panel transitions to when this panel closes. By default it is null, indicating the information does not transition anywhere.

Link copied to clipboard
var transitionSource: PanelTransitionSource?

The source of the information contained by this panel when the information transitions from another panel to this one. By default it is null, indicating the information does not transition from any other particular panel.

Functions

Link copied to clipboard
fun setPriority(priority: MainProcessPanel.Priority)

Change the priority of this MainProcessPanel.

Inherited functions

Link copied to clipboard
fun createInitialFragment(): Fragment

The fragment used when initially showing the panel. The fragment may be recreated by the system UI upon configuration changes.

Link copied to clipboard
operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun getLifecycle(): Lifecycle
Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
@CallSuper
open fun onAddedToFrontend()

Called when this panel is added to Frontend.panels, allowing it to be shown in the system UI.

Link copied to clipboard
@CallSuper
open fun onAttached(panelContext: PanelContext)

Called when the panel is attached to the system UI. The panel may be detached and attached multiple times, for example on configuration changes. However, a panel will never be attached multiple times at once.

Link copied to clipboard
@CallSuper
open fun onDetached()

Called when the panel has been detached from the system UI. The panel may be attached again later, for example when the configuration changes.

Link copied to clipboard
@CallSuper
open fun onRemovedFromFrontend()

Called when this panel is removed from Frontend.panels, preventing it from being shown in the system UI.

Link copied to clipboard
open override fun toString(): String