com.bumptech.glide.annotation.GlideOption Java Examples

The following examples show how to use com.bumptech.glide.annotation.GlideOption. 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: NewsGlideModule.java    From NewsApp with GNU General Public License v3.0 5 votes vote down vote up
@NonNull
@GlideOption
public static RequestOptions roundedCornerImage(RequestOptions options, @NonNull Context context, int radius) {
    if (radius > 0) {
        int px = Math.round(radius * (context.getResources().getDisplayMetrics().xdpi / DisplayMetrics.DENSITY_DEFAULT));
        return options.transforms(new CenterCrop(), new RoundedCorners(px));
    }
    return options.transforms(new CenterCrop());
}
 
Example #2
Source File: VinylGlideExtension.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@GlideOption
@NonNull
public static RequestOptions artistOptions(RequestOptions requestOptions, Artist artist) {
    return requestOptions
            .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
            .error(R.drawable.default_artist_image)
            .placeholder(R.drawable.default_artist_image)
            .priority(Priority.LOW)
            .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
            .signature(createSignature(artist));
}
 
Example #3
Source File: VinylGlideExtension.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@GlideOption
@NonNull
public static RequestOptions songOptions(RequestOptions requestOptions, Song song) {
    return requestOptions
            .diskCacheStrategy(DiskCacheStrategy.NONE)
            .error(R.drawable.default_album_art)
            .placeholder(R.drawable.default_album_art)
            .signature(createSignature(song));
}