android - ImageView: scale too large images down, don't scale too small images up -


i guess title says want do:

i have imageview, when image display has been loaded web (with uil) want

a. have image scaled down fit imageview if image larger imageview

b. not scale image rather display in it's original size when image smaller imageview

bot no problem

android:scaletype="fitcenter" 

for a. ,

android:scaletype="center" 

for b.

is there possibility combine two? option 'manually' compare size of imageview , size of loaded bitmap each other , set scaletype accordingly?

edit: uil config:

public static final displayimageoptions uiloptions = new displayimageoptions.builder()         .resetviewbeforeloading(true)         .bitmapconfig(bitmap.config.rgb_565)         .imagescaletype(imagescaletype.in_sample_int)         .cacheinmemory(true)         .cacheondisk(true)         .build();  imageloaderconfiguration = new imageloaderconfiguration.builder(this)         .threadpoolsize(2)         .defaultdisplayimageoptions(values.uiloptions).build(); 

try use attribute:

android:scaletype="centerinside"  

here link


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -