本文整理汇总了Java中android.util.ArrayMap.size方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayMap.size方法的具体用法?Java ArrayMap.size怎么用?Java ArrayMap.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.util.ArrayMap
的用法示例。
在下文中一共展示了ArrayMap.size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateResourceKeys
import android.util.ArrayMap; //导入方法依赖的package包/类
@TargetApi(NOUGAT)
private static void updateResourceKeys(Context context, String originalResourcePath)
throws InvocationTargetException, IllegalAccessException, NoSuchFieldException, IOException {
List<String> exoResourcePaths = getExoPaths(context);
if (exoResourcePaths.isEmpty()) {
return;
}
String resDir = exoResourcePaths.get(0);
String[] splitResDirs =
exoResourcePaths
.subList(1, exoResourcePaths.size())
.toArray(new String[exoResourcePaths.size() - 1]);
ArrayMap<?, ?> resourceImpls = ResourcesManagerInternal.getInstance().getResourceImpls();
ArrayMap<Object, Object> newResourceImpls = new ArrayMap<>(resourceImpls.size());
for (Map.Entry<?, ?> entry : resourceImpls.entrySet()) {
Object key = entry.getKey();
ResourcesKeyInternal keyInternal = new ResourcesKeyInternal(key);
if (keyInternal.getResDir().equals(originalResourcePath)) {
keyInternal.setResDir(resDir);
keyInternal.setSplitResDirs(splitResDirs);
newResourceImpls.put(key, entry.getValue());
}
}
ResourcesManagerInternal.getInstance().setResourceImpls(newResourceImpls);
}
示例2: writeArrayMapInternal
import android.util.ArrayMap; //导入方法依赖的package包/类
/**
* Flatten an ArrayMap into the parcel at the current dataPosition(),
* growing dataCapacity() if needed. The Map keys must be String objects.
*/
@SuppressLint("NewApi")
public static void writeArrayMapInternal(Parcel parcel, ArrayMap<String, Object> val) {
if (val == null) {
parcel.writeInt(- 1);
return;
}
final int N = val.size();
parcel.writeInt(N);
for (int i=0; i<N; i++) {
parcel.writeString(val.keyAt(i));
parcel.writeValue(val.valueAt(i));
}
}
示例3: removeFrom
import android.util.ArrayMap; //导入方法依赖的package包/类
private void removeFrom(ArrayMap<Long, ViewHolder> holderMap, ViewHolder holder) {
for (int i = holderMap.size() - 1; i >= 0; i --) {
if (holder == holderMap.valueAt(i)) {
holderMap.removeAt(i);
return;
}
}
}