Detecting the Image Size to be displayed and use it by the Lazy Loading Image
I'd like to customized the size of the image used to cover up the real
image to be displayed. In the UIL config, we can have
.showStubImage(R.drawable.temp_drawable) as a display option.
My problem is, I am implementing a pinterest like view. By the time I
scroll from the images, there is this unstable positions of the images
because they are still being downloaded and covered up by a temp drawable.
For example, the temporary drawable is 45 X 45, then the image to be
displayed is 100 x 50. By the time the real image is showed there is this
displacement effect of the images while scrolling because the temp image
being replaced by the real one. Is there any way that we can detect the
real image height and width to be displayed while is it still being
downloaded, and using the width and height this can be used by the temp
image to temporarily display the image size?
options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.ic_stub)
.showImageForEmptyUri(R.drawable.ic_empty)
.showImageOnFail(R.drawable.ic_error)
.cacheInMemory(true)
.cacheOnDisc(true)
imageLoader.displayImage(imageUrls[position], hold.image, options);
No comments:
Post a Comment