取消图片颜色为FULL时的自动滚动

pull/298/head
gedoor 4 years ago
parent 2b465d2404
commit e6cb74cba3
  1. 4
      app/src/main/java/io/legado/app/service/help/ReadBook.kt
  2. 6
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  3. 5
      app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt

@ -64,7 +64,6 @@ object ReadBook {
null null
} }
} }
callBack?.upPageAnim()
} }
fun upMsg(msg: String?) { fun upMsg(msg: String?) {
@ -357,7 +356,7 @@ object ReadBook {
} }
} }
val imageStyle get() = webBook?.bookSource?.ruleContent?.imageStyle private val imageStyle get() = webBook?.bookSource?.ruleContent?.imageStyle
fun saveRead() { fun saveRead() {
Coroutine.async { Coroutine.async {
@ -379,6 +378,5 @@ object ReadBook {
fun upView() fun upView()
fun pageChanged() fun pageChanged()
fun contentLoadFinish() fun contentLoadFinish()
fun upPageAnim()
} }
} }

@ -550,12 +550,6 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
} }
} }
override fun upPageAnim() {
launch {
page_view?.upPageAnim()
}
}
/** /**
* 页面改变 * 页面改变
*/ */

@ -17,7 +17,6 @@ import io.legado.app.ui.book.read.page.provider.ChapterProvider
import io.legado.app.utils.activity import io.legado.app.utils.activity
import io.legado.app.utils.screenshot import io.legado.app.utils.screenshot
import kotlinx.android.synthetic.main.activity_book_read.view.* import kotlinx.android.synthetic.main.activity_book_read.view.*
import java.util.*
class PageView(context: Context, attrs: AttributeSet) : class PageView(context: Context, attrs: AttributeSet) :
FrameLayout(context, attrs), FrameLayout(context, attrs),
@ -110,9 +109,7 @@ class PageView(context: Context, attrs: AttributeSet) :
fun upPageAnim() { fun upPageAnim() {
pageDelegate?.onDestroy() pageDelegate?.onDestroy()
pageDelegate = null pageDelegate = null
pageDelegate = if (ReadBook.imageStyle?.toUpperCase(Locale.ROOT) == "FULL") { pageDelegate = when (ReadBookConfig.pageAnim) {
ScrollPageDelegate(this)
} else when (ReadBookConfig.pageAnim) {
0 -> CoverPageDelegate(this) 0 -> CoverPageDelegate(this)
1 -> SlidePageDelegate(this) 1 -> SlidePageDelegate(this)
2 -> SimulationPageDelegate(this) 2 -> SimulationPageDelegate(this)

Loading…
Cancel
Save