pull/1395/head
gedoor 3 years ago
parent afe47b8bf4
commit 36415099c5
  1. 9
      app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt

@ -159,7 +159,9 @@ class ReadMenu @JvmOverloads constructor(
private fun bindEvent() = binding.run {
val chapterViewClickListener = OnClickListener {
BookRead.bookSource ?: return@OnClickListener
if (BookRead.isLocalBook) {
return@OnClickListener
}
if (AppConfig.readUrlInBrowser) {
context.openUrl(tvChapterUrl.text.toString().substringBefore(",{"))
} else {
@ -172,7 +174,9 @@ class ReadMenu @JvmOverloads constructor(
}
}
val chapterViewLongClickListener = OnLongClickListener {
BookRead.bookSource ?: return@OnLongClickListener true
if (BookRead.isLocalBook) {
return@OnLongClickListener true
}
context.alert(R.string.Open_fan) {
setMessage(R.string.use_browser_open)
okButton {
@ -295,6 +299,7 @@ class ReadMenu @JvmOverloads constructor(
menuBottomIn = AnimationUtilsSupport.loadAnimation(context, R.anim.anim_readbook_bottom_in)
menuTopIn.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {
binding.tvSourceAction.isGone = BookRead.isLocalBook
binding.tvLogin.isGone = BookRead.bookSource?.loginUrl.isNullOrEmpty()
binding.tvPay.isGone = BookRead.bookSource?.loginUrl.isNullOrEmpty()
|| BookRead.curTextChapter?.isVip != true

Loading…
Cancel
Save