Search code examples
androidandroid-imageviewuniversal-image-loader

image downloaded using universal image loader have same fixed size


i m using UIL to download and show images in imageview

firstly i didn't specify the

memoryCacheExtraOptions(int, int) option

for loader configuration and i was using it to show a thumbnail for my images downloaded from server and the result was as i want

but now i want to show each image in different activity and now i want to fit the entire imageview size that i specified

so i tried to add this option

 memoryCacheExtraOptions(myimageviewwidth, myimageviewheight)

but the result was same and the the image in the details activity is shown smaller than image in thumbnail

this is my configuration

 configuration=new ImageLoaderConfiguration.Builder(getActivity().getApplicationContext())
            .threadPriority(Thread.NORM_PRIORITY-2)
            .denyCacheImageMultipleSizesInMemory()
            .diskCacheFileNameGenerator(new Md5FileNameGenerator())
            .tasksProcessingOrder(QueueProcessingType.LIFO)
            .build();

and this is my image view

   <ImageView
        android:id="@+id/p_image"
        android:layout_width="wrap_content"
        android:layout_height="380dp"
        android:src="@drawable/d" 
        android:layout_gravity="center_horizontal"/>

those are to image of the result that i got

thumbnail

details

any help?


Solution

  • i fixed my problem by doing no thing with image loader

    just i added those two line to the image view XML

    android:scaleType="fitStart"
    android:adjustViewBounds="true"