当前位置: 首页>>代码示例>>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;未经允许,请勿转载。