android - 使用 2 个显示器的通用图像加载器

标签 android universal-image-loader

如何向我的图像添加 FadeInBitmapDisplayer 和 RoundedBitmapDisplayer?

这是我的 DisplayImageOptions

options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.appwidget
.cacheInMemory().displayer(new FadeInBitmapDisplayer(1500))
.build();

有没有可能只使用一次淡入效果?如果它已加载并且我向下滚动我的列表并再次向上滚动它不会第二次 FadeIn?

提前致谢!

最佳答案

How can I add a FadeInBitmapDisplayer AND a RoundedBitmapDisplayer to my Image?

当前版本不行。您可以创建自己的显示器(扩展 BitmapDisplayer)并将代码从 FadeInBitmapDisplayer 和 RoundedBitmapDisplayer 复制到您的类中。

And is it possible somehow to only use the FadeIn Effect once?

几乎一切皆有可能:) 但它不会那么方便。

您可以在某些 map 中保留显示的图像 URL ( Map<String, Boolean> = [Image URL<->isDisplayed]) 并在 imageLoader.displayImage(...) 之前检查此 map 称呼。如果当前 URL 的图像在 map 中(即显示图像),则仅使用 RoundedBitmapDisplayer 的选项。如果当前 URL 的图像不在 map 中,则使用带有 FadeInBitmapDisplayer+RoundedBitmapDisplayer 显示器的选项。

关于android - 使用 2 个显示器的通用图像加载器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13661918/

相关文章:

android - 如何在 ImageViewTouch 中使图像适合全屏

java - Android KSOAP2 请求到 PHP SOAP 服务器

java - onRequestPermissionsResult 回调必须等待方法调用 requestPermissions 完成

Android 清理虚拟内存

android - java.lang.IllegalStateException : ImageLoader must be init with configuration before using

java - 使用Android-UIL,如何停止下载?

android - 在通用图像加载器中为下载失败添加图像

android - 生成图 block 的更好方法

android - 从模型中获取 SQL 插入语句字符串?

android - 如何在 Android 中的 Edittext 上设置占位符并在用户未输入任何输入时使用它?