android-components / mozilla.components.feature.session / CoordinateScrollingFeature

CoordinateScrollingFeature

class CoordinateScrollingFeature : SelectionAwareSessionObserver, LifecycleAwareFeature (source)

Feature implementation for connecting an EngineView with any View that you want to coordinate scrolling behavior with.

A use case could be collapsing a toolbar every time that the user scrolls.

Constructors

Name Summary
<init> CoordinateScrollingFeature(sessionManager: SessionManager, engineView: EngineView, view: <ERROR CLASS>, scrollFlags: Int = DEFAULT_SCROLL_FLAGS)
Feature implementation for connecting an EngineView with any View that you want to coordinate scrolling behavior with.

Inherited Properties

Name Summary
activeSession open var activeSession: Session?
the currently observed session

Functions

Name Summary
onLoadingStateChanged fun onLoadingStateChanged(session: Session, loading: Boolean): Unit
start fun start(): Unit
Start feature: Starts adding scrolling behavior for the indicated view.

Inherited Functions

Name Summary
observeFixed fun observeFixed(session: Session): Unit
Starts observing changes to the specified session.
observeIdOrSelected fun observeIdOrSelected(sessionId: String?): Unit
Starts observing changes to the session matching the sessionId. If the session does not exist, then observe the selected session.
observeSelected fun observeSelected(): Unit
Starts observing changes to the selected session (see SessionManager.selectedSession). If a different session is selected the observer will automatically be switched over and only notified of changes to the newly selected session.
onSessionSelected open fun onSessionSelected(session: Session): Unit
The selection has changed and the given session is now the selected session.
stop open fun stop(): Unit
Stops the observer.

Companion Object Properties

Name Summary
DEFAULT_SCROLL_FLAGS const val DEFAULT_SCROLL_FLAGS: Int

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.