pull/1352/head
gedoor 3 years ago
parent 0ec12cc8d9
commit d45ee04959
  1. 2
      app/src/main/java/io/legado/app/model/ReadBook.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
  3. 4
      app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt
  4. 3
      app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt

@ -28,12 +28,12 @@ import splitties.init.appCtx
@Suppress("MemberVisibilityCanBePrivate") @Suppress("MemberVisibilityCanBePrivate")
object ReadBook : CoroutineScope by MainScope() { object ReadBook : CoroutineScope by MainScope() {
var book: Book? = null var book: Book? = null
var callBack: CallBack? = null
var inBookshelf = false var inBookshelf = false
var chapterSize = 0 var chapterSize = 0
var durChapterIndex = 0 var durChapterIndex = 0
var durChapterPos = 0 var durChapterPos = 0
var isLocalBook = true var isLocalBook = true
var callBack: CallBack? = null
var prevTextChapter: TextChapter? = null var prevTextChapter: TextChapter? = null
var curTextChapter: TextChapter? = null var curTextChapter: TextChapter? = null
var nextTextChapter: TextChapter? = null var nextTextChapter: TextChapter? = null

@ -243,7 +243,9 @@ class ReadMenu @JvmOverloads constructor(
menuTopIn.setAnimationListener(object : Animation.AnimationListener { menuTopIn.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) { override fun onAnimationStart(animation: Animation) {
binding.tvLogin.isGone = ReadBook.bookSource?.loginUrl.isNullOrEmpty() binding.tvLogin.isGone = ReadBook.bookSource?.loginUrl.isNullOrEmpty()
binding.tvPay.isGone = true binding.tvPay.isGone = ReadBook.bookSource?.loginUrl.isNullOrEmpty()
|| ReadBook.curTextChapter?.isVip != true
|| ReadBook.curTextChapter?.isPay == true
callBack.upSystemUiVisibility() callBack.upSystemUiVisibility()
binding.llBrightness.visible(showBrightnessView) binding.llBrightness.visible(showBrightnessView)
} }

@ -7,7 +7,9 @@ data class TextChapter(
val title: String, val title: String,
val url: String, val url: String,
val pages: List<TextPage>, val pages: List<TextPage>,
val chaptersSize: Int val chaptersSize: Int,
val isVip: Boolean,
val isPay: Boolean,
) { ) {
fun page(index: Int): TextPage? { fun page(index: Int): TextPage? {

@ -164,7 +164,8 @@ object ChapterProvider {
return TextChapter( return TextChapter(
bookChapter.index, displayTitle, bookChapter.index, displayTitle,
bookChapter.getAbsoluteURL().substringBefore(",{"), //getAbsoluteURL已经格式过 bookChapter.getAbsoluteURL().substringBefore(",{"), //getAbsoluteURL已经格式过
textPages, chapterSize textPages, chapterSize,
bookChapter.isVip, bookChapter.isPay
) )
} }

Loading…
Cancel
Save