|
|
@ -1,4 +1,4 @@ |
|
|
|
package io.legado.app.service.help |
|
|
|
package io.legado.app.model |
|
|
|
|
|
|
|
|
|
|
|
import androidx.lifecycle.MutableLiveData |
|
|
|
import androidx.lifecycle.MutableLiveData |
|
|
|
import com.github.liuyueyi.quick.transfer.ChineseUtils |
|
|
|
import com.github.liuyueyi.quick.transfer.ChineseUtils |
|
|
@ -10,6 +10,8 @@ import io.legado.app.help.coroutine.Coroutine |
|
|
|
import io.legado.app.help.storage.BookWebDav |
|
|
|
import io.legado.app.help.storage.BookWebDav |
|
|
|
import io.legado.app.model.webBook.WebBook |
|
|
|
import io.legado.app.model.webBook.WebBook |
|
|
|
import io.legado.app.service.BaseReadAloudService |
|
|
|
import io.legado.app.service.BaseReadAloudService |
|
|
|
|
|
|
|
import io.legado.app.service.help.CacheBook |
|
|
|
|
|
|
|
import io.legado.app.service.help.ReadAloud |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextChapter |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextChapter |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextPage |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextPage |
|
|
|
import io.legado.app.ui.book.read.page.provider.ChapterProvider |
|
|
|
import io.legado.app.ui.book.read.page.provider.ChapterProvider |
|
|
@ -44,7 +46,7 @@ object ReadBook { |
|
|
|
var readStartTime: Long = System.currentTimeMillis() |
|
|
|
var readStartTime: Long = System.currentTimeMillis() |
|
|
|
|
|
|
|
|
|
|
|
fun resetData(book: Book) { |
|
|
|
fun resetData(book: Book) { |
|
|
|
this.book = book |
|
|
|
ReadBook.book = book |
|
|
|
readRecord.bookName = book.name |
|
|
|
readRecord.bookName = book.name |
|
|
|
readRecord.readTime = appDb.readRecordDao.getReadTime(book.name) ?: 0 |
|
|
|
readRecord.readTime = appDb.readRecordDao.getReadTime(book.name) ?: 0 |
|
|
|
durChapterIndex = book.durChapterIndex |
|
|
|
durChapterIndex = book.durChapterIndex |
|
|
@ -113,8 +115,8 @@ object ReadBook { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun upMsg(msg: String?) { |
|
|
|
fun upMsg(msg: String?) { |
|
|
|
if (this.msg != msg) { |
|
|
|
if (ReadBook.msg != msg) { |
|
|
|
this.msg = msg |
|
|
|
ReadBook.msg = msg |
|
|
|
callBack?.upContent() |
|
|
|
callBack?.upContent() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |