本文整理汇总了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);
}
}
}
}
}
示例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;
}
示例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;
}