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

ThumbnailsFeature

class ThumbnailsFeature : LifecycleAwareFeature (source)

Feature implementation for automatically taking thumbnails of sites. The feature will take a screenshot when the page finishes loading, and will add it to the Session.thumbnail property.

If the OS is under low memory conditions, the screenshot will be not taken. Ideally, this should be used in conjunction with SessionManager.onLowMemory to allow free up some Session.thumbnail from memory.

Constructors

Name Summary
<init> ThumbnailsFeature(context: <ERROR CLASS>, engineView: EngineView, sessionManager: SessionManager)
Feature implementation for automatically taking thumbnails of sites. The feature will take a screenshot when the page finishes loading, and will add it to the Session.thumbnail property.

Functions

Name Summary
start fun start(): Unit
Starts observing the selected session to listen for when a session finish loading.
stop fun stop(): Unit
Stops observing the selected session.

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.