From 7c8756bfb864347dd35bd83005c2afa537277d78 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 27 Nov 2021 16:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt index 1035fd957..af1bd83bd 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListFragment.kt @@ -33,9 +33,9 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragment_chapt TocViewModel.ChapterListCallBack { override val viewModel by activityViewModels() private val binding by viewBinding(FragmentChapterListBinding::bind) + private val mLayoutManager by lazy { UpLinearLayoutManager(requireContext()) } private val adapter by lazy { ChapterListAdapter(requireContext(), this) } private var durChapterIndex = 0 - private lateinit var mLayoutManager: UpLinearLayoutManager private var tocFlowJob: Job? = null override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) = binding.run { @@ -54,7 +54,6 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragment_chapt } private fun initRecyclerView() { - mLayoutManager = UpLinearLayoutManager(requireContext()) binding.recyclerView.layoutManager = mLayoutManager binding.recyclerView.addItemDecoration(VerticalDivider(requireContext())) binding.recyclerView.adapter = adapter