|
|
@@ -16,6 +16,7 @@ import com.baidu.location.BDLocation;
|
|
|
import com.baidu.location.LocationClient;
|
|
|
import com.baidu.location.LocationClientOption;
|
|
|
import com.bumptech.glide.Glide;
|
|
|
+import com.danikula.videocache.HttpProxyCacheServer;
|
|
|
import com.liulishuo.okdownload.OkDownload;
|
|
|
import com.liulishuo.okdownload.core.dispatcher.DownloadDispatcher;
|
|
|
import com.sheep.gamegroup.di.components.DaggerNetComponent;
|
|
|
@@ -32,6 +33,7 @@ import com.sheep.gamegroup.util.DataKey;
|
|
|
import com.sheep.gamegroup.util.DataUtil;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.LogUtil;
|
|
|
+import com.sheep.gamegroup.util.MyFileNameGenerator;
|
|
|
import com.sheep.gamegroup.util.RefreshUtil;
|
|
|
import com.sheep.gamegroup.util.SysAppUtil;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
@@ -354,6 +356,22 @@ public class SheepApp extends MultiDexApplication {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ private HttpProxyCacheServer proxy;
|
|
|
+
|
|
|
+ //AndroidVideoCache 获取缓存代表服务器,可缓存视频
|
|
|
+ //https://github.com/danikula/AndroidVideoCache
|
|
|
+ public static HttpProxyCacheServer getHttpProxyCacheServer() {
|
|
|
+ return mSheepApp.proxy == null ? (mSheepApp.proxy = mSheepApp.newHttpProxyCacheServer()) : mSheepApp.proxy;
|
|
|
+ }
|
|
|
+
|
|
|
+ private HttpProxyCacheServer newHttpProxyCacheServer() {
|
|
|
+ return new HttpProxyCacheServer.Builder(this)
|
|
|
+ .maxCacheSize(2L * 1024 * 1024 * 1024) // 2 Gb for cache
|
|
|
+ .maxCacheFilesCount(20)////最多缓存个数
|
|
|
+ .fileNameGenerator(new MyFileNameGenerator())
|
|
|
+ .build();
|
|
|
+ }
|
|
|
+
|
|
|
public int mActivityCount;//显示的activity的个数, 0个时代表暂停或退出应用,1个代表应用正显示在用户面前
|
|
|
private boolean notStop = false;
|
|
|
/**
|