pull/1403/head
gedoor 3 years ago
parent dea2ca2edf
commit 5705a09b55
  1. 10
      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()

Loading…
Cancel
Save