Skip to content

Commit 15763d8

Browse files
committed
export notes into txt files
1 parent 3ea30cc commit 15763d8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ class MainActivity : SimpleActivity() {
878878
}
879879

880880
private fun tryExportNotes() {
881+
hideKeyboard()
881882
val fileName = "${getString(R.string.notes)}_${getCurrentFormattedDateTime()}"
882883
Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
883884
type = EXPORT_MIME_TYPE
@@ -910,6 +911,7 @@ class MainActivity : SimpleActivity() {
910911
}
911912

912913
private fun tryImportNotes() {
914+
hideKeyboard()
913915
Intent(Intent.ACTION_GET_CONTENT).apply {
914916
addCategory(Intent.CATEGORY_OPENABLE)
915917
type = EXPORT_MIME_TYPE

app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Constants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const val USE_INCOGNITO_MODE = "use_incognito_mode"
3636
const val LAST_CREATED_NOTE_TYPE = "last_created_note_type"
3737
const val MOVE_DONE_CHECKLIST_ITEMS = "move_undone_checklist_items" // it has been replaced from moving undone items at the top to moving done to bottom
3838
const val FONT_SIZE_PERCENTAGE = "font_size_percentage"
39-
const val EXPORT_MIME_TYPE = "application/json"
39+
const val EXPORT_MIME_TYPE = "text/plain"
4040

4141
// gravity
4242
const val GRAVITY_LEFT = 0

app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/NotesExporter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class NotesExporter(private val context: Context) {
2929
writer.beginArray()
3030
val notes = context.notesDB.getNotes() as ArrayList<Note>
3131
for (note in notes) {
32-
if (note.protectionType === PROTECTION_NONE) {
32+
if (note.protectionType == PROTECTION_NONE) {
3333
val noteToSave = getNoteToExport(note)
3434
writer.jsonValue(gson.toJson(noteToSave))
3535
written++

0 commit comments

Comments
 (0)