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


Java LongSparseArray.valueAt方法代碼示例

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


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

示例1: matchItemIds

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
/**
 * Match start/end values by Adapter item ID. Adds matched values to mStartValuesList
 * and mEndValuesList and removes them from unmatchedStart and unmatchedEnd, using
 * startItemIds and endItemIds as a guide for which Views have unique item IDs.
 */
private void matchItemIds(ArrayMap<View, TransitionValues> unmatchedStart,
                          ArrayMap<View, TransitionValues> unmatchedEnd,
                          LongSparseArray<View> startItemIds, LongSparseArray<View> endItemIds) {
    int numStartIds = startItemIds.size();
    for (int i = 0; i < numStartIds; i++) {
        View startView = startItemIds.valueAt(i);
        if (startView != null && isValidTarget(startView)) {
            View endView = endItemIds.get(startItemIds.keyAt(i));
            if (endView != null && isValidTarget(endView)) {
                TransitionValues startValues = unmatchedStart.get(startView);
                TransitionValues endValues = unmatchedEnd.get(endView);
                if (startValues != null && endValues != null) {
                    mStartValuesList.add(startValues);
                    mEndValuesList.add(endValues);
                    unmatchedStart.remove(startView);
                    unmatchedEnd.remove(endView);
                }
            }
        }
    }
}
 
開發者ID:andkulikov,項目名稱:Transitions-Everywhere,代碼行數:27,代碼來源:Transition.java

示例2: getValueToTime

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private Double getValueToTime(LongSparseArray<Double> array, Integer timeAsSeconds) {
    Double lastValue = null;

    for (Integer index = 0; index < array.size(); index++) {
        long tas = array.keyAt(index);
        double value = array.valueAt(index);
        if (lastValue == null) lastValue = value;
        if (timeAsSeconds < tas) {
            break;
        }
        lastValue = value;
    }
    return lastValue;
}
 
開發者ID:MilosKozak,項目名稱:AndroidAPS,代碼行數:15,代碼來源:Profile.java

示例3: deleteRemainingEntries

import android.support.v4.util.LongSparseArray; //導入方法依賴的package包/類
private boolean deleteRemainingEntries(LongSparseArray<DbContactSensor> allExistingContacts, boolean b) {

        boolean bSomethingDeleted = false;

        List<DbContactSensor> entriesToDelete = new ArrayList<>(allExistingContacts.size());

        for (int i = 0, size = allExistingContacts.size(); i < size; i++) {

            if (b && !isRunning()) {
                return bSomethingDeleted;
            }

            DbContactSensor dbContact = allExistingContacts.valueAt(i);

            dbContact.setIsDeleted(Boolean.TRUE);
            dbContact.setIsNew(Boolean.FALSE);
            dbContact.setIsUpdated(Boolean.TRUE);

            entriesToDelete.add(dbContact);

            if (!bSomethingDeleted) {
                bSomethingDeleted = true;
            }
        }

        // remove entries
        daoProvider.getContactSensorDao().delete(entriesToDelete);

        return bSomethingDeleted;
    }
 
開發者ID:Telecooperation,項目名稱:assistance-platform-client-sdk-android,代碼行數:31,代碼來源:ContactsSensor.java


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