Java Code Examples for com.bumptech.glide.RequestManager#loadFromMediaStore()

The following examples show how to use com.bumptech.glide.RequestManager#loadFromMediaStore() . 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: SongGlideRequest.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
public static DrawableTypeRequest createBaseRequest(RequestManager requestManager, Song song, boolean ignoreMediaStore) {
    if (ignoreMediaStore) {
        return requestManager.load(new AudioFileCover(song.data));
    } else {
        return requestManager.loadFromMediaStore(MusicUtil.getMediaStoreAlbumCoverUri(song.albumId));
    }
}
 
Example 2
Source File: GlideLoader.java    From ImageLoader with Apache License 2.0 5 votes vote down vote up
@Nullable
private DrawableTypeRequest getDrawableTypeRequest(SingleConfig config, RequestManager requestManager) {
    DrawableTypeRequest request = null;
    if(!TextUtils.isEmpty(config.getUrl())){
        request= requestManager.load(MyUtil.appendUrl(config.getUrl()));
    }else if(!TextUtils.isEmpty(config.getFilePath())){
        request= requestManager.load(config.getFilePath());
    }else if(!TextUtils.isEmpty(config.getContentProvider())){
        request= requestManager.loadFromMediaStore(Uri.parse(config.getContentProvider()));
    }else if(config.getResId() != 0){
        request= requestManager.load(config.getResId());
    }else if(config.getBytes() != null){
        request = requestManager.load(config.getBytes());
    } else {
        //request= requestManager.load("http://www.baidu.com/1.jpg");//故意失败
        int resId = getUseableResId(config);
        if(resId != 0){
            request = requestManager.load(resId);
        }else {
            request= requestManager.load("");
        }
    }
   /* if(!TextUtils.isEmpty(config.getUrl()) && config.getUrl().contains(".gif")){
        request.diskCacheStrategy(DiskCacheStrategy.ALL);//只缓存result
    }else{
        request.diskCacheStrategy(DiskCacheStrategy.SOURCE);//只缓存原图
    }*/

    request.diskCacheStrategy(DiskCacheStrategy.SOURCE);//只缓存原图

    return request;
}
 
Example 3
Source File: SongGlideRequest.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
public static DrawableTypeRequest createBaseRequest(RequestManager requestManager, Song song, boolean ignoreMediaStore) {
    if (ignoreMediaStore) {
        return requestManager.load(new AudioFileCover(song.data));
    } else {
        return requestManager.loadFromMediaStore(MusicUtil.getMediaStoreAlbumCoverUri(song.albumId));
    }
}
 
Example 4
Source File: SongGlideRequest.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public static DrawableTypeRequest createBaseRequest(RequestManager requestManager, Song song, boolean ignoreMediaStore) {
    if (ignoreMediaStore) {
        return requestManager.load(new AudioFileCover(song.data));
    } else {
        return requestManager.loadFromMediaStore(MusicUtil.getMediaStoreAlbumCoverUri(song.albumId));
    }
}
 
Example 5
Source File: SongGlideRequest.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
public static DrawableTypeRequest createBaseRequest(RequestManager requestManager, Song song, boolean ignoreMediaStore) {
    if (ignoreMediaStore) {
        return requestManager.load(new AudioFileCover(song.data));
    } else {
        return requestManager.loadFromMediaStore(MusicUtil.getMediaStoreAlbumCoverUri(song.albumId));
    }
}