11package com.simplemobiletools.notes.pro.fragments
22
3- import android.graphics.Color
43import android.os.Bundle
54import android.view.LayoutInflater
65import android.view.View
@@ -41,7 +40,6 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
4140
4241 override fun onResume () {
4342 super .onResume()
44-
4543 loadNoteById(noteId)
4644 }
4745
@@ -60,8 +58,7 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
6058
6159 try {
6260 val checklistItemType = object : TypeToken <List <ChecklistItem >>() {}.type
63- items = Gson ().fromJson<ArrayList <ChecklistItem >>(storedNote.value, checklistItemType)
64- ? : ArrayList (1 )
61+ items = Gson ().fromJson<ArrayList <ChecklistItem >>(storedNote.value, checklistItemType) ? : ArrayList (1 )
6562 } catch (e: Exception ) {
6663 migrateCheckListOnFailure(storedNote)
6764 }
@@ -70,7 +67,6 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
7067 items.sortBy { it.isDone }
7168 }
7269
73- activity?.updateTextColors(view.checklist_holder)
7470 setupFragment()
7571 }
7672 }
@@ -95,18 +91,22 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
9591 return
9692 }
9793
98- val plusIcon = resources.getColoredDrawableWithColor(R .drawable.ic_plus_vector, if (activity!! .isBlackAndWhiteTheme()) Color .BLACK else Color .WHITE )
99-
94+ val adjustedPrimaryColor = activity!! .getAdjustedPrimaryColor()
10095 view.checklist_fab.apply {
101- setImageDrawable(plusIcon)
102- background?.applyColorFilter(activity!! .getAdjustedPrimaryColor())
96+ setColors(
97+ activity!! .config.textColor,
98+ adjustedPrimaryColor,
99+ adjustedPrimaryColor.getContrastColor()
100+ )
101+
103102 setOnClickListener {
104103 showNewItemDialog()
105104 }
106105 }
107106
107+ view.fragment_placeholder.setTextColor(activity!! .config.textColor)
108108 view.fragment_placeholder_2.apply {
109- setTextColor(activity !! .getAdjustedPrimaryColor() )
109+ setTextColor(adjustedPrimaryColor )
110110 underlineText()
111111 setOnClickListener {
112112 showNewItemDialog()
0 commit comments