Project has been merged into arez-dom
This library provides an Arez browser component that tracks when the user is idle. A user is considered idle if they have not interacted with the browser for a specified amount of time.
The simplest way to use component;
- add the following dependencies into the build system. i.e.
<dependency>
<groupId>org.realityforge.arez.idlestatus</groupId>
<artifactId>arez-idlestatus</artifactId>
<version>0.48</version>
</dependency>
-
add the snippet
<inherits name="arez.idlestatus.IdleStatus"/>
into the .gwt.xml file. -
Use the
IdleStatus
component. eg.
import com.google.gwt.core.client.EntryPoint;
import elemental2.dom.DomGlobal;
import arez.Arez;
import arez.idlestatus.IdleStatus;
public class IdleStatusExample
implements EntryPoint
{
public void onModuleLoad()
{
final IdleStatus idleStatus = IdleStatus.create();
Arez.context().autorun( () -> {
final String message = "Interaction Status: " + ( idleStatus.isIdle() ? "Idle" : "Active" );
DomGlobal.console.log( message );
} );
}
}
For more information about component, please see the Website. For the source code and project support please visit the GitHub project.
The component was released as open source so others could benefit from the project. We are thankful for any contributions from the community. A Code of Conduct has been put in place and a Contributing document is under development.
The component is licensed under Apache License, Version 2.0.