android-components / mozilla.components.feature.tabs.tabstray / TabsTrayPresenter

TabsTrayPresenter

class TabsTrayPresenter : Observer (source)

Presenter implementation for a tabs tray implementation in order to update the tabs tray whenever the state of the session manager changes.

Constructors

Name Summary
<init> TabsTrayPresenter(tabsTray: TabsTray, sessionManager: SessionManager, closeTabsTray: () -> Unit, sessionsFilter: (Session) -> Boolean = { true })
Presenter implementation for a tabs tray implementation in order to update the tabs tray whenever the state of the session manager changes.

Functions

Name Summary
onAllSessionsRemoved fun onAllSessionsRemoved(): Unit
All sessions have been removed. Note that this will callback will be invoked whenever removeAll() or removeSessions have been called on the SessionManager. This callback will NOT be invoked when just the last session has been removed by calling remove() on the SessionManager.
onSessionAdded fun onSessionAdded(session: Session): Unit
The given session has been added.
onSessionRemoved fun onSessionRemoved(session: Session): Unit
The given session has been removed.
onSessionSelected fun onSessionSelected(session: Session): Unit
The selection has changed and the given session is now the selected session.
start fun start(): Unit
stop fun stop(): Unit

Inherited Functions

Name Summary
onSessionsRestored open fun onSessionsRestored(): Unit
Sessions have been restored via a snapshot. This callback is invoked at the end of the call to read, after every session in the snapshot was added, and appropriate session was selected.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.