Class Scheduler

Class that manages a queue of Runnables that are scheduled to run now (or at some time in the future). Runnables that are scheduled to run on the UI thread (tasks, animations, etc) eventually get routed to a Scheduler instance.

The execution of a scheduler can be in one of three states:

paused (pause()): if paused, then no posted events will be run unless the
Scheduler is explicitly instructed to do so, correctly matching Android's behavior.

normal (unPause()): if not paused but not set to idle constantly, then the
Scheduler will automatically run any Runnables that are scheduled to run at or
before the Scheduler's current time, but it won't automatically run any future events. To
run future events the Scheduler needs to have its clock advanced.

idling constantly: if idleConstantly(boolean) is called with true, then
the Scheduler will continue looping through posted events (including future events),
advancing its clock as it goes.

setIdleState

Sets the current idling state of this Scheduler. If transitioning to the Scheduler.IdleState.UNPAUSED state any tasks scheduled to be run at or before the current time will be run, and if transitioning to the Scheduler.IdleState.CONSTANT_IDLE state all scheduled tasks will be run and the clock advanced to the time of the last runnable.