本文整理汇总了Java中android.support.v4.util.ArrayMap.Entry方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayMap.Entry方法的具体用法?Java ArrayMap.Entry怎么用?Java ArrayMap.Entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.util.ArrayMap
的用法示例。
在下文中一共展示了ArrayMap.Entry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBindViewHolder
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
holder.tvTitle.setText(mMap.keyAt(position));
holder.flContent.removeAllViews();
ArrayMap<String,String> mNodeBlock = mMap.valueAt(position);
for (ArrayMap.Entry<String,String> node : mNodeBlock.entrySet()) {
TextView tvNode = new TextView(mContext);
tvNode.setText(node.getValue());
tvNode.setTextColor(ContextCompat.getColor(mContext, R.color.colorText));
tvNode.setPadding(SystemUtil.dp2px(6f), SystemUtil.dp2px(6f), SystemUtil.dp2px(6f), SystemUtil.dp2px(6f));
tvNode.setOnClickListener(new OnNodeClickListener(node.getKey()));
holder.flContent.addView(tvNode);
}
}
示例2: queryRoots
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Override
public Cursor queryRoots(String[] projection) throws FileNotFoundException {
// Create a cursor with either the requested fields, or the default projection if "projection" is null.
final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
for (ArrayMap.Entry<String, UsbPartition> root : mRoots.entrySet()) {
UsbPartition usbPartition = root.getValue();
UsbDevice usbDevice = usbPartition.device;
FileSystem fileSystem = usbPartition.fileSystem;
UsbFile rootDirectory = null;
String volumeLabel = null;
Long availableBytes = 0L;
Long capactityBytes = 0L;
String documentId = root.getKey() + ROOT_SEPERATOR;
if(null != fileSystem){
rootDirectory = fileSystem.getRootDirectory();
volumeLabel = fileSystem.getVolumeLabel();
availableBytes = fileSystem.getFreeSpace();
capactityBytes = fileSystem.getCapacity();
documentId = getDocIdForFile(rootDirectory);
}
String title = UsbUtils.getName(usbDevice);
if(TextUtils.isEmpty(title)) {
title = getContext().getString(R.string.root_usb);
}
int flags = Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_EDIT | Root.FLAG_LOCAL_ONLY
| Root.FLAG_ADVANCED | Root.FLAG_SUPPORTS_IS_CHILD;
final MatrixCursor.RowBuilder row = result.newRow();
// These columns are required
row.add(Root.COLUMN_ROOT_ID, root.getKey());
row.add(Root.COLUMN_DOCUMENT_ID, documentId);
row.add(Root.COLUMN_TITLE, title);
row.add(Root.COLUMN_FLAGS, flags);
// These columns are optional
row.add(Root.COLUMN_SUMMARY, volumeLabel);
row.add(Root.COLUMN_AVAILABLE_BYTES, availableBytes);
row.add(Root.COLUMN_CAPACITY_BYTES, capactityBytes);
row.add(Root.COLUMN_PATH, UsbUtils.getPath(usbDevice));
// Root.COLUMN_MIME_TYPE is another optional column and useful if you have multiple roots with different
// types of mime types (roots that don't match the requested mime type are automatically hidden)
}
return result;
}
示例3: settingsShouldBeNullIfNotChanged
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Test
public void settingsShouldBeNullIfNotChanged() {
ArrayMap<String,String> testArrayMap = fattsSetting.getSpecs();
for (ArrayMap.Entry<String,String> entry : testArrayMap.entrySet()) {
assertEquals(entry.getValue(), null);
}
}