修复google版在没gms的手机上开启cronet时闪退

pull/1279/head
ag2s20150909 3 years ago
parent ecdfc0941e
commit 25ac4d5311
  1. 3
      app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.kt
  2. 2
      app/src/main/java/io/legado/app/model/localBook/UmdFile.kt
  3. 7
      app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterGrid.kt
  4. 6
      app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterList.kt

@ -50,7 +50,8 @@ object CronetLoader : CronetEngine.Builder.LibraryLoader() {
fun install(): Boolean {
if (AppConfig.isGooglePlay) {
return true
//检查GMS的Cronet服务是否安装
return CronetProviderInstaller.isInstalled()
}
if (md5.length != 32 || !soFile.exists() || md5 != getFileMD5(soFile)) {
return false

@ -129,7 +129,7 @@ class UmdFile(var book: Book) {
return chapterList
}
private fun getImage(href: String): InputStream? {
private fun getImage(@Suppress("UNUSED_PARAMETER") href: String): InputStream? {
return null
}

@ -52,7 +52,12 @@ class BooksAdapterGrid(context: Context, callBack: CallBack) :
}
}
private fun onBindGroup(binding: ItemBookshelfGridGroupBinding, position: Int, bundle: Bundle) {
private fun onBindGroup(
binding: ItemBookshelfGridGroupBinding,
position: Int,
@Suppress("UNUSED_PARAMETER") bundle: Bundle
) {
binding.run {
val item = callBack.getItem(position) as BookGroup
tvName.text = item.groupName

@ -51,7 +51,11 @@ class BooksAdapterList(context: Context, callBack: CallBack) :
}
}
private fun onBindGroup(binding: ItemBookshelfListGroupBinding, position: Int, bundle: Bundle) {
private fun onBindGroup(
binding: ItemBookshelfListGroupBinding,
position: Int,
@Suppress("UNUSED_PARAMETER") bundle: Bundle
) {
binding.run {
val item = callBack.getItem(position) as BookGroup
tvName.text = item.groupName

Loading…
Cancel
Save