feat: 优化

pull/226/head 3.20.053120
gedoor 5 years ago
parent 46c28fc38c
commit f12f82e54e
  1. 2
      app/build.gradle
  2. 1
      app/src/main/assets/updateLog.md
  3. 1
      app/src/main/java/io/legado/app/data/entities/Book.kt
  4. 2
      app/src/main/java/io/legado/app/data/entities/SearchBook.kt
  5. 2
      app/src/main/java/io/legado/app/utils/GsonExtensions.kt

@ -56,7 +56,7 @@ android {
signingConfig signingConfigs.myConfig signingConfig signingConfigs.myConfig
} }
applicationIdSuffix '.release' applicationIdSuffix '.release'
minifyEnabled true minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
debug { debug {

@ -7,6 +7,7 @@
* 更新到android studio 4.0 * 更新到android studio 4.0
* 书源排序添加按url * 书源排序添加按url
* 去除朗读通知的进度条 * 去除朗读通知的进度条
* 修复恢复问题,暂时去除混淆
**2020/05/24** **2020/05/24**
* 添加自动翻页速度调节 * 添加自动翻页速度调节

@ -71,6 +71,7 @@ data class Book(
return bookUrl.hashCode() return bookUrl.hashCode()
} }
@delegate:Transient
@delegate:Ignore @delegate:Ignore
@IgnoredOnParcel @IgnoredOnParcel
override val variableMap by lazy { override val variableMap by lazy {

@ -63,6 +63,7 @@ data class SearchBook(
return other.originOrder - this.originOrder return other.originOrder - this.originOrder
} }
@delegate:Transient
@delegate:Ignore @delegate:Ignore
@IgnoredOnParcel @IgnoredOnParcel
override val variableMap by lazy { override val variableMap by lazy {
@ -74,6 +75,7 @@ data class SearchBook(
variable = GSON.toJson(variableMap) variable = GSON.toJson(variableMap)
} }
@delegate:Transient
@delegate:Ignore @delegate:Ignore
@IgnoredOnParcel @IgnoredOnParcel
val origins: LinkedHashSet<String> by lazy { linkedSetOf(origin) } val origins: LinkedHashSet<String> by lazy { linkedSetOf(origin) }

@ -22,7 +22,6 @@ val GSON: Gson by lazy {
inline fun <reified T> genericType(): Type = object : TypeToken<T>() {}.type inline fun <reified T> genericType(): Type = object : TypeToken<T>() {}.type
@Throws(JsonSyntaxException::class)
inline fun <reified T> Gson.fromJsonObject(json: String?): T? {//可转成任意类型 inline fun <reified T> Gson.fromJsonObject(json: String?): T? {//可转成任意类型
return attempt { return attempt {
val result: T? = fromJson(json, genericType<T>()) val result: T? = fromJson(json, genericType<T>())
@ -30,7 +29,6 @@ inline fun <reified T> Gson.fromJsonObject(json: String?): T? {//可转成任意
}.value }.value
} }
@Throws(JsonSyntaxException::class)
inline fun <reified T> Gson.fromJsonArray(json: String?): List<T>? { inline fun <reified T> Gson.fromJsonArray(json: String?): List<T>? {
return attempt { return attempt {
val result: List<T>? = fromJson(json, ParameterizedTypeImpl(T::class.java)) val result: List<T>? = fromJson(json, ParameterizedTypeImpl(T::class.java))

Loading…
Cancel
Save