|
@@ -18,6 +18,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.SystemNotification;
|
|
import com.sheep.gamegroup.model.entity.SystemNotification;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.util.AutoTaskListUtil;
|
|
import com.sheep.gamegroup.model.util.AutoTaskListUtil;
|
|
|
|
|
+import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.service.FloatShotScreenService;
|
|
import com.sheep.jiuyan.samllsheep.service.FloatShotScreenService;
|
|
@@ -59,9 +60,10 @@ public class DataUtil {
|
|
|
if (userEntity != null && !TextUtils.equals(userEntity.getId(), uid)) {//当前用户id与缓存的用户信息不符时,清除缓存
|
|
if (userEntity != null && !TextUtils.equals(userEntity.getId(), uid)) {//当前用户id与缓存的用户信息不符时,清除缓存
|
|
|
clearData();
|
|
clearData();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ initScreenShotConfig();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
public static DataUtil getInstance() {
|
|
public static DataUtil getInstance() {
|
|
|
if (instance == null) {
|
|
if (instance == null) {
|
|
|
instance = new DataUtil();
|
|
instance = new DataUtil();
|
|
@@ -292,9 +294,27 @@ public class DataUtil {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
//是否使用小绵羊截图方案
|
|
//是否使用小绵羊截图方案
|
|
|
- public static final boolean IS_USE_SCREEN_SHOT = true;
|
|
|
|
|
|
|
+ public static boolean IS_USE_SCREEN_SHOT = true;
|
|
|
//是否监听媒体库图片变化
|
|
//是否监听媒体库图片变化
|
|
|
- public static final boolean IS_LISTEN_SCREEN_SHOT = true;
|
|
|
|
|
|
|
+ public static boolean IS_LISTEN_SCREEN_SHOT = true;
|
|
|
|
|
+ //初始化是否启用小绵羊两种截图方案
|
|
|
|
|
+ private void initScreenShotConfig() {
|
|
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().needShotScreen()
|
|
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
+ boolean isOpen = baseMessage.getData(Boolean.class);
|
|
|
|
|
+ IS_USE_SCREEN_SHOT = isOpen;
|
|
|
|
|
+ IS_LISTEN_SCREEN_SHOT = isOpen;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
/**
|
|
/**
|
|
|
* 截图路径
|
|
* 截图路径
|
|
|
*
|
|
*
|