Hiyobi file structure changed

This commit is contained in:
Pupil
2020-02-22 11:02:58 +09:00
parent c0e7c87ca4
commit 4f0dbead79
13 changed files with 65 additions and 44 deletions

View File

@@ -52,7 +52,7 @@ class ReaderAdapter(private val context: Context,
//region Glide.RecyclerView
val sizeProvider = ListPreloader.PreloadSizeProvider<File> { _, _, position ->
Cache(context).getReaderOrNull(galleryID)?.galleryInfo?.getOrNull(position)?.let {
Cache(context).getReaderOrNull(galleryID)?.galleryInfo?.files?.getOrNull(position)?.let {
arrayOf(it.width, it.height).toIntArray()
}
}
@@ -114,7 +114,7 @@ class ReaderAdapter(private val context: Context,
if (!isFullScreen)
(holder.view.container.layoutParams as ConstraintLayout.LayoutParams)
.dimensionRatio = "${reader!!.galleryInfo[position].width}:${reader!!.galleryInfo[position].height}"
.dimensionRatio = "${reader!!.galleryInfo.files[position].width}:${reader!!.galleryInfo.files[position].height}"
holder.view.reader_index.text = (position+1).toString()
@@ -161,6 +161,6 @@ class ReaderAdapter(private val context: Context,
}
}
override fun getItemCount() = reader?.galleryInfo?.size ?: 0
override fun getItemCount() = reader?.galleryInfo?.files?.size ?: 0
}