diff --git a/app/src/main/java/io/legado/app/model/ReadBook.kt b/app/src/main/java/io/legado/app/model/ReadBook.kt index 4b0ccad93..f24da5c6e 100644 --- a/app/src/main/java/io/legado/app/model/ReadBook.kt +++ b/app/src/main/java/io/legado/app/model/ReadBook.kt @@ -28,12 +28,12 @@ import splitties.init.appCtx @Suppress("MemberVisibilityCanBePrivate") object ReadBook : CoroutineScope by MainScope() { var book: Book? = null + var callBack: CallBack? = null var inBookshelf = false var chapterSize = 0 var durChapterIndex = 0 var durChapterPos = 0 var isLocalBook = true - var callBack: CallBack? = null var prevTextChapter: TextChapter? = null var curTextChapter: TextChapter? = null var nextTextChapter: TextChapter? = null diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt index 81e1c01b9..4d7e55c3b 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt @@ -243,7 +243,9 @@ class ReadMenu @JvmOverloads constructor( menuTopIn.setAnimationListener(object : Animation.AnimationListener { override fun onAnimationStart(animation: Animation) { 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() binding.llBrightness.visible(showBrightnessView) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt index 4dd1a11be..57df6ac3c 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt @@ -7,7 +7,9 @@ data class TextChapter( val title: String, val url: String, val pages: List, - val chaptersSize: Int + val chaptersSize: Int, + val isVip: Boolean, + val isPay: Boolean, ) { fun page(index: Int): TextPage? { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index c3ad21735..e6629fc40 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -164,7 +164,8 @@ object ChapterProvider { return TextChapter( bookChapter.index, displayTitle, bookChapter.getAbsoluteURL().substringBefore(",{"), //getAbsoluteURL已经格式过 - textPages, chapterSize + textPages, chapterSize, + bookChapter.isVip, bookChapter.isPay ) }