index.md 1.67 KB
Newer Older
MickeyMoz's avatar
MickeyMoz committed
1
2
3
4
5
6
[android-components](../../index.md) / [mozilla.components.browser.icons.generator](../index.md) / [IconGenerator](./index.md)

# IconGenerator

`interface IconGenerator` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/browser/icons/src/main/java/mozilla/components/browser/icons/generator/IconGenerator.kt#L16)

MickeyMoz's avatar
MickeyMoz committed
7
A [IconGenerator](./index.md) implementation can generate a [Bitmap](#) for an [IconRequest](../../mozilla.components.browser.icons/-icon-request/index.md). It's a fallback if no icon could be
MickeyMoz's avatar
MickeyMoz committed
8
9
10
11
12
13
loaded for a specific URL.

### Functions

| Name | Summary |
|---|---|
MickeyMoz's avatar
MickeyMoz committed
14
| [generate](generate.md) | `abstract fun generate(context: <ERROR CLASS>, request: `[`IconRequest`](../../mozilla.components.browser.icons/-icon-request/index.md)`): `[`Icon`](../../mozilla.components.browser.icons/-icon/index.md) |
MickeyMoz's avatar
MickeyMoz committed
15

MickeyMoz's avatar
MickeyMoz committed
16
17
18
19
20
21
### Extension Functions

| Name | Summary |
|---|---|
| [loadResourceAsString](../../mozilla.components.support.test.file/kotlin.-any/load-resource-as-string.md) | `fun `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`.loadResourceAsString(path: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Loads a file from the resources folder and returns its content as a string object. |

MickeyMoz's avatar
MickeyMoz committed
22
23
24
25
26
### Inheritors

| Name | Summary |
|---|---|
| [DefaultIconGenerator](../-default-icon-generator/index.md) | `class DefaultIconGenerator : `[`IconGenerator`](./index.md)<br>[IconGenerator](./index.md) implementation that will generate an icon with a background color, rounded corners and a letter representing the URL. |