interface TabsTray : Observable<Observer>
(source)
Generic interface for components that provide "tabs tray" functionality.
interface Observer
Interface to be implemented by classes that want to observe a tabs tray. |
open fun asView(): View
Convenience method to cast the implementation of this interface to an Android View object. |
|
abstract fun displaySessions(sessions: List<Session>, selectedIndex: Int): Unit
Displays the given list of sessions. |
|
abstract fun onSessionMoved(fromPosition: Int, toPosition: Int): Unit
Called after updateSessions() when a session changes it position. |
|
abstract fun onSessionsChanged(position: Int, count: Int): Unit
Called after updateSessions() when count number of sessions are updated at the given position. |
|
abstract fun onSessionsInserted(position: Int, count: Int): Unit
Called after updateSessions() when count number of sessions are inserted at the given position. |
|
abstract fun onSessionsRemoved(position: Int, count: Int): Unit
Called after updateSessions() when count number of sessions are removed from the given position. |
|
abstract fun updateSessions(sessions: List<Session>, selectedIndex: Int): Unit
Updates the list of sessions. |
abstract fun notifyObservers(block: T.() -> Unit): Unit
Notifies all registered observers about a change. |
|
abstract fun pauseObserver(observer: T): Unit
Pauses the provided observer. No notifications will be sent to this observer until resumeObserver is called. |
|
abstract fun register(observer: T): Unit abstract fun register(observer: T, owner: LifecycleOwner, autoPause: Boolean = false): Unit abstract fun register(observer: T, view: View): Unit
Registers an observer to get notified about changes. |
|
abstract fun resumeObserver(observer: T): Unit
Resumes the provided observer. Notifications sent since it was last paused (see pauseObserver]) are lost and will not be re-delivered. |
|
abstract fun unregister(observer: T): Unit
Unregisters an observer. |
|
abstract fun unregisterObservers(): Unit
Unregisters all observers. |
|
abstract fun <R> wrapConsumers(block: T.(R) -> Boolean): List<(R) -> Boolean>
Returns a list of lambdas wrapping a consuming method of an observer. |
class BrowserTabsTray : RecyclerView, TabsTray
A customizable tabs tray for browsers. |
|
class TabsAdapter : Adapter<TabViewHolder>, TabsTray, Observable<Observer>
RecyclerView adapter implementation to display a list/grid of tabs. |