mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-22 03:20:16 +01:00
properly handle exporting checklist note values
This commit is contained in:
parent
3c2daaee9a
commit
eee2d57cd2
@ -230,7 +230,7 @@ class MainActivity : SimpleActivity() {
|
||||
if (requestCode == PICK_OPEN_FILE_INTENT && resultCode == RESULT_OK && resultData != null && resultData.data != null) {
|
||||
importUri(resultData.data!!)
|
||||
} else if (requestCode == PICK_EXPORT_FILE_INTENT && resultCode == Activity.RESULT_OK && resultData != null && resultData.data != null) {
|
||||
tryExportNoteValueToFile(resultData.dataString!!, getCurrentNoteText() ?: "", true)
|
||||
tryExportNoteValueToFile(resultData.dataString!!, getCurrentNoteValue(), true)
|
||||
}
|
||||
}
|
||||
|
||||
@ -846,6 +846,14 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
private fun getCurrentNoteText() = getPagerAdapter().getCurrentNoteViewText(view_pager.currentItem)
|
||||
|
||||
private fun getCurrentNoteValue(): String {
|
||||
return if (mCurrentNote.type == NoteType.TYPE_TEXT.value) {
|
||||
getCurrentNoteText() ?: ""
|
||||
} else {
|
||||
getPagerAdapter().getNoteChecklistItems(view_pager.currentItem) ?: ""
|
||||
}
|
||||
}
|
||||
|
||||
private fun addTextToCurrentNote(text: String) = getPagerAdapter().appendText(view_pager.currentItem, text)
|
||||
|
||||
private fun saveCurrentNote(force: Boolean) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user