Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法判断成功回调时加载的图片是否从内存而来,源码没有扔出这个信息 #48

Closed
4iconfont opened this issue Aug 25, 2019 · 5 comments

Comments

@4iconfont
Copy link

No description provided.

@zmtzawqlp
Copy link
Member

1.从内存里面找
2.从本地缓存里面找
3.从网络下载

代码请看ImageProvider

@4iconfont
Copy link
Author

场景:在loadStateChanged: (ExtendedImageState state)中state complete里,当图片从网络中加载时给widget做透明度动画,当图片从内存中加载时就没必要做动画了,ImageProvider做好了所有的逻辑,但是extended_image貌似没有抛出来这个信息,或者是我哪里看漏了吗?

@zmtzawqlp
Copy link
Member

那你重写ImageProvider 就可以满足要求了。

@4iconfont
Copy link
Author

这个回答真的很赞,我当然可以自己实现,不会超过20行代码,只是我觉得一个优秀的库应该做到简单易用且功能齐全吧,当然前提不是想要什么就让你塞进去什么,私以为这个需求还是蛮基础的,如果能添加进来可能选择使用这个库的开发者会更加开心顺利。
我只是提出了一个讨论,如有唐突,敬请见谅

@zmtzawqlp
Copy link
Member

ImageProvider 的resolve 方法里面指明了怎么判断这个图片是否已经在内存中有缓存的。对一个组件来说,你这个需求不是一个大众需求。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants