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


Java FileColumns.MEDIA_TYPE_IMAGE属性代码示例

本文整理汇总了Java中android.provider.MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE属性的典型用法代码示例。如果您正苦于以下问题:Java FileColumns.MEDIA_TYPE_IMAGE属性的具体用法?Java FileColumns.MEDIA_TYPE_IMAGE怎么用?Java FileColumns.MEDIA_TYPE_IMAGE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.provider.MediaStore.Files.FileColumns的用法示例。


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

示例1: onMediaStoreInsert

/**
 * When inserting the first item of each type, we need to trigger a roots
 * refresh to clear a previously reported {@link Root#FLAG_EMPTY}.
 */
static void onMediaStoreInsert(Context context, String volumeName, int type, long id) {
    if (!"external".equals(volumeName)) return;

    if (type == FileColumns.MEDIA_TYPE_IMAGE && sReturnedImagesEmpty) {
        sReturnedImagesEmpty = false;
        notifyRootsChanged(context);
    } else if (type == FileColumns.MEDIA_TYPE_VIDEO && sReturnedVideosEmpty) {
        sReturnedVideosEmpty = false;
        notifyRootsChanged(context);
    } else if (type == FileColumns.MEDIA_TYPE_AUDIO && sReturnedAudioEmpty) {
        sReturnedAudioEmpty = false;
        notifyRootsChanged(context);
    }
}
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:18,代码来源:MediaDocumentsProvider.java

示例2: loadBucketEntriesFromFilesTable

private static BucketEntry[] loadBucketEntriesFromFilesTable(
        ThreadPool.JobContext jc, ContentResolver resolver, int type) {
    Uri uri = getFilesContentUri();
    Cursor cursor = resolver.query(uri,
            PROJECTION_BUCKET, BUCKET_GROUP_BY,
            null, BUCKET_ORDER_BY);
    if (cursor == null) {
        Log.w(TAG, "cannot open local database: " + uri);
        return new BucketEntry[0];
    }
    ArrayList<BucketEntry> buffer = new ArrayList<BucketEntry>();
    int typeBits = 0;
    if ((type & MediaObject.MEDIA_TYPE_IMAGE) != 0) {
        typeBits |= (1 << FileColumns.MEDIA_TYPE_IMAGE);
    }
    if ((type & MediaObject.MEDIA_TYPE_VIDEO) != 0) {
        typeBits |= (1 << FileColumns.MEDIA_TYPE_VIDEO);
    }
    try {
        while (cursor.moveToNext()) {
            if ((typeBits & (1 << cursor.getInt(INDEX_MEDIA_TYPE))) != 0) {
                BucketEntry entry = new BucketEntry(
                        cursor.getInt(INDEX_BUCKET_ID),
                        cursor.getString(INDEX_BUCKET_NAME));
                if (!buffer.contains(entry)) {
                    buffer.add(entry);
                }
            }
            if (jc.isCancelled()) return null;
        }
    } finally {
        Utils.closeSilently(cursor);
    }
    return buffer.toArray(new BucketEntry[buffer.size()]);
}
 
开发者ID:mayurkaul,项目名称:medialibrary,代码行数:35,代码来源:BucketHelper.java

示例3: loadBucketEntries

public static  BucketEntry[] loadBucketEntries(Path path, ThreadPool.JobContext jc, Context mContext) {
    Uri uri = mBaseUri;
    Log.v("DebugLoadingTime", "start quering media provider");
    Cursor cursor = mContext.getContentResolver().query(
            uri, PROJECTION_BUCKET, BUCKET_GROUP_BY, null, BUCKET_ORDER_BY);
    if (cursor == null) {
        Log.w(TAG, "cannot open local database: " + uri);
        return new BucketEntry[0];
    }
    ArrayList<BucketEntry> buffer = new ArrayList<BucketEntry>();
    int typeBits = 0;
    int mType = getTypeFromPath(path);
    if ((mType & MediaObject.MEDIA_TYPE_IMAGE) != 0) {
        typeBits |= (1 << FileColumns.MEDIA_TYPE_IMAGE);
    }
    if ((mType & MediaObject.MEDIA_TYPE_VIDEO) != 0) {
        typeBits |= (1 << FileColumns.MEDIA_TYPE_VIDEO);
    }
    try {
        while (cursor.moveToNext()) {
            if ((typeBits & (1 << cursor.getInt(INDEX_MEDIA_TYPE))) != 0) {
                BucketEntry entry = new BucketEntry(
                        cursor.getInt(INDEX_BUCKET_ID),
                        cursor.getString(INDEX_BUCKET_NAME));
                if (!buffer.contains(entry)) {
                    buffer.add(entry);
                }
            }
            if (jc.isCancelled()) return null;
        }
        Log.v("DebugLoadingTime", "got " + buffer.size() + " buckets");
    } finally {
        cursor.close();
    }
    return buffer.toArray(new BucketEntry[buffer.size()]);
}
 
