|
|
@ -25,6 +25,7 @@ import io.legado.app.exception.NoStackTraceException |
|
|
|
import io.legado.app.help.AppWebDav |
|
|
|
import io.legado.app.help.AppWebDav |
|
|
|
import io.legado.app.help.BookHelp |
|
|
|
import io.legado.app.help.BookHelp |
|
|
|
import io.legado.app.help.IntentData |
|
|
|
import io.legado.app.help.IntentData |
|
|
|
|
|
|
|
import io.legado.app.help.TTS |
|
|
|
import io.legado.app.help.config.AppConfig |
|
|
|
import io.legado.app.help.config.AppConfig |
|
|
|
import io.legado.app.help.config.ReadBookConfig |
|
|
|
import io.legado.app.help.config.ReadBookConfig |
|
|
|
import io.legado.app.help.config.ReadTipConfig |
|
|
|
import io.legado.app.help.config.ReadTipConfig |
|
|
@ -140,6 +141,7 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
private var autoPageJob: Job? = null |
|
|
|
private var autoPageJob: Job? = null |
|
|
|
private var backupJob: Job? = null |
|
|
|
private var backupJob: Job? = null |
|
|
|
private var keepScreenJon: Job? = null |
|
|
|
private var keepScreenJon: Job? = null |
|
|
|
|
|
|
|
private val tts by lazy { TTS() } |
|
|
|
val textActionMenu: TextActionMenu by lazy { |
|
|
|
val textActionMenu: TextActionMenu by lazy { |
|
|
|
TextActionMenu(this, this) |
|
|
|
TextActionMenu(this, this) |
|
|
|
} |
|
|
|
} |
|
|
@ -629,7 +631,10 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
override fun onMenuItemSelected(itemId: Int): Boolean { |
|
|
|
override fun onMenuItemSelected(itemId: Int): Boolean { |
|
|
|
when (itemId) { |
|
|
|
when (itemId) { |
|
|
|
R.id.menu_aloud -> binding.readView.aloudStartSelect() |
|
|
|
R.id.menu_aloud -> when (AppConfig.contentSelectSpeakMod) { |
|
|
|
|
|
|
|
1 -> binding.readView.aloudStartSelect() |
|
|
|
|
|
|
|
else -> tts.speak(binding.readView.getSelectText()) |
|
|
|
|
|
|
|
} |
|
|
|
R.id.menu_bookmark -> binding.readView.curPage.let { |
|
|
|
R.id.menu_bookmark -> binding.readView.curPage.let { |
|
|
|
val bookmark = it.createBookmark() |
|
|
|
val bookmark = it.createBookmark() |
|
|
|
if (bookmark == null) { |
|
|
|
if (bookmark == null) { |
|
|
@ -984,7 +989,8 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
setMessage(chapter.title) |
|
|
|
setMessage(chapter.title) |
|
|
|
yesButton { |
|
|
|
yesButton { |
|
|
|
Coroutine.async { |
|
|
|
Coroutine.async { |
|
|
|
val source = ReadBook.bookSource ?: throw NoStackTraceException("no book source") |
|
|
|
val source = |
|
|
|
|
|
|
|
ReadBook.bookSource ?: throw NoStackTraceException("no book source") |
|
|
|
val payAction = source.getContentRule().payAction |
|
|
|
val payAction = source.getContentRule().payAction |
|
|
|
if (payAction.isNullOrBlank()) { |
|
|
|
if (payAction.isNullOrBlank()) { |
|
|
|
throw NoStackTraceException("no pay action") |
|
|
|
throw NoStackTraceException("no pay action") |
|
|
@ -1190,6 +1196,7 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
|
|
|
|
|
|
|
|
override fun onDestroy() { |
|
|
|
override fun onDestroy() { |
|
|
|
super.onDestroy() |
|
|
|
super.onDestroy() |
|
|
|
|
|
|
|
tts.clearTts() |
|
|
|
textActionMenu.dismiss() |
|
|
|
textActionMenu.dismiss() |
|
|
|
popupAction.dismiss() |
|
|
|
popupAction.dismiss() |
|
|
|
binding.readView.onDestroy() |
|
|
|
binding.readView.onDestroy() |
|
|
|