mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-20 18:40:20 +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.activities.SimpleActivity
|
||||||
import com.simplemobiletools.notes.pro.adapters.ChecklistAdapter
|
import com.simplemobiletools.notes.pro.adapters.ChecklistAdapter
|
||||||
import com.simplemobiletools.notes.pro.dialogs.NewChecklistItemDialog
|
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.NOTE_ID
|
||||||
import com.simplemobiletools.notes.pro.helpers.NotesHelper
|
import com.simplemobiletools.notes.pro.helpers.NotesHelper
|
||||||
import com.simplemobiletools.notes.pro.interfaces.ChecklistItemsListener
|
import com.simplemobiletools.notes.pro.interfaces.ChecklistItemsListener
|
||||||
@ -59,7 +62,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)
|
||||||
}
|
}
|
||||||
@ -79,9 +82,9 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
|
|
||||||
note.value.split("\n").map { it.trim() }.filter { it.isNotBlank() }.forEachIndexed { index, value ->
|
note.value.split("\n").map { it.trim() }.filter { it.isNotBlank() }.forEachIndexed { index, value ->
|
||||||
items.add(ChecklistItem(
|
items.add(ChecklistItem(
|
||||||
id = index,
|
id = index,
|
||||||
title = value,
|
title = value,
|
||||||
isDone = false
|
isDone = false
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,11 +141,11 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ChecklistAdapter(
|
ChecklistAdapter(
|
||||||
activity = activity as SimpleActivity,
|
activity = activity as SimpleActivity,
|
||||||
items = items,
|
items = items,
|
||||||
listener = this,
|
listener = this,
|
||||||
recyclerView = view.checklist_list,
|
recyclerView = view.checklist_list,
|
||||||
showIcons = true
|
showIcons = true
|
||||||
) { item ->
|
) { item ->
|
||||||
val clickedNote = item as ChecklistItem
|
val clickedNote = item as ChecklistItem
|
||||||
clickedNote.isDone = !clickedNote.isDone
|
clickedNote.isDone = !clickedNote.isDone
|
||||||
|
Loading…
x
Reference in New Issue
Block a user