开发者ID:mayurkaul,项目名称:medialibrary,代码行数:36,代码来源:BucketHelper.java

示例4: Job

public Job(String path, String id) {
    mPath = path;
    mId = id;
    mMft = ArchosMediaFile.getFileType(path);
    // default mime type / media type
    int mediaType = FileColumns.MEDIA_TYPE_NONE;
    String mimeType = "application/octet-stream";
    boolean retrieve = false;
    if (mMft != null) {
        mimeType = mMft.mimeType;
        if (!isNoMediaPath(path)) {
            if (ArchosMediaFile.isAudioFileType(mMft.fileType)) {
                mediaType = FileColumns.MEDIA_TYPE_AUDIO;
                retrieve = true;
            } else if (ArchosMediaFile.isVideoFileType(mMft.fileType)) {
                mediaType = FileColumns.MEDIA_TYPE_VIDEO;
            }  else if (ArchosMediaFile.isImageFileType(mMft.fileType)) {
                mediaType = FileColumns.MEDIA_TYPE_IMAGE;
            } else if (ArchosMediaFile.isPlayListFileType(mMft.fileType)) {
                mediaType = FileColumns.MEDIA_TYPE_PLAYLIST;
            }
        }
    }
    mMimeType = mimeType;
    mMediaType = mediaType;
    mRetrieve = retrieve;
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:27,代码来源:MusicStoreImportImpl.java

示例5: Job

public Job(String path, String id, Blacklist blacklist) {
    mPath = Uri.parse(path);
    mId = id;
    mMft = ArchosMediaFile.getFileType(path);
    // default mime type / media type
    int mediaType = FileColumns.MEDIA_TYPE_NONE;
    String mimeType = "application/octet-stream";
    boolean retrieve = false;
    if (mMft != null) {
        mimeType = mMft.mimeType;
        if (!isNoMediaPath(path) && !blacklist.isBlacklisted(mPath)) {
            if (ArchosMediaFile.isAudioFileType(mMft.fileType)) {
                mediaType = FileColumns.MEDIA_TYPE_AUDIO;
            } else if (ArchosMediaFile.isVideoFileType(mMft.fileType)) {
                mediaType = FileColumns.MEDIA_TYPE_VIDEO;
                retrieve = true;
            }  else if (ArchosMediaFile.isImageFileType(mMft.fileType)) {
                mediaType = FileColumns.MEDIA_TYPE_IMAGE;
            } else if (ArchosMediaFile.isPlayListFileType(mMft.fileType)) {
                mediaType = FileColumns.MEDIA_TYPE_PLAYLIST;
            }
        }
    }
    mMimeType = mimeType;
    mMediaType = mediaType;
    mRetrieve = retrieve;
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:27,代码来源:VideoStoreImportImpl.java

示例6: getItemMimetype

private String getItemMimetype(Object item) {
    int type = mDelegate.getItemMediaType(item);
    if (type == FileColumns.MEDIA_TYPE_IMAGE) {
        return GalleryUtils.MIME_TYPE_IMAGE;
    } else if (type == FileColumns.MEDIA_TYPE_VIDEO) {
        return GalleryUtils.MIME_TYPE_VIDEO;
    } else {
        return GalleryUtils.MIME_TYPE_ALL;
    }
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:10,代码来源:MultiChoiceManager.java

示例7: loadBucketEntriesFromFilesTable

private static BucketEntry[] loadBucketEntriesFromFilesTable(
        JobContext jc, ContentResolver resolver, int type) {
    Uri uri = getFilesContentUri();

    Cursor cursor = resolver.query(uri,
            PROJECTION_BUCKET, BUCKET_GROUP_BY,
            null, BUCKET_ORDER_BY);
    if (cursor == null) {
        Log.w(TAG, "cannot open local database: " + uri);
        return new BucketEntry[0];
    }
    ArrayList<BucketEntry> buffer = new ArrayList<BucketEntry>();
    int typeBits = 0;
    if ((type & MediaObject.MEDIA_TYPE_IMAGE) != 0) {
        typeBits |= (1 << FileColumns.MEDIA_TYPE_IMAGE);
    }
    if ((type & MediaObject.MEDIA_TYPE_VIDEO) != 0) {
        typeBits |= (1 << FileColumns.MEDIA_TYPE_VIDEO);
    }
    try {
        while (cursor.moveToNext()) {
            if ((typeBits & (1 << cursor.getInt(INDEX_MEDIA_TYPE))) != 0) {
                BucketEntry entry = new BucketEntry(
                        cursor.getInt(INDEX_BUCKET_ID),
                        cursor.getString(INDEX_BUCKET_NAME));
                if (!buffer.contains(entry)) {
                    buffer.add(entry);
                }
            }
            if (jc.isCancelled()) return null;
        }
    } finally {
        Utils.closeSilently(cursor);
    }
    return buffer.toArray(new BucketEntry[buffer.size()]);
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:36,代码来源:BucketHelper.java

示例8: loadBucketEntries

private BucketEntry[] loadBucketEntries(JobContext jc) {
    Uri uri = mBaseUri;

    Log.v("DebugLoadingTime", "start quering media provider");
    Cursor cursor = mApplication.getContentResolver().query(uri,
            PROJECTION_BUCKET, BUCKET_GROUP_BY, null, BUCKET_ORDER_BY);
    if (cursor == null) {
        Log.w(TAG, "cannot open local database: " + uri);
        return new BucketEntry[0];
    }
    ArrayList<BucketEntry> buffer = new ArrayList<BucketEntry>();
    int typeBits = 0;
    if ((mType & MEDIA_TYPE_IMAGE) != 0) {
        typeBits |= (1 << FileColumns.MEDIA_TYPE_IMAGE);
    }
    if ((mType & MEDIA_TYPE_VIDEO) != 0) {
        typeBits |= (1 << FileColumns.MEDIA_TYPE_VIDEO);
    }
    try {
        while (cursor.moveToNext()) {
            if ((typeBits & (1 << cursor.getInt(INDEX_MEDIA_TYPE))) != 0) {
                BucketEntry entry = new BucketEntry(
                        cursor.getInt(INDEX_BUCKET_ID),
                        cursor.getString(INDEX_BUCKET_NAME));
                if (!buffer.contains(entry)) {
                    buffer.add(entry);
                }
            }
            if (jc.isCancelled())
                return null;
        }
        Log.v("DebugLoadingTime", "got " + buffer.size() + " buckets");
    } finally {
        cursor.close();
    }
    return buffer.toArray(new BucketEntry[buffer.size()]);
}
 
开发者ID:jituo666,项目名称:WoTu,代码行数:37,代码来源:LocalAlbumSet.java

示例9: onItemSelectedStateChanged

public void onItemSelectedStateChanged(ShareActionProvider share,
        int itemType, int itemSupportedOperations, boolean selected) {
    int increment = selected ? 1 : -1;

    mSelectedTotalCount += increment;
    mCachedShareableUris = null;

    if ((itemSupportedOperations & MediaObject.SUPPORT_DELETE) > 0) {
        mSelectedDeletableCount += increment;
    }
    if ((itemSupportedOperations & MediaObject.SUPPORT_EDIT) > 0) {
        mSelectedEditableCount += increment;
    }
    if ((itemSupportedOperations & MediaObject.SUPPORT_CROP) > 0) {
        mSelectedCroppableCount += increment;
    }
    if ((itemSupportedOperations & MediaObject.SUPPORT_SETAS) > 0) {
        mSelectedSetableCount += increment;
    }
    if ((itemSupportedOperations & MediaObject.SUPPORT_TRIM) > 0) {
        mSelectedTrimmableCount += increment;
    }
    if ((itemSupportedOperations & MediaObject.SUPPORT_MUTE) > 0) {
        mSelectedMuteableCount += increment;
    }
    if ((itemSupportedOperations & MediaObject.SUPPORT_SHARE) > 0) {
        mSelectedShareableCount += increment;
        if (itemType == FileColumns.MEDIA_TYPE_IMAGE) {
            mSelectedShareableImageCount += increment;
        } else if (itemType == FileColumns.MEDIA_TYPE_VIDEO) {
            mSelectedShareableVideoCount += increment;
        }
    }

    mShareIntent.removeExtra(Intent.EXTRA_STREAM);
    if (mSelectedShareableCount == 0) {
        mShareIntent.setAction(null).setType(null);
    } else if (mSelectedShareableCount >= 1) {
        mCachedShareableUris = mUriSource.getSelectedShareableUris();
        if (mCachedShareableUris.size() == 0) {
            mShareIntent.setAction(null).setType(null);
        } else {
            if (mSelectedShareableImageCount == mSelectedShareableCount) {
                mShareIntent.setType(GalleryUtils.MIME_TYPE_IMAGE);
            } else if (mSelectedShareableVideoCount == mSelectedShareableCount) {
                mShareIntent.setType(GalleryUtils.MIME_TYPE_VIDEO);
            } else {
                mShareIntent.setType(GalleryUtils.MIME_TYPE_ALL);
            }
            if (mCachedShareableUris.size() == 1) {
                mShareIntent.setAction(Intent.ACTION_SEND);
                mShareIntent.putExtra(Intent.EXTRA_STREAM, mCachedShareableUris.get(0));
            } else {
                mShareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
                mShareIntent.putExtra(Intent.EXTRA_STREAM, mCachedShareableUris);
            }
        }
    }
    share.setShareIntent(mShareIntent);
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:60,代码来源:SelectionManager.java


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