From 5582df3669da1468d0ca32f339cb39112468f135 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 21 Aug 2019 11:27:23 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/ReadBookConfig.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 72906baf8..5352a049d 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -3,7 +3,6 @@ package io.legado.app.help import android.graphics.Color import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable -import com.google.gson.reflect.TypeToken import io.legado.app.App import io.legado.app.utils.GSON import io.legado.app.utils.fromJsonArray @@ -24,7 +23,6 @@ object ReadBookConfig { String(App.INSTANCE.assets.open("readConfig.json").readBytes()) } try { -// val listType = object : TypeToken>() {}.type GSON.fromJsonArray(json)?.let { list.addAll(it) } @@ -70,8 +68,7 @@ object ReadBookConfig { fun reset() { try { val json = String(App.INSTANCE.assets.open("readConfig.json").readBytes()) - val listType = object : TypeToken>() {}.type - GSON.fromJson>(json, listType)?.let { + GSON.fromJsonArray(json)?.let { configList.clear() configList.addAll(it) }