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


Java DateUtils.HOUR_IN_MILLIS屬性代碼示例

本文整理匯總了Java中android.text.format.DateUtils.HOUR_IN_MILLIS屬性的典型用法代碼示例。如果您正苦於以下問題:Java DateUtils.HOUR_IN_MILLIS屬性的具體用法?Java DateUtils.HOUR_IN_MILLIS怎麽用?Java DateUtils.HOUR_IN_MILLIS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.text.format.DateUtils的用法示例。


在下文中一共展示了DateUtils.HOUR_IN_MILLIS屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: dump

@Override
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {

    Log.d("dump", "Downloads updated in last hour:");

    final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
    final long modifiedAfter = System.currentTimeMillis() - DateUtils.HOUR_IN_MILLIS;
    final Cursor cursor = db.query(DB_TABLE, null,
            Downloads.Impl.COLUMN_LAST_MODIFICATION + ">" + modifiedAfter, null, null, null,
            Downloads.Impl._ID + " ASC");
    try {
        final String[] cols = cursor.getColumnNames();
        final int idCol = cursor.getColumnIndex(BaseColumns._ID);
        while (cursor.moveToNext()) {
            Log.d("dump", "Download #" + cursor.getInt(idCol) + ":");
            for (int i = 0; i < cols.length; i++) {
                // Omit sensitive data when dumping
                if (Downloads.Impl.COLUMN_COOKIE_DATA.equals(cols[i])) {
                    continue;
                }
                Log.d("dump", cols[i] + ", " + cursor.getString(i));
            }
        }
    } finally {
        cursor.close();
    }

}
 
開發者ID:redleaf2002,項目名稱:downloadmanager,代碼行數:28,代碼來源:DownloadProvider.java

示例2: setReductionStats

/**
 * Sets the current statistics for viewing. These include the original total daily size of
 * received resources before compression, and the actual total daily size of received
 * resources after compression. The last update time is specified in milliseconds since the
 * epoch.
 * @param lastUpdateTimeMillis The last time the statistics were updated.
 * @param networkStatsHistoryOriginal The history of original content lengths.
 * @param networkStatsHistoryReceived The history of received content lengths.
 */
