Android-Universal-Image-Loader icon indicating copy to clipboard operation
Android-Universal-Image-Loader copied to clipboard

Lazy Loading on TextView compound

Open flagadajones opened this issue 13 years ago • 6 comments

Hi,

I use many Text View compound and i need cache for image

Is it possible to create method like this ?

public void displayImage(String uri, TextView textView, int compoundPosition);

flagadajones avatar Jun 12 '13 16:06 flagadajones

Hi, I won't add additional method because you can use following solution (e.g. for top compound):

ImageSize targetSize = new ImageSize(50, 50); // choose your size
loadImage(uri, targetSize, displayOptions, new SimpleImageLoadingListener() {
        @Override
        void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                Drawable topImage = new BitmapDrawable(loadedImage);
                textView.setCompoundDrawablesWithIntrinsicBounds(null, topImage, null null);
        }
});

nostra13 avatar Jun 12 '13 20:06 nostra13

Sorry but when i try your method u get an error like this : error: no suitable method found for displayImage(String,TextView, SimpleImageLoadingListener)

SimpleImageLoadingListener methods get a View but all methods in ImageLoader take only an ImageView then it can't work.

flagadajones avatar Jun 12 '13 23:06 flagadajones

Sorry, use loadImage(...) method instead. I changed my previous post.

nostra13 avatar Jun 13 '13 07:06 nostra13

thanks

flagadajones avatar Jun 13 '13 15:06 flagadajones

Hey I was using something like with with RoundedBitmapDisplayer.roundCorners() function. The new RoundedBitmapDisplayer do not have this helper method and I cannot use it because it does not support loading compound drawable.

What to do besides copy and pasting RoundedDrawable class? Maybe you can make it public?

tasomaniac avatar Jan 06 '14 16:01 tasomaniac

I can.

nostra13 avatar Jan 07 '14 13:01 nostra13