修复正文内容TalkBack不对的bug

pull/478/head
gedoor 4 years ago
parent 3692335610
commit 5277c21fdd
  1. 2
      app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt
  3. 1
      app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt

@ -47,13 +47,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
init {
callBack = activity as CallBack
contentDescription = textPage.text
}
fun setContent(pageData: PageData) {
this.textChapter = pageData.textChapter
this.textPage = pageData.textPage
contentDescription = textPage.text
invalidate()
}

@ -226,6 +226,10 @@ class ContentView(context: Context) : FrameLayout(context) {
content_text_view.setContent(pageData)
}
fun setContentDescription(content: String) {
content_text_view.contentDescription = content
}
fun resetPageOffset() {
content_text_view.resetPageOffset()
}

@ -373,6 +373,7 @@ class PageView(context: Context, attrs: AttributeSet) :
}
override fun upContent(relativePosition: Int, resetPageOffset: Boolean) {
curPage.setContentDescription(pageFactory.curData.textPage.text)
if (isScroll && !callBack.isAutoPage) {
curPage.setContent(pageFactory.curData, resetPageOffset)
} else {

Loading…
Cancel
Save