mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-25 21:10:12 +01:00
Merge branch 'master' of github.com:SimpleMobileTools/Simple-Notes
This commit is contained in:
commit
d31a0d8ec7
@ -650,7 +650,8 @@ class MainActivity : SimpleActivity() {
|
|||||||
} else {
|
} else {
|
||||||
val items = arrayListOf(
|
val items = arrayListOf(
|
||||||
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
|
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
|
||||||
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content)))
|
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content))
|
||||||
|
)
|
||||||
|
|
||||||
RadioGroupDialog(this, items) {
|
RadioGroupDialog(this, items) {
|
||||||
val syncFile = it as Int == EXPORT_FILE_SYNC
|
val syncFile = it as Int == EXPORT_FILE_SYNC
|
||||||
@ -740,7 +741,8 @@ class MainActivity : SimpleActivity() {
|
|||||||
private fun showExportFilePickUpdateDialog(exportPath: String, textToExport: String) {
|
private fun showExportFilePickUpdateDialog(exportPath: String, textToExport: String) {
|
||||||
val items = arrayListOf(
|
val items = arrayListOf(
|
||||||
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
|
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
|
||||||
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content)))
|
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content))
|
||||||
|
)
|
||||||
|
|
||||||
RadioGroupDialog(this, items) {
|
RadioGroupDialog(this, items) {
|
||||||
val syncFile = it as Int == EXPORT_FILE_SYNC
|
val syncFile = it as Int == EXPORT_FILE_SYNC
|
||||||
@ -771,7 +773,8 @@ class MainActivity : SimpleActivity() {
|
|||||||
ExportFilesDialog(this, mNotes) { parent, extension ->
|
ExportFilesDialog(this, mNotes) { parent, extension ->
|
||||||
val items = arrayListOf(
|
val items = arrayListOf(
|
||||||
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
|
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
|
||||||
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content)))
|
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content))
|
||||||
|
)
|
||||||
|
|
||||||
RadioGroupDialog(this, items) {
|
RadioGroupDialog(this, items) {
|
||||||
val syncFile = it as Int == EXPORT_FILE_SYNC
|
val syncFile = it as Int == EXPORT_FILE_SYNC
|
||||||
@ -858,9 +861,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val file = File(path)
|
val file = File(path)
|
||||||
file.printWriter().use { out ->
|
file.writeText(content)
|
||||||
out.write(content)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showSuccessToasts) {
|
if (showSuccessToasts) {
|
||||||
noteExportedSuccessfully(path.getFilenameFromPath())
|
noteExportedSuccessfully(path.getFilenameFromPath())
|
||||||
@ -875,7 +876,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun exportNoteValueToUri(uri: Uri, content: String, callback: ((success: Boolean) -> Unit)? = null) {
|
private fun exportNoteValueToUri(uri: Uri, content: String, callback: ((success: Boolean) -> Unit)? = null) {
|
||||||
try {
|
try {
|
||||||
val outputStream = contentResolver.openOutputStream(uri)
|
val outputStream = contentResolver.openOutputStream(uri, "wt")
|
||||||
outputStream!!.bufferedWriter().use { out ->
|
outputStream!!.bufferedWriter().use { out ->
|
||||||
out.write(content)
|
out.write(content)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user