From f6c061b5ad9878d3833142be34651446bbe51b81 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 19 Mar 2022 20:32:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/ContentEditDialog.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ContentEditDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/ContentEditDialog.kt index 623022b34..c1a2d013a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ContentEditDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ContentEditDialog.kt @@ -54,6 +54,13 @@ class ContentEditDialog : BaseDialogFragment(R.layout.dialog_content_edit) { } viewModel.initContent { binding.contentView.setText(it) + binding.contentView.post { + binding.contentView.apply { + val lineIndex = layout.getLineForOffset(ReadBook.durChapterPos) + val lineHeight = layout.getLineTop(lineIndex) + scrollTo(0, lineHeight) + } + } } }