Skip to content

Commit d0a947d

Browse files
author
Andrii Chubko
committed
Simplify and reformat code
1 parent de60443 commit d0a947d

File tree

1 file changed

+7
-6
lines changed
  • app/src/main/kotlin/com/simplemobiletools/notes/pro/activities

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,8 @@ class MainActivity : SimpleActivity() {
650650
} else {
651651
val items = arrayListOf(
652652
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
653-
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content)))
653+
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content))
654+
)
654655

655656
RadioGroupDialog(this, items) {
656657
val syncFile = it as Int == EXPORT_FILE_SYNC
@@ -740,7 +741,8 @@ class MainActivity : SimpleActivity() {
740741
private fun showExportFilePickUpdateDialog(exportPath: String, textToExport: String) {
741742
val items = arrayListOf(
742743
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
743-
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content)))
744+
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content))
745+
)
744746

745747
RadioGroupDialog(this, items) {
746748
val syncFile = it as Int == EXPORT_FILE_SYNC
@@ -771,7 +773,8 @@ class MainActivity : SimpleActivity() {
771773
ExportFilesDialog(this, mNotes) { parent, extension ->
772774
val items = arrayListOf(
773775
RadioItem(EXPORT_FILE_SYNC, getString(R.string.update_file_at_note)),
774-
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content)))
776+
RadioItem(EXPORT_FILE_NO_SYNC, getString(R.string.only_export_file_content))
777+
)
775778

776779
RadioGroupDialog(this, items) {
777780
val syncFile = it as Int == EXPORT_FILE_SYNC
@@ -858,9 +861,7 @@ class MainActivity : SimpleActivity() {
858861
}
859862
} else {
860863
val file = File(path)
861-
file.printWriter().use { out ->
862-
out.write(content)
863-
}
864+
file.writeText(content)
864865

865866
if (showSuccessToasts) {
866867
noteExportedSuccessfully(path.getFilenameFromPath())

0 commit comments

Comments
 (0)