From 0bddecbdb69b0624eaa439fb3e9b6f75a1c63508 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 29 Nov 2019 20:28:08 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/book/read/ReadBookActivity.kt | 5 +---- .../java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 6 ------ 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 89988917c..0e381eb06 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.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.changesource.ChangeSourceDialog 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.edit.ReplaceEditDialog import io.legado.app.ui.widget.page.ChapterProvider @@ -196,9 +195,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean { when (keyCode) { KeyEvent.KEYCODE_BACK -> { - page_view.snackbar(R.string.to_backstage, R.string.ok) { - startActivity() - } + finish() return true } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index b386812ae..295de74a8 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -11,7 +11,6 @@ import io.legado.app.data.entities.BookChapter import io.legado.app.help.BookHelp import io.legado.app.help.IntentDataHelp import io.legado.app.model.WebBook -import io.legado.app.service.help.ReadAloud import io.legado.app.service.help.ReadBook import kotlinx.coroutines.Dispatchers.IO 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 { fun loadContent() fun contentLoadFinish(bookChapter: BookChapter, content: String)