mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-19 18:10:07 +01:00
minor formatting change
This commit is contained in:
parent
4eeaa6fbf3
commit
5c94460924
@ -13,7 +13,10 @@ import com.simplemobiletools.notes.pro.R
|
||||
import com.simplemobiletools.notes.pro.activities.SimpleActivity
|
||||
import com.simplemobiletools.notes.pro.adapters.ChecklistAdapter
|
||||
import com.simplemobiletools.notes.pro.dialogs.NewChecklistItemDialog
|
||||
import com.simplemobiletools.notes.pro.extensions.*
|
||||
import com.simplemobiletools.notes.pro.extensions.config
|
||||
import com.simplemobiletools.notes.pro.extensions.notesDB
|
||||
import com.simplemobiletools.notes.pro.extensions.requiredActivity
|
||||
import com.simplemobiletools.notes.pro.extensions.updateWidgets
|
||||
import com.simplemobiletools.notes.pro.helpers.NOTE_ID
|
||||
import com.simplemobiletools.notes.pro.helpers.NotesHelper
|
||||
import com.simplemobiletools.notes.pro.interfaces.ChecklistItemsListener
|
||||
@ -59,7 +62,7 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
||||
try {
|
||||
val checklistItemType = object : TypeToken<List<ChecklistItem>>() {}.type
|
||||
items = Gson().fromJson<ArrayList<ChecklistItem>>(storedNote.value, checklistItemType)
|
||||
?: ArrayList(1)
|
||||
?: ArrayList(1)
|
||||
} catch (e: Exception) {
|
||||
migrateCheckListOnFailure(storedNote)
|
||||
}
|
||||
@ -79,9 +82,9 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
||||
|
||||
note.value.split("\n").map { it.trim() }.filter { it.isNotBlank() }.forEachIndexed { index, value ->
|
||||
items.add(ChecklistItem(
|
||||
id = index,
|
||||
title = value,
|
||||
isDone = false
|
||||
id = index,
|
||||
title = value,
|
||||
isDone = false
|
||||
))
|
||||
}
|
||||
|
||||
@ -138,11 +141,11 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
||||
}
|
||||
|
||||
ChecklistAdapter(
|
||||
activity = activity as SimpleActivity,
|
||||
items = items,
|
||||
listener = this,
|
||||
recyclerView = view.checklist_list,
|
||||
showIcons = true
|
||||
activity = activity as SimpleActivity,
|
||||
items = items,
|
||||
listener = this,
|
||||
recyclerView = view.checklist_list,
|
||||
showIcons = true
|
||||
) { item ->
|
||||
val clickedNote = item as ChecklistItem
|
||||
clickedNote.isDone = !clickedNote.isDone
|
||||
|
Loading…
x
Reference in New Issue
Block a user