本文整理汇总了Java中chatty.util.ActivityTracker类的典型用法代码示例。如果您正苦于以下问题:Java ActivityTracker类的具体用法?Java ActivityTracker怎么用?Java ActivityTracker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActivityTracker类属于chatty.util包,在下文中一共展示了ActivityTracker类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import chatty.util.ActivityTracker; //导入依赖的package包/类
public void show() {
if (activityTime <= 0 || ActivityTracker.getLastActivityAgo() < activityTime) {
startTimer(false);
} else {
activityListener = new MyActivityListener();
ActivityTracker.addActivityListener(activityListener);
}
startFallbackTimer();
visibleSince = System.currentTimeMillis();
window.setVisible(true);
}
示例2: close
import chatty.util.ActivityTracker; //导入依赖的package包/类
/**
* Close the window immediately and cleanup.
*/
public void close() {
stopTimers();
closed = true;
window.dispose();
if (listener != null) {
listener.notificationRemoved(this);
}
if (activityListener != null) {
ActivityTracker.removeActivityListener(activityListener);
}
}
示例3: setActivityTime
import chatty.util.ActivityTracker; //导入依赖的package包/类
/**
* Sets the time in seconds in which activity should have been detected to
* be considered active. Automatically starts tracking if it's greater than
* 0. Values <= 0 disable this feature (however tracking may still be
* active).
*
* @param time
*/
public final void setActivityTime(int time) {
this.activityTime = time * SECOND;
if (activityTime > 0) {
ActivityTracker.startTracking();
}
}