From 2e405256790f2724f6c5ea927c5aaf0c48530ace Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 6 Sep 2019 15:58:16 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/help/http/EncodeConverter.kt | 8 +------- app/src/main/java/io/legado/app/help/http/HttpHelper.kt | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/http/EncodeConverter.kt b/app/src/main/java/io/legado/app/help/http/EncodeConverter.kt index a371135d0..b17f50ef8 100644 --- a/app/src/main/java/io/legado/app/help/http/EncodeConverter.kt +++ b/app/src/main/java/io/legado/app/help/http/EncodeConverter.kt @@ -6,7 +6,7 @@ import retrofit2.Retrofit import java.lang.reflect.Type import java.nio.charset.Charset -class EncodeConverter private constructor(private val encode: String? = null) : Converter.Factory() { +class EncodeConverter(private val encode: String? = null) : Converter.Factory() { override fun responseBodyConverter( type: Type?, @@ -33,10 +33,4 @@ class EncodeConverter private constructor(private val encode: String? = null) : } } - companion object { - - fun create(encode: String? = null): EncodeConverter { - return EncodeConverter(encode) - } - } } diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index 5ae7c286e..2945d2882 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -44,7 +44,7 @@ object HttpHelper { fun getRetrofit(baseUrl: String, encode: String? = null): Retrofit { return Retrofit.Builder().baseUrl(baseUrl) //增加返回值为字符串的支持(以实体类返回) - .addConverterFactory(EncodeConverter.create(encode)) + .addConverterFactory(EncodeConverter(encode)) //增加返回值为Observable的支持 .addCallAdapterFactory(CoroutinesCallAdapterFactory.create()) .client(client)