File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
app/src/main/kotlin/org/fossify/notes Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99- Added support for custom fonts
1010
1111### Changed
12+ - Checklists are now shared as plain text ([ #96 ] )
1213- Disabled touch outside the checklist dialog to prevent loss of content ([ #291 ] )
1314
1415### Fixed
@@ -102,6 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
102103[ #59 ] : https://github.com/FossifyOrg/Notes/issues/59
103104[ #81 ] : https://github.com/FossifyOrg/Notes/issues/81
104105[ #83 ] : https://github.com/FossifyOrg/Notes/issues/83
106+ [ #96 ] : https://github.com/FossifyOrg/Notes/issues/96
105107[ #99 ] : https://github.com/FossifyOrg/Notes/issues/99
106108[ #110 ] : https://github.com/FossifyOrg/Notes/issues/110
107109[ #156 ] : https://github.com/FossifyOrg/Notes/issues/156
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ import org.fossify.notes.dialogs.OpenFileDialog
104104import org.fossify.notes.dialogs.OpenNoteDialog
105105import org.fossify.notes.dialogs.RenameNoteDialog
106106import org.fossify.notes.dialogs.SortChecklistDialog
107+ import org.fossify.notes.extensions.checklistToPlainText
107108import org.fossify.notes.extensions.config
108109import org.fossify.notes.extensions.getPercentageFontSize
109110import org.fossify.notes.extensions.notesDB
@@ -1457,7 +1458,7 @@ class MainActivity : SimpleActivity() {
14571458 val text = if (mCurrentNote.type == NoteType .TYPE_TEXT ) {
14581459 getCurrentNoteText()
14591460 } else {
1460- mCurrentNote.value
1461+ mCurrentNote.value.checklistToPlainText(config.moveDoneChecklistItems) ? : mCurrentNote.value
14611462 }
14621463
14631464 if (text.isNullOrEmpty()) {
Original file line number Diff line number Diff line change @@ -14,3 +14,12 @@ fun String.parseChecklistItems(): ArrayList<Task>? {
1414 }
1515 return null
1616}
17+
18+ fun String.checklistToPlainText (moveDoneToBottom : Boolean = true): String? {
19+ val tasks = parseChecklistItems() ? : return null
20+ val sortedTasks = if (moveDoneToBottom) tasks.sortedBy { it.isDone } else tasks
21+ return sortedTasks.joinToString(" \n " ) { task ->
22+ val checkbox = if (task.isDone) " [x]" else " [ ]"
23+ " $checkbox ${task.title} "
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments