use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project ABPlayer by winkstu.
the class HomePageFragment method initImageLoader.
private void initImageLoader() {
File cacheDir = com.nostra13.universalimageloader.utils.StorageUtils.getOwnCacheDirectory(this.getActivity().getApplicationContext(), IMAGE_CACHE_PATH);
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisc(true).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this.getActivity()).defaultDisplayImageOptions(defaultOptions).memoryCache(new LruMemoryCache(12 * 1024 * 1024)).memoryCacheSize(12 * 1024 * 1024).discCacheSize(32 * 1024 * 1024).discCacheFileCount(100).discCache(new UnlimitedDiscCache(cacheDir)).threadPriority(Thread.NORM_PRIORITY - 2).tasksProcessingOrder(QueueProcessingType.LIFO).build();
ImageLoader.getInstance().init(config);
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project V2HOT by djyde.
the class ContentActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
}
setContentView(R.layout.activity_content);
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).build();
ImageLoader.getInstance().init(config);
Intent intent = getIntent();
String id = intent.getStringExtra("id");
String content = intent.getStringExtra("content");
String username = intent.getStringExtra("username");
title = intent.getStringExtra("title");
url = intent.getStringExtra("url");
final RepliesAdapter repliesAdapter = new RepliesAdapter(this, username);
ListView repliesView = (ListView) findViewById(R.id.replies);
View headerView = getLayoutInflater().inflate(R.layout.topic_header, repliesView, false);
((TextView) headerView.findViewById(R.id.header_title)).setText(title);
((TextView) headerView.findViewById(R.id.header_content)).setText(content);
((TextView) headerView.findViewById(R.id.header_username)).setText(username);
repliesView.addHeaderView(headerView);
repliesView.setAdapter(repliesAdapter);
RequestQueue queue = Volley.newRequestQueue(ContentActivity.this);
// 获取回复
queue.add(new GsonRequest<ReplyList>(Request.Method.GET, "https://www.v2ex.com/api/replies/show.json?topic_id=" + id, ReplyList.class, new Response.Listener<ReplyList>() {
@Override
public void onResponse(ReplyList response) {
repliesAdapter.addAll(response);
repliesAdapter.notifyDataSetChanged();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(ContentActivity.this, "请检查网络", Toast.LENGTH_LONG).show();
}
}));
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project ImagePicker by jeasonlzy.
the class GApp method onCreate.
@Override
public void onCreate() {
super.onCreate();
ImageLoaderConfiguration config = ImageLoaderConfiguration.createDefault(this);
//UniversalImageLoader初始化
ImageLoader.getInstance().init(config);
//xUtils3初始化
x.Ext.init(this);
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project fresco by facebook.
the class SampleUilFactory method getImageLoader.
public static ImageLoader getImageLoader(Context context) {
if (sImageLoader == null) {
DisplayImageOptions displayImageOptions = new DisplayImageOptions.Builder().showImageOnLoading(Drawables.sPlaceholderDrawable).showImageOnFail(Drawables.sErrorDrawable).cacheInMemory(true).cacheOnDisk(true).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).defaultDisplayImageOptions(displayImageOptions).diskCacheSize(ConfigConstants.MAX_DISK_CACHE_SIZE).memoryCacheSize(ConfigConstants.MAX_MEMORY_CACHE_SIZE).build();
sImageLoader = ImageLoader.getInstance();
sImageLoader.init(config);
}
return sImageLoader;
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project ZhihuDailyPurify by izzyleung.
the class ZhihuDailyPurifyApplication method initImageLoader.
public static void initImageLoader(Context context) {
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).denyCacheImageMultipleSizesInMemory().threadPriority(Thread.NORM_PRIORITY - 2).diskCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).build();
ImageLoader.getInstance().init(config);
}
Aggregations