|
|
@@ -229,10 +229,7 @@ public class MyApplication extends BaseApplication {
|
|
|
DatabaseManager.initializeInstance(DBOpenHelper.getInstance(this));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @desc:初始化分享组件
|
|
|
- * @author:Arison on 2016/9/29
|
|
|
- */
|
|
|
+
|
|
|
public void initShareAPI() {
|
|
|
PlatformConfig.setWeixin("wx2539cc96bf158e00", "b057aa3e807ba7c505a2f03cc541bbf6");
|
|
|
PlatformConfig.setSinaWeibo("493318722", "7def652c3683603b08bab87d34b1f944");
|
|
|
@@ -248,9 +245,7 @@ public class MyApplication extends BaseApplication {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 为HttpUtils配置参数
|
|
|
- */
|
|
|
+
|
|
|
private void configHttpUtils() {
|
|
|
mHttpUtils.configRequestThreadPoolSize(4);
|
|
|
mHttpUtils.configRequestRetryCount(3);
|
|
|
@@ -357,6 +352,21 @@ public class MyApplication extends BaseApplication {
|
|
|
.threadPoolSize(4)
|
|
|
.build();
|
|
|
ImageLoader.getInstance().init(config);
|
|
|
+ }else{
|
|
|
+ //getCacheDir()
|
|
|
+ ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).defaultDisplayImageOptions(mNormalImageOptions)
|
|
|
+ // .denyCacheImageMultipleSizesInMemory()
|
|
|
+ .discCache(new TotalSizeLimitedDiscCache(getCacheDir(), 50 * 1024 * 1024))
|
|
|
+ // 最多缓存50M的图片
|
|
|
+ .discCacheFileNameGenerator(new Md5FileNameGenerator())
|
|
|
+ .memoryCache(memoryCache)
|
|
|
+ .tasksProcessingOrder(QueueProcessingType.LIFO)
|
|
|
+ .threadPriority(Thread.NORM_PRIORITY - 2)
|
|
|
+ .imageDownloader(new AuthImageDownloader(this))
|
|
|
+ .denyCacheImageMultipleSizesInMemory()
|
|
|
+ .threadPoolSize(4)
|
|
|
+ .build();
|
|
|
+ ImageLoader.getInstance().init(config);
|
|
|
}
|
|
|
|
|
|
|