TilesTimelineManager


class TilesTimelineManager : AutoCloseable


Manager for a single Wear Tiles timeline.

This handles the dispatching of single Tile layouts from a full timeline. It will set the correct alarms to detect when a layout should be updated, and dispatch it to its listener.

Summary

Nested types

Interface so this manager can retrieve the current time.

Type to listen for layout updates from a given timeline.

This interface is deprecated.

Use LayoutUpdateListener instead.

Public constructors

TilesTimelineManager(
    alarmManager: AlarmManager,
    clock: TilesTimelineManager.Clock,
    timeline: TimelineBuilders.Timeline,
    token: Int,
    listenerExecutor: Executor,
    listener: TilesTimelineManager.LayoutUpdateListener
)

Default constructor.

TilesTimelineManager(
    alarmManager: AlarmManager,
    clock: TilesTimelineManager.Clock,
    timeline: TimelineBuilders.Timeline,
    token: Int,
    listenerExecutor: Executor,
    listener: TilesTimelineManager.Listener
)

This function is deprecated.

Use TilesTimelineManager instead.

Public functions

Unit

Tears down this Timeline Manager.

Unit

Sets up this Timeline Manager.

Public constructors

TilesTimelineManager

Added in 1.2.0
TilesTimelineManager(
    alarmManager: AlarmManager,
    clock: TilesTimelineManager.Clock,
    timeline: TimelineBuilders.Timeline,
    token: Int,
    listenerExecutor: Executor,
    listener: TilesTimelineManager.LayoutUpdateListener
)

Default constructor.

Parameters
alarmManager: AlarmManager

An AlarmManager instance suitable for setting RTC alarms on.

clock: TilesTimelineManager.Clock

A Clock to use to ascertain the current time (and hence which tile to show). This should be synchronized to the same clock as used by alarmManager

timeline: TimelineBuilders.Timeline

The Tiles timeline to use.

token: Int

A token, which will be passed to listener's callback.

listenerExecutor: Executor

the executor for listener

listener: TilesTimelineManager.LayoutUpdateListener

A listener instance, called when a new timeline entry is available.

TilesTimelineManager

Added in 1.0.0
Deprecated in 1.2.0
TilesTimelineManager(
    alarmManager: AlarmManager,
    clock: TilesTimelineManager.Clock,
    timeline: TimelineBuilders.Timeline,
    token: Int,
    listenerExecutor: Executor,
    listener: TilesTimelineManager.Listener
)

Default constructor.

Parameters
alarmManager: AlarmManager

An AlarmManager instance suitable for setting RTC alarms on.

clock: TilesTimelineManager.Clock

A Clock to use to ascertain the current time (and hence which tile to show). This should be synchronized to the same clock as used by alarmManager

timeline: TimelineBuilders.Timeline

The Tiles timeline to use.

token: Int

A token, which will be passed to listener's callback.

listenerExecutor: Executor

the executor for listener

listener: TilesTimelineManager.Listener

A listener instance, called when a new timeline entry is available.

Public functions

close

Added in 1.0.0
fun close(): Unit

Tears down this Timeline Manager. This will ensure any set alarms are cleared up.

init

Added in 1.0.0
fun init(): Unit

Sets up this Timeline Manager. This will cause the timeline manager to dispatch the first layout, and set its first alarm.