當前位置: 首頁>>代碼示例>>Java>>正文


Java ActivityTracker類代碼示例

本文整理匯總了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);
}
 
開發者ID:chatty,項目名稱:chatty,代碼行數:12,代碼來源:NotificationWindow.java

示例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);
    }
}
 
開發者ID:chatty,項目名稱:chatty,代碼行數:15,代碼來源:NotificationWindow.java

示例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();
    }
}
 
開發者ID:chatty,項目名稱:chatty,代碼行數:15,代碼來源:NotificationWindowManager.java


注:本文中的chatty.util.ActivityTracker類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。