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

# DefaultIconGenerator

MickeyMoz's avatar
MickeyMoz committed
5
`class DefaultIconGenerator : `[`IconGenerator`](../-icon-generator/index.md) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/browser/icons/src/main/java/mozilla/components/browser/icons/generator/DefaultIconGenerator.kt#L31)
MickeyMoz's avatar
MickeyMoz committed
6
7
8
9
10
11
12
13

[IconGenerator](../-icon-generator/index.md) implementation that will generate an icon with a background color, rounded corners and a letter
representing the URL.

### Constructors

| Name | Summary |
|---|---|
MickeyMoz's avatar
MickeyMoz committed
14
| [&lt;init&gt;](-init-.md) | `DefaultIconGenerator(cornerRadiusDimen: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`? = R.dimen.mozac_browser_icons_generator_default_corner_radius, textColorRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = R.color.mozac_browser_icons_generator_default_text_color, backgroundColorsRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = R.array.mozac_browser_icons_photon_palette)`<br>[IconGenerator](../-icon-generator/index.md) implementation that will generate an icon with a background color, rounded corners and a letter representing the URL. |
MickeyMoz's avatar
MickeyMoz committed
15
16
17
18
19

### Functions

| Name | Summary |
|---|---|
MickeyMoz's avatar
MickeyMoz committed
20
| [generate](generate.md) | `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
21
22
23
24
25
26

### 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. |