我正在尝试通过滑行变换来淡化图像视图。但是我无法这样做,因为我正在使用请求侦听器。
代码:
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();
如何解决这个问题?