setup checklist fragment colors earlier to avoid some visual glitches

This commit is contained in:
tibbi 2022-12-13 17:32:04 +01:00
parent 5d851d18f0
commit 34e2db91e7

View File

@ -34,6 +34,7 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
view = inflater.inflate(R.layout.fragment_checklist, container, false) as ViewGroup
noteId = requireArguments().getLong(NOTE_ID, 0L)
setupFragmentColors()
return view
}
@ -95,6 +96,12 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
return
}
setupFragmentColors()
checkLockState()
setupAdapter()
}
private fun setupFragmentColors() {
val adjustedPrimaryColor = requireActivity().getProperPrimaryColor()
view.checklist_fab.apply {
setColors(
@ -117,9 +124,6 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
showNewItemDialog()
}
}
checkLockState()
setupAdapter()
}
override fun checkLockState() {