androidx.glance.wear.tiles

Interfaces

Classes

GlanceTileService

TileService which can consume a Glance composition, convert it to a Wear Tile, and provide it to the system.

TimeInterval

TimeInterval class defines a period from start to end

TimelineMode.TimeBoundEntries

The GlanceTileService provides a UI for a fixed set of time intervals

WearTilesCompositionResult

Object containing the result from composition of GlanceWearTiles.

Objects

TimelineMode.SingleEntry

The GlanceTileService provides a single UI.

Annotations

Top-level functions summary

Unit

Add LayoutElementBuilders.LayoutElement into the glance composition.

suspend WearTilesCompositionResult
@ExperimentalGlanceWearTilesApi
compose(
    context: Context,
    size: DpSize,
    state: Any?,
    content: @Composable () -> Unit
)

Triggers the composition of content and returns the result.

Extension functions summary

GlanceModifier

Apply a border around an element, border width is provided in Dp

GlanceModifier

Apply a border around an element, border width is provided with dimension resource

Top-level properties summary

ProvidableCompositionLocal<TimeInterval?>

Time interval of the glance tile UI being generated.

Top-level functions

AndroidLayoutElement

@Composable
fun AndroidLayoutElement(
    layoutElement: LayoutElementBuilders.LayoutElement
): Unit

Add LayoutElementBuilders.LayoutElement into the glance composition.

Parameters
layoutElement: LayoutElementBuilders.LayoutElement

the layout element to add to the composition

@ExperimentalGlanceWearTilesApi
suspend fun compose(
    context: Context,
    size: DpSize,
    state: Any? = null,
    content: @Composable () -> Unit
): WearTilesCompositionResult

Triggers the composition of content and returns the result.

Parameters
context: Context

The Context to get the resources during glance ui building.

size: DpSize

Size of the glance ui to be displayed at.

state: Any? = null

Local view state that can be passed to composition through LocalState.

content: @Composable () -> Unit

Definition of the UI.

Returns
WearTilesCompositionResult

Composition result containing the glance ui.

Extension functions

fun GlanceModifier.border(width: Dp, color: ColorProvider): GlanceModifier

Apply a border around an element, border width is provided in Dp

Parameters
width: Dp

The width of the border, in DP

color: ColorProvider

The color of the border

fun GlanceModifier.border(width: @DimenRes Int, color: ColorProvider): GlanceModifier

Apply a border around an element, border width is provided with dimension resource

Parameters
width: @DimenRes Int

The width of the border, value provided by a dimension resource

color: ColorProvider

The color of the border

Top-level properties

LocalTimeInterval

val LocalTimeIntervalProvidableCompositionLocal<TimeInterval?>

Time interval of the glance tile UI being generated.