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 7a2d9da26..431b73029 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 @@ -14,6 +14,7 @@ import androidx.core.view.size import com.jaredrummler.android.colorpicker.ColorPickerDialogListener import io.legado.app.BuildConfig import io.legado.app.R +import io.legado.app.constant.BookType import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey import io.legado.app.constant.Status @@ -38,6 +39,7 @@ import io.legado.app.model.ReadBook import io.legado.app.receiver.TimeBatteryReceiver import io.legado.app.service.BaseReadAloudService import io.legado.app.ui.about.AppLogDialog +import io.legado.app.ui.book.audio.AudioPlayActivity import io.legado.app.ui.book.bookmark.BookmarkDialog import io.legado.app.ui.book.changesource.ChangeBookSourceDialog import io.legado.app.ui.book.changesource.ChangeChapterSourceDialog @@ -716,7 +718,18 @@ class ReadBookActivity : BaseReadBookActivity(), get() = ReadBook.book override fun changeTo(source: BookSource, book: Book, toc: List) { - viewModel.changeTo(source, book, toc) + if (book.type != BookType.audio) { + viewModel.changeTo(source, book, toc) + } else { + ReadAloud.stop(this) + launch { + ReadBook.book?.changeTo(book, toc) + } + startActivity { + putExtra("bookUrl", book.bookUrl) + } + finish() + } } override fun replaceContent(content: String) {