wrapp-archive / WebImage-Android

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

Enhancement: event when Image is loaded #1

Closed thiagolocatelli closed 12 years ago

thiagolocatelli commented 13 years ago

Is it possible to add an event when the image is loaded? This way we can trigger some aditional logic when a specific image has been downloaded and loaded.

nikreiman commented 12 years ago

Great point! While you could do this in the current API, it wasn't possible without overriding onDrawableLoaded(), which I don't think is a good solution. Also, I've been meaning to implement callbacks for image errors so that the view can display a broken image placeholder or something similar.

I've implemented these changes in the "develop" branch but am not 100% certain that this will be the final interface used in version 1.0.1. However, the next version will definitely have the ability to easily override WebImageView and get callbacks about when images are finished loading.

thiagolocatelli commented 12 years ago

That would be awesome, looking forward for these changes!

nikreiman commented 12 years ago

This has been implemented in 1.1.0; there is now a Listener interface in WebImageView which you can implement and pass to a WebImageView class to receive updates about image loading status. Check out the example project for a usage example.