com.bumptech.glide.GenericTransitionOptions Java Examples

The following examples show how to use com.bumptech.glide.GenericTransitionOptions. 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: SongFileAdapter.java    From VinylMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
@SuppressWarnings("ConstantConditions")
protected void loadFileImage(File file, final ViewHolder holder) {
    final int iconColor = ATHUtil.resolveColor(activity, R.attr.iconColor);
    if (file.isDirectory()) {
        holder.image.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN);
        holder.image.setImageResource(R.drawable.ic_folder_white_24dp);
    } else {
        Drawable error = ImageUtil.getTintedVectorDrawable(activity, R.drawable.ic_file_music_white_24dp, iconColor);
        GlideApp.with(activity)
                .load(new AudioFileCover(file.getPath()))
                .transition(GenericTransitionOptions.with(android.R.anim.fade_in))
                .apply(new RequestOptions()
                        .diskCacheStrategy(DiskCacheStrategy.NONE)
                        .error(error)
                        .placeholder(error)
                        .signature(new MediaStoreSignature("", file.lastModified(), 0)))
                .into(holder.image);
    }
}
 
Example #2
Source File: AlbumTagEditorActivity.java    From VinylMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void loadImageFromFile(@NonNull final Uri selectedFileUri) {
    GlideApp.with(AlbumTagEditorActivity.this)
            .as(BitmapPaletteWrapper.class)
            .load(selectedFileUri)
            .transition(new GenericTransitionOptions<BitmapPaletteWrapper>().transition(android.R.anim.fade_in))
            .apply(new RequestOptions()
                    .diskCacheStrategy(DiskCacheStrategy.NONE)
                    .skipMemoryCache(true))
            .into(new VinylSimpleTarget<BitmapPaletteWrapper>() {
                @Override
                public void onLoadFailed(@Nullable Drawable errorDrawable) {
                    super.onLoadFailed(errorDrawable);
                }

                @Override
                public void onResourceReady(@NonNull BitmapPaletteWrapper resource, Transition<? super BitmapPaletteWrapper> glideAnimation) {
                    VinylMusicPlayerColorUtil.getColor(resource.getPalette(), Color.TRANSPARENT);
                    albumArtBitmap = ImageUtil.resizeBitmap(resource.getBitmap(), 2048);
                    setImageBitmap(albumArtBitmap, VinylMusicPlayerColorUtil.getColor(resource.getPalette(), ATHUtil.resolveColor(AlbumTagEditorActivity.this, R.attr.defaultFooterColor)));
                    deleteAlbumArt = false;
                    dataChanged();
                    setResult(RESULT_OK);
                }
            });
}
 
Example #3
Source File: GlideUtils.java    From AndroidQuick with MIT License 5 votes vote down vote up
/**
 * api也提供了几个常用的动画:比如crossFade()
 */

//设置加载动画
public static void loadImageViewAnim(String path, int anim, ImageView mImageView) {
    if (AppUtil.isContextValid(mImageView.getContext())) {
        Glide.with(mImageView.getContext()).load(path).transition(GenericTransitionOptions.with(anim)).into(mImageView);
    }
}
 
Example #4
Source File: SongGlideRequest.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public RequestBuilder<Bitmap> build() {
    //noinspection unchecked
    return createBaseRequest(requestManager, song, ignoreMediaStore)
            .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)
            .error(DEFAULT_ERROR_IMAGE)
            .transition(GenericTransitionOptions.with(DEFAULT_ANIMATION))
            .signature(createSignature(song));
}
 
Example #5
Source File: SongGlideRequest.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public RequestBuilder<Bitmap> build() {
    //noinspection unchecked
    return createBaseRequest(builder.requestManager, builder.song, builder.ignoreMediaStore)
            .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)
            .error(DEFAULT_ERROR_IMAGE)
            .transition(GenericTransitionOptions.with(DEFAULT_ANIMATION))
            .signature(createSignature(builder.song));
}
 
Example #6
Source File: SongGlideRequest.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public RequestBuilder<Bitmap> build() {
    //noinspection unchecked
    return createBaseRequest(builder.requestManager, builder.song, builder.ignoreMediaStore)

      //     .transcode(new BitmapPaletteTranscoder(context), BitmapPaletteWrapper.class)
            .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)
            .error(DEFAULT_ERROR_IMAGE)
            .transition(GenericTransitionOptions.with(DEFAULT_ANIMATION))
            .signature(createSignature(builder.song));
}
 
Example #7
Source File: ArtistGlideRequest.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public RequestBuilder<Bitmap> build() {
    return createBaseRequest(requestManager, artist, noCustomImage, forceDownload, mLoadOriginalImage, mImageNumber)
            .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)

            .transition(GenericTransitionOptions.with(DEFAULT_ANIMATION))
            .priority(Priority.LOW)
            //.override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
            .signature(createSignature(artist,mLoadOriginalImage, mImageNumber));
}
 
Example #8
Source File: ArtistGlideRequest.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public RequestBuilder<Bitmap> build() {
    //noinspection unchecked
    return createBaseRequest(builder.requestManager, builder.artist, builder.noCustomImage, builder.forceDownload, builder.mLoadOriginalImage, builder.mImageNumber)
            //.transcode(new BitmapPaletteTranscoder(context), BitmapPaletteWrapper.class)
            .diskCacheStrategy(DEFAULT_DISK_CACHE_STRATEGY)

            .transition(GenericTransitionOptions.with(DEFAULT_ANIMATION))
            .priority(Priority.LOW)
            .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
            .signature(createSignature(builder.artist,builder.mLoadOriginalImage, builder.mImageNumber));
}
 
Example #9
Source File: VinylGlideExtension.java    From VinylMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
public static <TranscodeType> GenericTransitionOptions<TranscodeType> getDefaultTransition() {
    return new GenericTransitionOptions<TranscodeType>().transition(android.R.anim.fade_in);
}