# androidx.glance.wear

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetData` | Describes how a widget is rendered on a host. |

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidget` | Object that handles providing the contents of a Wear Widget. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidgetManager` | Manager for Glance Wear Widgets. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidgetService` | Service used for communication between the Host and a Widget Provider. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` | Defines a brush for a Wear Widget surface. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetConfigExtras` | Holds the configuration parameters passed to a Wear Widget configuration activity via its launching `https://developer.android.com/reference/android/content/Intent.html`. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetDocument` | Defines the content of a widget using Remote Compose. |

## Exceptions

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetContentTooLargeException` | Thrown when the serialized content of a widget is too large to be sent to the host. |

## Objects

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearProfiles` | Defines profiles for Glance Wear. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush.Companion` | The `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` companion object is the empty, default, or starter `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` that contains no elements. |

## Annotations

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/AssociateWithGlanceWearWidget` | Annotation used to associate a `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidget` class with its corresponding `https://developer.android.com/reference/kotlin/androidx/glance/wear/GlanceWearWidgetService`. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/ExperimentalGlanceWearApi` | Denotes that this API surface is experimental. |

## Extension functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush.https://developer.android.com/reference/kotlin/androidx/glance/wear/package-summary#(androidx.glance.wear.WearWidgetBrush).color(androidx.compose.remote.creation.compose.state.RemoteColor)(color: https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor)` Creates a `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` with a solid color. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush.https://developer.android.com/reference/kotlin/androidx/glance/wear/package-summary#(androidx.glance.wear.WearWidgetBrush).horizontalGradient(kotlin.collections.List)(colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor>)` Creates a `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` with a horizontal gradient and the given colors evenly dispersed within the gradient. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush.https://developer.android.com/reference/kotlin/androidx/glance/wear/package-summary#(androidx.glance.wear.WearWidgetBrush).image(androidx.compose.remote.creation.compose.state.RemoteImageBitmap,androidx.compose.ui.layout.ContentScale)( bitmap: https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteImageBitmap, contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale )` Creates a `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` with a bitmap. |
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush.https://developer.android.com/reference/kotlin/androidx/glance/wear/package-summary#(androidx.glance.wear.WearWidgetBrush).verticalGradient(kotlin.collections.List)(colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor>)` Creates a `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` with a vertical gradient and the given colors evenly dispersed within the gradient. |

## Extension functions

### WearWidgetBrush.color

Artifact: [androidx.glance.wear:wear](https://developer.android.com/jetpack/androidx/releases/glance-wear) [View Source](https://cs.android.com/search?q=file:androidx/glance/wear/WearWidgetBrush.kt+function:color) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
fun WearWidgetBrush.color(color: RemoteColor): WearWidgetBrush
```

Creates a `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` with a solid color.

| Parameters |
|---|---|
| `color: https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor` | The `https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor` to use for the brush. |

### WearWidgetBrush.horizontalGradient

Artifact: [androidx.glance.wear:wear](https://developer.android.com/jetpack/androidx/releases/glance-wear) [View Source](https://cs.android.com/search?q=file:androidx/glance/wear/WearWidgetBrush.kt+function:horizontalGradient)

```
fun WearWidgetBrush.horizontalGradient(colors: List<RemoteColor>): WearWidgetBrush
```

Creates a `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` with a horizontal gradient and the given colors evenly dispersed within the gradient.

Because the gradient is drawn across the entire surface, tiling is not required. Therefore, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode` defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Clamp()`.

Example:

```kotlin
WearWidgetBrush.horizontalGradient(listOf(Color.Red.rc, Color.Green.rc, Color.Blue.rc))
```

| Parameters |
|---|---|
| `colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor>` | The list of `https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor`s to be rendered as part of the gradient |

### WearWidgetBrush.image

Artifact: [androidx.glance.wear:wear](https://developer.android.com/jetpack/androidx/releases/glance-wear) [View Source](https://cs.android.com/search?q=file:androidx/glance/wear/WearWidgetBrush.kt+function:image) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
fun WearWidgetBrush.image(
    bitmap: RemoteImageBitmap,
    contentScale: ContentScale = ContentScale.Fit
): WearWidgetBrush
```

Creates a `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` with a bitmap.

Because the image is drawn using `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Decal()`, it does not repeat if the surface is larger than the scaled `https://developer.android.com/reference/kotlin/androidx/glance/wear/package-summary#(androidx.glance.wear.WearWidgetBrush).image(androidx.compose.remote.creation.compose.state.RemoteImageBitmap,androidx.compose.ui.layout.ContentScale)`.

Example:

```kotlin
WearWidgetBrush.image(bitmap, ContentScale.Crop)
```

| Parameters |
|---|---|
| `bitmap: https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteImageBitmap` | The `https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteImageBitmap` to draw. |
| `contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale = ContentScale.Fit` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale` to apply to the bitmap when fitting it to the surface, by default `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale#Fit()`. |

### WearWidgetBrush.verticalGradient

Artifact: [androidx.glance.wear:wear](https://developer.android.com/jetpack/androidx/releases/glance-wear) [View Source](https://cs.android.com/search?q=file:androidx/glance/wear/WearWidgetBrush.kt+function:verticalGradient)

```
fun WearWidgetBrush.verticalGradient(colors: List<RemoteColor>): WearWidgetBrush
```

Creates a `https://developer.android.com/reference/kotlin/androidx/glance/wear/WearWidgetBrush` with a vertical gradient and the given colors evenly dispersed within the gradient.

Because the gradient is drawn across the entire surface, tiling is not required. Therefore, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode` defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Clamp()`.

Example:

```kotlin
WearWidgetBrush.verticalGradient(listOf(Color.Red.rc, Color.Green.rc, Color.Blue.rc))
```

| Parameters |
|---|---|
| `colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor>` | The list of `https://developer.android.com/reference/kotlin/androidx/compose/remote/creation/compose/state/RemoteColor`s to be rendered as part of the gradient |