wrapp-archive / WebImage-Android

Asynchronous image loading library for Android
MIT License
41 stars 5 forks source link

Enhancement: Animate image #11

Open ghost opened 12 years ago

ghost commented 12 years ago

Would be nice to have an option to animate the loaded image, like slide-in form left or fade-in.

nikreiman commented 12 years ago

I don't think that this should be an option, at least not to the WebImageView class. However, I do think it is useful and in fact, Wrapp's Android app has several subclasses of WebImageView which provide scaling and fading image animations after the image has been loaded. Most of them are far to specialized to be generally useful, and therefore I did not make these classes part of WebImage. I feel that a good library should only provide a small but very well-defined set of functions, and allow for easy subclassing or extensibility by the caller.

Another issue here is that different animations require special attention before they can be started. Sometimes the view's visibility state must be changed, or the layout parameters set, etc. Therefore IMHO it doesn't make sense to have a single method where an Animation could be passed in as an option to setImageUrl().

I'm not going to close this issue, but I also would need some time to think about the best way to solve all of these issues. However, if you think you have a clever way to solve it, send a pull request and I'll take a look at it.