android-components / mozilla.components.feature.readerview / ReaderViewFeature

ReaderViewFeature

class ReaderViewFeature : LifecycleAwareFeature, UserInteractionHandler (source)

Feature implementation that provides a reader view for the selected session, based on a web extension.

Types

Name Summary
ColorScheme enum class ColorScheme
FontType enum class FontType

Constructors

Name Summary
<init> ReaderViewFeature(context: <ERROR CLASS>, engine: Engine, store: BrowserStore, controlsView: ReaderViewControlsView, onReaderViewStatusChange: onReaderViewStatusChange = { _, _ -> Unit })
Feature implementation that provides a reader view for the selected session, based on a web extension.

Functions

Name Summary
hideControls fun hideControls(): Unit
Hides the reader view appearance controls.
hideReaderView fun hideReaderView(session: TabSessionState? = store.state.selectedTab): Unit
Hides the reader view UI.
onBackPressed fun onBackPressed(): Boolean
Called when this UserInteractionHandler gets the option to handle the user pressing the back key.
showControls fun showControls(): Unit
Shows the reader view appearance controls.
showReaderView fun showReaderView(session: TabSessionState? = store.state.selectedTab): Unit
Shows the reader view UI.
start fun start(): Unit
stop fun stop(): Unit

Inherited Functions

Name Summary
onHomePressed open fun onHomePressed(): Boolean
In most cases, when the home button is pressed, we invoke this callback to inform the app that the user is going to leave the app.

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.