Back to project page CommonLibs.
The source code is released under:
Apache License
If you think the Android project CommonLibs listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.alex.common; /*from w w w . j a v a2 s.c o m*/ import com.nostra13.universalimageloader.cache.memory.impl.UsingFreqLimitedMemoryCache; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.nostra13.universalimageloader.core.assist.ImageScaleType; import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; import android.app.Application; import android.graphics.Bitmap; /** * App?????? * @author caisenchuan */ public class AppControl extends Application { /*-------------------------- * ??? *-------------------------*/ /*-------------------------- * ????? *-------------------------*/ /*-------------------------- * ???????? *-------------------------*/ /*-------------------------- * public?? *-------------------------*/ @Override public void onCreate() { super.onCreate(); //ImageLoader DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder() .cacheOnDisc(true) .cacheInMemory(true) .displayer(new FadeInBitmapDisplayer(50)) .bitmapConfig(Bitmap.Config.RGB_565) .imageScaleType(ImageScaleType.EXACTLY) .showImageOnLoading(R.drawable.empty_photo) .showImageForEmptyUri(R.drawable.empty_photo) .showImageOnFail(R.drawable.empty_photo) .build(); ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()) .memoryCache(new UsingFreqLimitedMemoryCache(16 * 1024 * 1024)) .defaultDisplayImageOptions(defaultOptions).build(); ImageLoader.getInstance().init(config); } /*-------------------------- * protected??packet?? *-------------------------*/ /*-------------------------- * private?? *-------------------------*/ }