pull/49/head
kunfei 5 years ago
parent 12068318dc
commit 0bddecbdb6
  1. 5
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 6
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@ -31,7 +31,6 @@ import io.legado.app.ui.book.read.config.BgTextConfigDialog.Companion.TEXT_COLOR
import io.legado.app.ui.book.source.edit.BookSourceEditActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity
import io.legado.app.ui.changesource.ChangeSourceDialog import io.legado.app.ui.changesource.ChangeSourceDialog
import io.legado.app.ui.chapterlist.ChapterListActivity import io.legado.app.ui.chapterlist.ChapterListActivity
import io.legado.app.ui.main.MainActivity
import io.legado.app.ui.replacerule.ReplaceRuleActivity import io.legado.app.ui.replacerule.ReplaceRuleActivity
import io.legado.app.ui.replacerule.edit.ReplaceEditDialog import io.legado.app.ui.replacerule.edit.ReplaceEditDialog
import io.legado.app.ui.widget.page.ChapterProvider import io.legado.app.ui.widget.page.ChapterProvider
@ -196,9 +195,7 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean { override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean {
when (keyCode) { when (keyCode) {
KeyEvent.KEYCODE_BACK -> { KeyEvent.KEYCODE_BACK -> {
page_view.snackbar(R.string.to_backstage, R.string.ok) { finish()
startActivity<MainActivity>()
}
return true return true
} }
} }

@ -11,7 +11,6 @@ import io.legado.app.data.entities.BookChapter
import io.legado.app.help.BookHelp import io.legado.app.help.BookHelp
import io.legado.app.help.IntentDataHelp import io.legado.app.help.IntentDataHelp
import io.legado.app.model.WebBook import io.legado.app.model.WebBook
import io.legado.app.service.help.ReadAloud
import io.legado.app.service.help.ReadBook import io.legado.app.service.help.ReadBook
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Dispatchers.Main
@ -185,11 +184,6 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
} }
} }
override fun onCleared() {
super.onCleared()
ReadAloud.stop(context)
}
interface CallBack { interface CallBack {
fun loadContent() fun loadContent()
fun contentLoadFinish(bookChapter: BookChapter, content: String) fun contentLoadFinish(bookChapter: BookChapter, content: String)

Loading…
Cancel
Save