pull/1343/head
gedoor 3 years ago
parent f9d9712f93
commit 5191656049
  1. 3
      app/src/main/java/io/legado/app/model/ReadBook.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt
  3. 3
      app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt

@ -209,6 +209,9 @@ object ReadBook : CoroutineScope by MainScope() {
}
}
/**
* 当前页数
*/
fun durPageIndex(): Int {
curTextChapter?.let {
return it.getPageIndexByCharIndex(durChapterPos)

@ -140,8 +140,10 @@ class ReadAloudDialog : BaseDialogFragment() {
private fun upPlayState() {
if (!BaseReadAloudService.pause) {
binding.ivPlayPause.setImageResource(R.drawable.ic_pause_24dp)
binding.ivPlayPause.contentDescription = getString(R.string.pause)
} else {
binding.ivPlayPause.setImageResource(R.drawable.ic_play_24dp)
binding.ivPlayPause.contentDescription = getString(R.string.audio_play)
}
val bg = requireContext().bottomBackground
val isLight = ColorUtils.isColorLight(bg)

@ -61,6 +61,9 @@ data class TextChapter(
return stringBuilder.toString()
}
/**
* 根据索引位置获取所在页
*/
fun getPageIndexByCharIndex(charIndex: Int): Int {
var length = 0
pages.forEach {

Loading…
Cancel
Save