pull/32/head
kunfei 5 years ago
parent a137fcb036
commit 316b7bbd59
  1. 1
      app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/widget/page/PageView.kt

@ -74,7 +74,6 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea
} }
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
initView() initView()
page_view.callback = this
viewModel.callBack = this viewModel.callBack = this
viewModel.bookData.observe(this, Observer { title_bar.title = it.name }) viewModel.bookData.observe(this, Observer { title_bar.title = it.name })
viewModel.chapterListFinish.observe(this, Observer { loadContent() }) viewModel.chapterListFinish.observe(this, Observer { loadContent() })

@ -11,12 +11,13 @@ import io.legado.app.ui.widget.page.delegate.CoverPageDelegate
import io.legado.app.ui.widget.page.delegate.NoAnimPageDelegate import io.legado.app.ui.widget.page.delegate.NoAnimPageDelegate
import io.legado.app.ui.widget.page.delegate.PageDelegate import io.legado.app.ui.widget.page.delegate.PageDelegate
import io.legado.app.ui.widget.page.delegate.SlidePageDelegate import io.legado.app.ui.widget.page.delegate.SlidePageDelegate
import io.legado.app.utils.activity
import io.legado.app.utils.getPrefInt import io.legado.app.utils.getPrefInt
class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, attrs), class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, attrs),
PageDelegate.PageInterface { PageDelegate.PageInterface {
var callback: CallBack? = null private var callback: CallBack? = null
private var pageDelegate: PageDelegate? = null private var pageDelegate: PageDelegate? = null
private var pageFactory: TextPageFactory? = null private var pageFactory: TextPageFactory? = null
@ -25,6 +26,7 @@ class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, att
var nextPage: ContentView? = null var nextPage: ContentView? = null
init { init {
callback = activity as? CallBack
prevPage = ContentView(context) prevPage = ContentView(context)
addView(prevPage) addView(prevPage)
nextPage = ContentView(context) nextPage = ContentView(context)

Loading…
Cancel
Save