feat: 优化代码

pull/178/head
kunfei 5 years ago
parent 0c469cbfd3
commit ef1c7ad698
  1. 3
      app/src/main/java/io/legado/app/utils/GsonExtensions.kt

@ -15,8 +15,7 @@ val GSON: Gson by lazy {
.create() .create()
} }
inline fun <reified T> genericType() = object : TypeToken<T>() {}.type inline fun <reified T> genericType(): Type = object : TypeToken<T>() {}.type
@Throws(JsonSyntaxException::class) @Throws(JsonSyntaxException::class)
inline fun <reified T> Gson.fromJsonObject(json: String?): T? {//可转成任意类型 inline fun <reified T> Gson.fromJsonObject(json: String?): T? {//可转成任意类型

Loading…
Cancel
Save