diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index d21988163..0c5c63aa8 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -163,6 +163,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at ReadBook.book!!, textPage.chapterIndex, textChar.charData, + textChar.charData, true )?.let { canvas.drawBitmap(it, null, rectF, null) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index ccfe10564..c1e4bdf1e 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -122,7 +122,7 @@ object ChapterProvider { imageStyle: String? ): Float { var durY = y - ImageProvider.getImage(book, chapter.index, src)?.let { + ImageProvider.getImage(book, chapter.index, src, chapter.url)?.let { if (durY > visibleHeight) { textPages.last().height = durY textPages.add(TextPage()) @@ -453,4 +453,4 @@ object ChapterProvider { val TextPaint.textHeight: Float get() = fontMetrics.descent - fontMetrics.ascent + fontMetrics.leading -} \ No newline at end of file +} diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt index c5407cb1b..0084bfc5f 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt @@ -31,7 +31,7 @@ object ImageProvider { indexCache[src] = bitmap } - fun getImage(book: Book, chapterIndex: Int, src: String, onUi: Boolean = false): Bitmap? { + fun getImage(book: Book, chapterIndex: Int, src: String, baseUrl: String, onUi: Boolean = false): Bitmap? { getCache(chapterIndex, src)?.let { return it } @@ -49,7 +49,7 @@ object ImageProvider { out.close() } } else if (!onUi) { - HttpHelper.getBytes(src, src)?.let { + HttpHelper.getBytes(src, baseUrl)?.let { FileUtils.createFileIfNotExist(vFile.absolutePath).writeBytes(it) } } diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/PhotoDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/PhotoDialog.kt index 74dfe23cd..c00064222 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/PhotoDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dialog/PhotoDialog.kt @@ -56,7 +56,7 @@ class PhotoDialog : BaseDialogFragment() { val src = it.getString("src") ReadBook.book?.let { book -> src?.let { - ImageProvider.getImage(book, chapterIndex, src)?.let { bitmap -> + ImageProvider.getImage(book, chapterIndex, src, src)?.let { bitmap -> photo_view.setImageBitmap(bitmap) } }