From d1867d70a64e2245689f0ce4680ce2b267fe1fc5 Mon Sep 17 00:00:00 2001 From: Juan Sebastian Ramirez Artiles Date: Thu, 15 Aug 2024 15:21:54 +0000 Subject: [PATCH] Change output folder --- README.md | 6 +++--- android/app/build.gradle | 4 ++-- .../com/totalplaintextreader/MediaStoreModule.kt | 13 +++++++------ index.html | 3 ++- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index cc9064c..06918a0 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ **Plain Text Total Editor** is designed to allow the creation and editing of plain text files. You can create files from scratch or open them in editing mode. ## Application behavior: -The formats it accepts are: TXT, HTML, CSS, JavaScript, JSON, Python, Perl, C, C++, and MarkDown. The application does not perform validations on the structure of the document. Its operation is that of a basic notepad-type editor. +The formats it accepts are: TXT, HTML, CSS, JavaScript, JSON, Python, Perl, C, C++, and MarkDown. The application does not perform validations on the structure of the document. Its operation is that of a basic notepad-type editor. The program can be used in write or read mode activating the 'edit switch'. ## Reading and writting: -The application can read documents in any path accessible from the device. Documents once edited can be saved. The files will be automatically saved in the *Download* folder, taking the name assigned in the application's text field. -During the saving process, the file name extension will be checked. If the extension matches one of those accepted by the application, the file will be stored with that name. If no extension is assigned, or the extension is not supported, the file will be created with a 'txt' extension. If a file with that name already exists, it will be rewritten.. +The application can read documents in any path accessible from the device. Documents once edited can be saved. The files will be automatically saved in the *Download/notes* folder, taking the name assigned in the application's text field. +During the saving process, the file name extension will be checked. If the extension matches one of those accepted by the application, the file will be stored with that name. If no extension is assigned, or the extension is not supported, the file will be created with a 'txt' extension. If a file with that name already exists, it will be rewritten. ## License: diff --git a/android/app/build.gradle b/android/app/build.gradle index d69ea74..b2ca3a7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -79,8 +79,8 @@ android { applicationId "com.totalplaintextreader" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 15 - versionName "1.1.13" + versionCode 16 + versionName "1.1.14" } signingConfigs { diff --git a/android/app/src/main/java/com/totalplaintextreader/MediaStoreModule.kt b/android/app/src/main/java/com/totalplaintextreader/MediaStoreModule.kt index ee62398..a6e13ad 100644 --- a/android/app/src/main/java/com/totalplaintextreader/MediaStoreModule.kt +++ b/android/app/src/main/java/com/totalplaintextreader/MediaStoreModule.kt @@ -114,15 +114,16 @@ class MediaStoreModule( } private fun createFileUri(fileName: String): Uri? { - val values = - ContentValues().apply { - put(MediaStore.MediaColumns.DISPLAY_NAME, fileName) - put(MediaStore.MediaColumns.MIME_TYPE, getMimeTypeFromExtension(fileName)) - put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS) - } + val notesFolder = "${Environment.DIRECTORY_DOWNLOADS}/notes" + val values = ContentValues().apply { + put(MediaStore.MediaColumns.DISPLAY_NAME, fileName) + put(MediaStore.MediaColumns.MIME_TYPE, getMimeTypeFromExtension(fileName)) + put(MediaStore.MediaColumns.RELATIVE_PATH, notesFolder) + } return reactContext.contentResolver.insert(MediaStore.Files.getContentUri("external"), values) } + private fun writeContentToFile( uri: Uri?, content: String, diff --git a/index.html b/index.html index f3bb180..a62f484 100644 --- a/index.html +++ b/index.html @@ -134,6 +134,7 @@

Application Behavior:

The formats it accepts are: TXT, HTML, CSS, JavaScript, JSON, Python, Perl, C, C++, and MarkDown. The application does not perform validations on the structure of the document. Its operation is that of a basic notepad-type editor. + The program can be used in write or read mode activating the 'edit switch'.

@@ -141,7 +142,7 @@

Application Behavior:

Reading and Writting:

The application can read documents in any path accessible from the device. - Documents once edited can be saved. The files will be automatically saved in the Download folder, + Documents once edited can be saved. The files will be automatically saved in the Download/notes folder, taking the name assigned in the application's text field. During the saving process, the file name extension will be checked. If the extension matches one of those accepted by the application, the file will be stored with that