public void setReductionStats(
        long lastUpdateTimeMillis,
        NetworkStatsHistory networkStatsHistoryOriginal,
        NetworkStatsHistory networkStatsHistoryReceived) {
    mCurrentTime = lastUpdateTimeMillis;
    mRightPosition = mCurrentTime + DateUtils.HOUR_IN_MILLIS
            - TimeZone.getDefault().getOffset(mCurrentTime);
    mLeftPosition = lastUpdateTimeMillis - DateUtils.DAY_IN_MILLIS * DAYS_IN_CHART;
    mOriginalNetworkStatsHistory = networkStatsHistoryOriginal;
    mReceivedNetworkStatsHistory = networkStatsHistoryReceived;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:20,代碼來源:DataReductionStatsPreference.java

示例3: formatDuring

/**
 * 將給定的毫秒數轉換為可讀字符串
 *
 * @param milliseconds 待轉換的毫秒數
 * @return 該毫秒數轉換為 * days * hours * minutes * seconds 後的格式
 */
public static String formatDuring(long milliseconds) {
    long days = milliseconds / DateUtils.DAY_IN_MILLIS;
    long hours = (milliseconds % DateUtils.DAY_IN_MILLIS) / DateUtils.HOUR_IN_MILLIS;
    long minutes = (milliseconds % DateUtils.HOUR_IN_MILLIS) / DateUtils.MINUTE_IN_MILLIS;
    long seconds = (milliseconds % DateUtils.MINUTE_IN_MILLIS) / DateUtils.SECOND_IN_MILLIS;
    return days + " days " + hours + " hours " + minutes + " minutes "
           + seconds + " seconds ";
}
 
開發者ID:starcor-company,項目名稱:starcor.xul,代碼行數:14,代碼來源:XulSystemUtil.java

示例4: getOftenLoggerResetMillisecond

public long getOftenLoggerResetMillisecond() {
    return getOftenLoggerReset() * DateUtils.HOUR_IN_MILLIS;
}
 
開發者ID:brolam,項目名稱:OpenHomeAnalysis,代碼行數:3,代碼來源:OhaEnergyUseSyncHelper.java

示例5: getTotalBoardHoursRunning

public double getTotalBoardHoursRunning(){
    if ( this.durationBoardRunning > 0){
        return (double)durationBoardRunning / (double) DateUtils.HOUR_IN_MILLIS;
    }
    return 0.00;
}
 
開發者ID:brolam,項目名稱:OpenHomeAnalysis,代碼行數:6,代碼來源:OhaSequenceLog.java

示例6: convertSecondsToHours

/**
 * Converter segundos em horas
 */
public static double convertSecondsToHours(double seconds) {
    return seconds > 0.00 ? (seconds * 1000.00) / DateUtils.HOUR_IN_MILLIS : 0.00;
}
 
開發者ID:brolam,項目名稱:OpenHomeAnalysis,代碼行數:6,代碼來源:OhaHelper.java

示例7: updateView

private void updateView() {
    if (!isAdded())
        return;

    final boolean showProgress;

    if (blockchainState != null && blockchainState.bestChainDate != null) {
        final long blockchainLag = System.currentTimeMillis() - blockchainState.bestChainDate.getTime();
        final boolean blockchainUptodate = blockchainLag < BLOCKCHAIN_UPTODATE_THRESHOLD_MS;
        final boolean noImpediments = blockchainState.impediments.isEmpty();

        showProgress = !(blockchainUptodate || !blockchainState.replaying);

        final String downloading = getString(noImpediments ? R.string.blockchain_state_progress_downloading
                : R.string.blockchain_state_progress_stalled);

        if (blockchainLag < 2 * DateUtils.DAY_IN_MILLIS) {
            final long hours = blockchainLag / DateUtils.HOUR_IN_MILLIS;
            viewProgress.setText(getString(R.string.blockchain_state_progress_hours, downloading, hours));
        } else if (blockchainLag < 2 * DateUtils.WEEK_IN_MILLIS) {
            final long days = blockchainLag / DateUtils.DAY_IN_MILLIS;
            viewProgress.setText(getString(R.string.blockchain_state_progress_days, downloading, days));
        } else if (blockchainLag < 90 * DateUtils.DAY_IN_MILLIS) {
            final long weeks = blockchainLag / DateUtils.WEEK_IN_MILLIS;
            viewProgress.setText(getString(R.string.blockchain_state_progress_weeks, downloading, weeks));
        } else {
            final long months = blockchainLag / (30 * DateUtils.DAY_IN_MILLIS);
            viewProgress.setText(getString(R.string.blockchain_state_progress_months, downloading, months));
        }
    } else {
        showProgress = false;
    }

    if (!showProgress) {
        viewBalance.setVisibility(View.VISIBLE);

        if (!showLocalBalance)
            viewBalanceLocal.setVisibility(View.GONE);

        if (balance != null) {
            viewBalanceBtc.setVisibility(View.VISIBLE);
            viewBalanceBtc.setFormat(config.getFormat());
            viewBalanceBtc.setAmount(balance);

            if (showLocalBalance) {
                if (exchangeRate != null) {
                    final Fiat localValue = exchangeRate.rate.coinToFiat(balance);
                    viewBalanceLocal.setVisibility(View.VISIBLE);
                    viewBalanceLocal.setFormat(Constants.LOCAL_FORMAT.code(0,
                            Constants.PREFIX_ALMOST_EQUAL_TO + exchangeRate.getCurrencyCode()));
                    viewBalanceLocal.setAmount(localValue);
                    viewBalanceLocal.setTextColor(getResources().getColor(R.color.fg_less_significant));
                } else {
                    viewBalanceLocal.setVisibility(View.INVISIBLE);
                }
            }
        } else {
            viewBalanceBtc.setVisibility(View.INVISIBLE);
        }

        if (balance != null && balance.isGreaterThan(TOO_MUCH_BALANCE_THRESHOLD)) {
            viewBalanceWarning.setVisibility(View.VISIBLE);
            viewBalanceWarning.setText(R.string.wallet_balance_fragment_too_much);
        } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
            viewBalanceWarning.setVisibility(View.VISIBLE);
            viewBalanceWarning.setText(R.string.wallet_balance_fragment_insecure_device);
        } else {
            viewBalanceWarning.setVisibility(View.GONE);
        }

        viewProgress.setVisibility(View.GONE);
    } else {
        viewProgress.setVisibility(View.VISIBLE);
        viewBalance.setVisibility(View.INVISIBLE);
    }
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:76,代碼來源:WalletBalanceFragment.java

示例8: convertMillisToHours

/**
 * Converter milisegundos em horas.
 *
 * @param millis informar os milisegundos.
 * @return total em horas.
 */
public static double convertMillisToHours(double millis) {
    return millis > 0.00 ? millis / DateUtils.HOUR_IN_MILLIS : 0.00;
}
 
開發者ID:brolam,項目名稱:OpenHomeAnalysis,代碼行數:9,代碼來源:OhaHelper.java


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