feat: 优化

pull/209/head
kunfei 5 years ago
parent acfe4de008
commit b3bc9ac976
  1. 6
      app/src/main/java/io/legado/app/utils/GsonExtensions.kt

@ -50,16 +50,16 @@ class ParameterizedTypeImpl(private val clazz: Class<*>) : ParameterizedType {
* 修复Int变为Double的问题 * 修复Int变为Double的问题
*/ */
class MapDeserializerDoubleAsIntFix : class MapDeserializerDoubleAsIntFix :
JsonDeserializer<Map<String, Any>?> { JsonDeserializer<Map<String, Any?>?> {
@Throws(JsonParseException::class) @Throws(JsonParseException::class)
override fun deserialize( override fun deserialize(
jsonElement: JsonElement, jsonElement: JsonElement,
type: Type, type: Type,
jsonDeserializationContext: JsonDeserializationContext jsonDeserializationContext: JsonDeserializationContext
): Map<String, Any>? { ): Map<String, Any?>? {
@Suppress("unchecked_cast") @Suppress("unchecked_cast")
return read(jsonElement) as? Map<String, Any> return read(jsonElement) as? Map<String, Any?>
} }
fun read(`in`: JsonElement): Any? { fun read(`in`: JsonElement): Any? {

Loading…
Cancel
Save