优化
This commit is contained in:
1 parent
bf633466ec
commit
abe12711ef
1 file changed
+12
-1
@@ -19,6 +19,7 @@ class ChapterListAdapter(context: Context, val callback: Callback) :
|
|||||||
RecyclerAdapter<BookChapter, ItemChapterListBinding>(context) {
|
RecyclerAdapter<BookChapter, ItemChapterListBinding>(context) {
|
||||||
|
|
||||||
val cacheFileNames = hashSetOf<String>()
|
val cacheFileNames = hashSetOf<String>()
|
||||||
|
val displayTileMap = hashMapOf<Int, String>()
|
||||||
val diffCallBack = object : DiffUtil.ItemCallback<BookChapter>() {
|
val diffCallBack = object : DiffUtil.ItemCallback<BookChapter>() {
|
||||||
|
|
||||||
override fun areItemsTheSame(
|
override fun areItemsTheSame(
|
||||||
@@ -47,6 +48,16 @@ class ChapterListAdapter(context: Context, val callback: Callback) :
|
|||||||
return ItemChapterListBinding.inflate(inflater, parent, false)
|
return ItemChapterListBinding.inflate(inflater, parent, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getDisplayTile(chapter: BookChapter): String {
|
||||||
|
var displayTile = displayTileMap[chapter.index]
|
||||||
|
if (displayTile != null) {
|
||||||
|
return displayTile
|
||||||
|
|||||||