接头
程序员文章站
2022-03-04 13:33:51
...
http://api.expoon.com/AppNews/getNewsList/type/1/p/ 接口
http://172.17.8.100/movieApi/movie/v1/findReleaseMovieList?page=1&count=10 接口
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
权限
app
@Override
public void onCreate() {
super.onCreate();
File cacheDir = new File(Environment.getExternalStorageDirectory().getPath()+"/images");
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.mipmap.ic_launcher)
.showImageForEmptyUri(R.mipmap.ic_launcher)
.showImageOnFail(R.mipmap.ic_launcher)
.bitmapConfig(Bitmap.Config.ARGB_8888)
.cacheInMemory(true)
.cacheOnDisk(true)
.displayer(new RoundedBitmapDisplayer(40))
.build();
ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this)
.defaultDisplayImageOptions(options)
.diskCache(new UnlimitedDiskCache(cacheDir))
.build();
ImageLoader.getInstance().init(configuration);
}
public static DisplayImageOptions getDisplayImageOptions(){
DisplayImageOptions options = new DisplayImageOptions.Builder()
.displayer(new RoundedBitmapDisplayer(360))
.showImageOnFail(R.mipmap.ic_launcher)
.showImageForEmptyUri(R.mipmap.ic_launcher)
.showImageOnLoading(R.mipmap.ic_launcher)
.bitmapConfig(Bitmap.Config.ARGB_8888)
.cacheOnDisk(true)
.cacheInMemory(true)
.build();
return options;
}