Przeglądaj źródła

needShotScreen接口返回值变化

zengjiebin 7 lat temu
rodzic
commit
f6b70d2275

+ 17 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/ScreenShotConfig.java

@@ -0,0 +1,17 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/9/19.
+ * realicing@sina.com
+ */
+public class ScreenShotConfig {
+    private boolean need = true;//默认为true
+
+    public boolean isNeed() {
+        return need;
+    }
+
+    public void setNeed(boolean need) {
+        this.need = need;
+    }
+}

+ 6 - 4
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -15,7 +15,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.SystemNotification;
+import com.sheep.gamegroup.model.entity.ScreenShotConfig;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.AutoTaskListUtil;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
@@ -305,9 +305,11 @@ public class DataUtil {
                         .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;
+                                ScreenShotConfig config = baseMessage.getData(ScreenShotConfig.class);
+                                if(config != null) {
+                                    IS_USE_SCREEN_SHOT = config.isNeed();
+                                    IS_LISTEN_SCREEN_SHOT = config.isNeed();
+                                }
                             }
 
                             @Override