diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt index 8180f1e7c..8db201102 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt @@ -53,11 +53,11 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) : tvTag.text = item.name.substringAfterLast(".") tvSize.text = StringUtils.toSize(item.size) tvDate.text = AppConst.dateFormat.format(item.date) - cbSelect.isChecked = selectedUris.contains(item.uri.toString()) + cbSelect.isChecked = selectedUris.contains(item.toString()) } tvName.text = item.name } else { - cbSelect.isChecked = selectedUris.contains(item.uri.toString()) + cbSelect.isChecked = selectedUris.contains(item.toString()) } } } @@ -68,10 +68,10 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) : if (it.isDir) { callBack.nextDoc(it.uri) } else if (!bookFileNames.contains(it.name)) { - if (!selectedUris.contains(it.uri.toString())) { - selectedUris.add(it.uri.toString()) + if (!selectedUris.contains(it.toString())) { + selectedUris.add(it.toString()) } else { - selectedUris.remove(it.uri.toString()) + selectedUris.remove(it.toString()) } notifyItemChanged(holder.layoutPosition, true) callBack.upCountView()