pull/1440/head
gedoor 3 years ago
parent 15d6c1381f
commit 7c8756bfb8
  1. 3
      app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt

@ -33,9 +33,9 @@ class ChapterListFragment : VMBaseFragment<TocViewModel>(R.layout.fragment_chapt
TocViewModel.ChapterListCallBack { TocViewModel.ChapterListCallBack {
override val viewModel by activityViewModels<TocViewModel>() override val viewModel by activityViewModels<TocViewModel>()
private val binding by viewBinding(FragmentChapterListBinding::bind) private val binding by viewBinding(FragmentChapterListBinding::bind)
private val mLayoutManager by lazy { UpLinearLayoutManager(requireContext()) }
private val adapter by lazy { ChapterListAdapter(requireContext(), this) } private val adapter by lazy { ChapterListAdapter(requireContext(), this) }
private var durChapterIndex = 0 private var durChapterIndex = 0
private lateinit var mLayoutManager: UpLinearLayoutManager
private var tocFlowJob: Job? = null private var tocFlowJob: Job? = null
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) = binding.run { override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) = binding.run {
@ -54,7 +54,6 @@ class ChapterListFragment : VMBaseFragment<TocViewModel>(R.layout.fragment_chapt
} }
private fun initRecyclerView() { private fun initRecyclerView() {
mLayoutManager = UpLinearLayoutManager(requireContext())
binding.recyclerView.layoutManager = mLayoutManager binding.recyclerView.layoutManager = mLayoutManager
binding.recyclerView.addItemDecoration(VerticalDivider(requireContext())) binding.recyclerView.addItemDecoration(VerticalDivider(requireContext()))
binding.recyclerView.adapter = adapter binding.recyclerView.adapter = adapter

Loading…
Cancel
Save