feat: 优化代码

pull/182/head
kunfei 5 years ago
parent 7f2a24b53b
commit b976d15d69
  1. 6
      app/src/main/java/io/legado/app/ui/book/chapterlist/ChapterListFragment.kt

@ -14,7 +14,7 @@ import io.legado.app.constant.EventBus
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookChapter
import io.legado.app.help.BookHelp
import io.legado.app.lib.theme.backgroundColor
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.ui.widget.recycler.UpLinearLayoutManager
import io.legado.app.ui.widget.recycler.VerticalDivider
import io.legado.app.utils.getViewModelOfActivity
@ -55,7 +55,7 @@ class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragme
}
private fun initView() {
ll_chapter_base_info.setBackgroundColor(backgroundColor)
ll_chapter_base_info.setBackgroundColor(bottomBackground)
iv_chapter_top.onClick { mLayoutManager.scrollToPositionWithOffset(0, 0) }
iv_chapter_bottom.onClick {
if (adapter.itemCount > 0) {
@ -77,7 +77,7 @@ class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragme
book?.let {
durChapterIndex = it.durChapterIndex
tv_current_chapter_info.text =
"${it.durChapterTitle}(${it.durChapterPos}/${it.totalChapterNum})"
"${it.durChapterTitle}(${it.durChapterIndex}/${it.totalChapterNum})"
initCacheFileNames(it)
}
}

Loading…
Cancel
Save