Crossfade转换不适用于下滑侦听器

时间:2018-06-20 20:07:07

标签: android android-glide

我正在尝试通过滑行变换来淡化图像视图。但是我无法这样做,因为我正在使用请求侦听器。

代码:

 Glide.with((Activity) getActivity())
                        .asBitmap()
                        .load(songInfoModel.getAlbumIDArtwork())
                        .apply(new RequestOptions()
                                .transform(new BlurTransformation(70))
                                .override(240,320))
                        .transition(BitmapTransitionOptions.withCrossFade(500))
                        .listener(new RequestListener<Bitmap>() {
                            @Override
                            public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {

                               Glide.with(getActivity()).asBitmap()
                                       .load(imagepath
                                       .apply(new RequestOptions()
                                               .transform(new BlurTransformation(70)))
                                       .transition(BitmapTransitionOptions.withCrossFade(500))
                                       .into(backgroundImage);

                                return true;
                            }

                            @Override
                            public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {

                               backgroundImage.setImageBitmap(resource);


                                return true;
                            }
                        }).submit();

如何解决这个问题?

0 个答案:

没有答案