Java Code Examples for com.luck.picture.lib.config.PictureMimeType#ofAll()

The following examples show how to use com.luck.picture.lib.config.PictureMimeType#ofAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PictureSelectorActivity.java    From PictureSelector with Apache License 2.0 5 votes vote down vote up
/**
 * ofAll Page Model Synchronous cover
 */
private void synchronousCover() {
    if (config.chooseMode == PictureMimeType.ofAll()) {
        PictureThreadUtils.executeByIo(new PictureThreadUtils.SimpleTask<Boolean>() {

            @Override
            public Boolean doInBackground() {
                int size = folderWindow.getFolderData().size();
                for (int i = 0; i < size; i++) {
                    LocalMediaFolder mediaFolder = folderWindow.getFolder(i);
                    if (mediaFolder == null) {
                        continue;
                    }
                    String firstCover = LocalMediaPageLoader
                            .getInstance(getContext(), config).getFirstCover(mediaFolder.getBucketId());
                    mediaFolder.setFirstImagePath(firstCover);
                }
                return true;
            }

            @Override
            public void onSuccess(Boolean result) {
                // TODO Synchronous Success
            }
        });
    }
}
 
Example 2
Source File: PictureSelectorUtils.java    From DevUtils with Apache License 2.0 3 votes vote down vote up
/**
 * 设置相册选择类型
 * <pre>
 *     全部 PictureMimeType.ofAll() = 0
 *     图片 ofImage() = 1
 *     视频 ofVideo() = 2
 *     音频 ofAudio() = 3
 * </pre>
 * @param mimeType 相册选择类型
 * @return {@link PicConfig}
 */
public PicConfig setMimeType(final int mimeType) {
    // 超过最大、最小值都默认为全部类型
    if (mimeType > PictureMimeType.ofAudio() || mimeType < PictureMimeType.ofAll()) {
        this.mimeType = PictureMimeType.ofAll();
    } else {
        this.mimeType = mimeType;
    }
    return this;
}