当前位置: 首页>>代码示例>>Java>>正文


Java R类代码示例

本文整理汇总了Java中com.ipaulpro.afilechooser.R的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


R类属于com.ipaulpro.afilechooser包,在下文中一共展示了R类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: queryRoots

import com.ipaulpro.afilechooser.R; //导入依赖的package包/类
@Override
public Cursor queryRoots(final 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(projection != null ? projection
            : DEFAULT_ROOT_PROJECTION);
    // Add Home directory
    File homeDir = Environment.getExternalStorageDirectory();
    final MatrixCursor.RowBuilder row = result.newRow();
    // These columns are required
    row.add(Root.COLUMN_ROOT_ID, homeDir.getAbsolutePath());
    row.add(Root.COLUMN_DOCUMENT_ID, homeDir.getAbsolutePath());
    row.add(Root.COLUMN_TITLE, getContext().getString(R.string.internal_storage));
    row.add(Root.COLUMN_FLAGS, Root.FLAG_LOCAL_ONLY | Root.FLAG_SUPPORTS_CREATE);
    row.add(Root.COLUMN_ICON, R.drawable.ic_provider);
    // These columns are optional
    row.add(Root.COLUMN_AVAILABLE_BYTES, homeDir.getFreeSpace());
    // 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;
}
 
开发者ID:dc914337,项目名称:PSD-Android-App,代码行数:24,代码来源:LocalStorageProvider.java

示例2: queryRoots

import com.ipaulpro.afilechooser.R; //导入依赖的package包/类
@Override
public Cursor queryRoots(final 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(projection != null ? projection
            : DEFAULT_ROOT_PROJECTION);
    // Add Home directory
    File homeDir = Environment.getExternalStorageDirectory();
    final MatrixCursor.RowBuilder row = result.newRow();
    // These columns are required
    row.add(Root.COLUMN_ROOT_ID, homeDir.getParent());
    row.add(Root.COLUMN_DOCUMENT_ID, homeDir.getParent());
    row.add(Root.COLUMN_TITLE, getContext().getString(R.string.all_storage));
    row.add(Root.COLUMN_FLAGS, Root.FLAG_LOCAL_ONLY | Root.FLAG_SUPPORTS_CREATE);
    row.add(Root.COLUMN_ICON, R.drawable.ic_provider);
    // These columns are optional
    row.add(Root.COLUMN_AVAILABLE_BYTES, homeDir.getFreeSpace());
    // Root.COLUMN_MIME_TYPE is another optional column and useful if you
    // have multiple roots with different
    // types of mime types (ro`ots that don't match the requested mime type
    // are automatically hidden)
    return result;
}
 
开发者ID:syniuhin,项目名称:Readily,代码行数:24,代码来源:LocalStorageProvider.java

示例3: getMimeTypes

import com.ipaulpro.afilechooser.R; //导入依赖的package包/类
/**
 * Load MIME types from XML
 * 
 * @param context
 * @return
 */
private static MimeTypes getMimeTypes(Context context) {
	MimeTypes mimeTypes = null;
	final MimeTypeParser mtp = new MimeTypeParser();
	final XmlResourceParser in = context.getResources().getXml(R.xml.mimetypes);

	try {
		mimeTypes = mtp.fromXmlResource(in);
	} catch (Exception e) {
		if(DEBUG) Log.e(TAG, "getMimeTypes", e);
	}
	return mimeTypes;
}
 
开发者ID:jcuenod,项目名称:brainrot,代码行数:19,代码来源:FileUtils.java


注:本文中的com.ipaulpro.afilechooser.R类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。