mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-24 20:40:09 +01:00
fixing some coloring issues
This commit is contained in:
parent
b267ef3a7e
commit
b5f6f421b0
@ -1,6 +1,5 @@
|
|||||||
package com.simplemobiletools.notes.pro.fragments
|
package com.simplemobiletools.notes.pro.fragments
|
||||||
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@ -41,7 +40,6 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
loadNoteById(noteId)
|
loadNoteById(noteId)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,8 +58,7 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
val checklistItemType = object : TypeToken<List<ChecklistItem>>() {}.type
|
val checklistItemType = object : TypeToken<List<ChecklistItem>>() {}.type
|
||||||
items = Gson().fromJson<ArrayList<ChecklistItem>>(storedNote.value, checklistItemType)
|
items = Gson().fromJson<ArrayList<ChecklistItem>>(storedNote.value, checklistItemType) ?: ArrayList(1)
|
||||||
?: ArrayList(1)
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
migrateCheckListOnFailure(storedNote)
|
migrateCheckListOnFailure(storedNote)
|
||||||
}
|
}
|
||||||
@ -70,7 +67,6 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
items.sortBy { it.isDone }
|
items.sortBy { it.isDone }
|
||||||
}
|
}
|
||||||
|
|
||||||
activity?.updateTextColors(view.checklist_holder)
|
|
||||||
setupFragment()
|
setupFragment()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,18 +91,22 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val plusIcon = resources.getColoredDrawableWithColor(R.drawable.ic_plus_vector, if (activity!!.isBlackAndWhiteTheme()) Color.BLACK else Color.WHITE)
|
val adjustedPrimaryColor = activity!!.getAdjustedPrimaryColor()
|
||||||
|
|
||||||
view.checklist_fab.apply {
|
view.checklist_fab.apply {
|
||||||
setImageDrawable(plusIcon)
|
setColors(
|
||||||
background?.applyColorFilter(activity!!.getAdjustedPrimaryColor())
|
activity!!.config.textColor,
|
||||||
|
adjustedPrimaryColor,
|
||||||
|
adjustedPrimaryColor.getContrastColor()
|
||||||
|
)
|
||||||
|
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
showNewItemDialog()
|
showNewItemDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
view.fragment_placeholder.setTextColor(activity!!.config.textColor)
|
||||||
view.fragment_placeholder_2.apply {
|
view.fragment_placeholder_2.apply {
|
||||||
setTextColor(activity!!.getAdjustedPrimaryColor())
|
setTextColor(adjustedPrimaryColor)
|
||||||
underlineText()
|
underlineText()
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
showNewItemDialog()
|
showNewItemDialog()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user