@@ -33,7 +33,7 @@ import java.nio.charset.Charset
3333
3434class MainActivity : SimpleActivity (), ViewPager.OnPageChangeListener {
3535 val STORAGE_OPEN_FILE = 1
36- val STORAGE_SAVE_AS_FILE = 2
36+ val STORAGE_EXPORT_AS_FILE = 2
3737
3838 lateinit var mCurrentNote: Note
3939 lateinit var mAdapter: NotesPagerAdapter
@@ -113,7 +113,7 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
113113 R .id.rename_note -> displayRenameDialog()
114114 R .id.share -> shareText()
115115 R .id.open_file -> tryOpenFile()
116- R .id.save_as_file -> trySaveAsFile ()
116+ R .id.export_as_file -> tryExportAsFile ()
117117 R .id.delete_note -> displayDeleteNotePrompt()
118118 R .id.settings -> startActivity(Intent (applicationContext, SettingsActivity ::class .java))
119119 R .id.about -> launchAbout()
@@ -181,21 +181,21 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
181181 }
182182 }
183183
184- private fun trySaveAsFile () {
184+ private fun tryExportAsFile () {
185185 if (hasWriteStoragePermission()) {
186- saveAsFile ()
186+ exportAsFile ()
187187 } else {
188- ActivityCompat .requestPermissions(this , arrayOf(Manifest .permission.WRITE_EXTERNAL_STORAGE ), STORAGE_SAVE_AS_FILE )
188+ ActivityCompat .requestPermissions(this , arrayOf(Manifest .permission.WRITE_EXTERNAL_STORAGE ), STORAGE_EXPORT_AS_FILE )
189189 }
190190 }
191191
192- private fun saveAsFile () {
193- SaveAsDialog (this , mCurrentNote) {
194- saveNoteValueToFile (it, getCurrentNoteText())
192+ private fun exportAsFile () {
193+ ExportAsDialog (this , mCurrentNote) {
194+ exportNoteValueToFile (it, getCurrentNoteText())
195195 }
196196 }
197197
198- fun saveNoteValueToFile (path : String , content : String ) {
198+ fun exportNoteValueToFile (path : String , content : String ) {
199199 try {
200200 val file = File (path)
201201 if (file.isDirectory) {
@@ -306,8 +306,8 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
306306 if (grantResults.isNotEmpty() && grantResults[0 ] == PackageManager .PERMISSION_GRANTED ) {
307307 if (requestCode == STORAGE_OPEN_FILE ) {
308308 openFile()
309- } else if (requestCode == STORAGE_SAVE_AS_FILE ) {
310- saveAsFile ()
309+ } else if (requestCode == STORAGE_EXPORT_AS_FILE ) {
310+ exportAsFile ()
311311 }
312312 }
313313 }
0 commit comments