mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
dea2ca2edf
commit
5705a09b55
@ -53,11 +53,11 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) :
|
|||||||
tvTag.text = item.name.substringAfterLast(".")
|
tvTag.text = item.name.substringAfterLast(".")
|
||||||
tvSize.text = StringUtils.toSize(item.size)
|
tvSize.text = StringUtils.toSize(item.size)
|
||||||
tvDate.text = AppConst.dateFormat.format(item.date)
|
tvDate.text = AppConst.dateFormat.format(item.date)
|
||||||
cbSelect.isChecked = selectedUris.contains(item.uri.toString())
|
cbSelect.isChecked = selectedUris.contains(item.toString())
|
||||||
}
|
}
|
||||||
tvName.text = item.name
|
tvName.text = item.name
|
||||||
} else {
|
} 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) {
|
if (it.isDir) {
|
||||||
callBack.nextDoc(it.uri)
|
callBack.nextDoc(it.uri)
|
||||||
} else if (!bookFileNames.contains(it.name)) {
|
} else if (!bookFileNames.contains(it.name)) {
|
||||||
if (!selectedUris.contains(it.uri.toString())) {
|
if (!selectedUris.contains(it.toString())) {
|
||||||
selectedUris.add(it.uri.toString())
|
selectedUris.add(it.toString())
|
||||||
} else {
|
} else {
|
||||||
selectedUris.remove(it.uri.toString())
|
selectedUris.remove(it.toString())
|
||||||
}
|
}
|
||||||
notifyItemChanged(holder.layoutPosition, true)
|
notifyItemChanged(holder.layoutPosition, true)
|
||||||
callBack.upCountView()
|
callBack.upCountView()
|
||||||
|
Loading…
Reference in New Issue
Block a user