views:

24

answers:

0

My application uses thumbnails downloaded from the internet. The thumbnails are generated by the server, and one specifies in the request what size the thumbnails should be. Is there a way for me to know, programmatically, while inside a ListAdapter's getView(), the dimensions of an ImageView inside the View that is returned, so my thumbnail comes perfectly scaled? I can always hardcode it, but I'd prefer not to.

Alternatively, is there some sort of listener or callback I can use to request the thumb once the View has been laid out?

EDIT: The ImageViews have fixed layout_height and layout_width, however, I'd want to reuse the same code for different parts of the app, which use different size images, which is why hardcoding is particularly bad.