Browse Source

删除gson的引用

zengjiebin 7 years ago
parent
commit
822f5d78f9

+ 1 - 1
app/build.gradle

@@ -202,7 +202,7 @@ dependencies {
 
     //获取动态权限三方库
     implementation 'pub.devrel:easypermissions:1.2.0'
-    implementation 'net.danlew:android.joda:2.9.3'
+//    implementation 'net.danlew:android.joda:2.9.3'
     implementation 'com.orhanobut:logger:1.15'
 
     //友盟

+ 0 - 27
app/src/main/java/com/sheep/gamegroup/model/util/DateTimeTypeAdapter.java

@@ -1,27 +0,0 @@
-package com.sheep.gamegroup.model.util;
-
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParseException;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-
-import org.joda.time.DateTime;
-
-import java.lang.reflect.Type;
-
-public class DateTimeTypeAdapter implements JsonSerializer<DateTime>, JsonDeserializer<DateTime> {
-
-    @Override
-    public JsonElement serialize(DateTime src, Type typeOfSrc, JsonSerializationContext context) {
-        return new JsonPrimitive(src.toString());
-    }
-
-    @Override
-    public DateTime deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
-        return new DateTime(json.getAsString());
-    }
-
-}

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/util/ExceptionHandle.java

@@ -3,7 +3,6 @@ package com.sheep.gamegroup.model.util;
 import android.util.Log;
 
 import com.alibaba.fastjson.JSONException;
-import com.google.gson.JsonParseException;
 
 import java.io.IOException;
 import java.net.ConnectException;
@@ -55,8 +54,9 @@ public class ExceptionHandle {
             ex = new ResponeThrowable(resultException, resultException.code);
             ex.message = resultException.message;
             return ex;
-        } else if (e instanceof JsonParseException
-                || e instanceof JSONException
+        } else if (
+//                e instanceof JsonParseException//
+                 e instanceof JSONException
                 /*|| e instanceof ParseException*/) {
             ex = new ResponeThrowable(e, ERROR.PARSE_ERROR);
             ex.message = "解析错误";

+ 0 - 2
app/src/main/java/com/sheep/gamegroup/presenter/PhonePresenter.java

@@ -3,12 +3,10 @@ package com.sheep.gamegroup.presenter;
 import android.util.Log;
 
 import com.alibaba.fastjson.JSONObject;
-import com.google.gson.Gson;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ChannelContent;
-import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.PreferenceUtils;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.jiuyan.samllsheep.SheepApp;

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -43,7 +43,6 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSONArray;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
-import com.google.gson.Gson;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.scwang.smartrefresh.layout.api.RefreshLayout;