Class “InactivityTimer”

Object > NativeObject > InactivityTimer

A timer that triggers when the app has not been interacted with for a configurable interval.

Constructor public
Singleton No
Namespace tabris
Direct subclasses None
JSX support No

Example

import {InactivityTimer} from 'tabris';

new InactivityTimer({delay: 2000})
  .onTimeout(() => console.log('Inactive'));

Constructor

new InactivityTimer(properties?)

Parameter Type Optional Description
properties Properties<InactivityTimer> Yes Sets all key-value pairs in the properties object as widget properties.

Methods

cancel()

Stops and resets the timer.

Returns void

start()

Starts the timer with the currently configured delay. After the first timeout event, the timer will stop but it can be started again.

Returns void

Properties

delay

The interval of user inactivity that will trigger the timer. Given in milliseconds. Changes to this property will not affect a running timer.

Type number
Default 0
Settable Yes

Events

timeout

Fired when the app has not been interacted with since the configured delay.

Change Events

delayChanged

Fired when the delay property has changed.

Parameter Type Description
value number The new value of delay.