package com.example.zk.app;
import android.app.Application;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
/**
* Created by 灏忚枃 on 2018/7/16.
*/
public class App extends Application{
@Override
public void onCreate() {
super.onCreate();
inti();
}
private void inti() {
ImageLoaderConfiguration configuration=new ImageLoaderConfiguration
.Builder(getApplicationContext())
.defaultDisplayImageOptions(displayOption())
.build();
ImageLoader.getInstance().init(configuration);
}
private DisplayImageOptions displayOption() {
DisplayImageOptions options=new DisplayImageOptions
.Builder()
.displayer(new RoundedBitmapDisplayer(50))
.build();
return options;
}
}
//依赖
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'