android-components / mozilla.components.browser.icons.generator / IconGenerator

IconGenerator

interface IconGenerator (source)

A IconGenerator implementation can generate a Bitmap for an IconRequest. It’s a fallback if no icon could be loaded for a specific URL.

Functions

Name Summary
generate abstract fun generate(context: <ERROR CLASS>, request: IconRequest): Icon

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.

Inheritors

Name Summary
DefaultIconGenerator class DefaultIconGenerator : IconGenerator
IconGenerator implementation that will generate an icon with a background color, rounded corners and a letter representing the URL.