TilesTimelineManager

public class TilesTimelineManager
extends Object

java.lang.Object
   ↳ androidx.wear.tiles.timeline.TilesTimelineManager


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 classes

interface TilesTimelineManager.Clock

Interface so this manager can retrieve the current time. 

interface TilesTimelineManager.Listener

Type to listen for layout updates from a given timeline. 

Public constructors

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

Default constructor.

Public methods

void deInit()

Tears down this Timeline Manager.

void init()

Sets up this Timeline Manager.

Inherited methods

Public constructors

TilesTimelineManager

public TilesTimelineManager (AlarmManager alarmManager, 
                TilesTimelineManager.Clock clock, 
                TimelineBuilders.Timeline timeline, 
                int token, 
                Executor listenerExecutor, 
                TilesTimelineManager.Listener 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

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

Public methods

deInit

public void deInit ()

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

init

public void init ()

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