From 9459a18032844e7100d09ba17daa9636e2fe35a9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 4 Nov 2016 19:10:01 +0100 Subject: [PATCH] correction to some save folder cases --- .../camera/activities/SettingsActivity.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/camera/activities/SettingsActivity.kt index 28bd318c..a3c88ccb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/activities/SettingsActivity.kt @@ -17,7 +17,7 @@ class SettingsActivity : SimpleActivity() { setContentView(R.layout.activity_settings) setupDarkTheme() - setupUseDCIM() + setupSavePhotosFolder() setupSound() setupForceRatio() setupMaxPhotoResolution() @@ -48,7 +48,7 @@ class SettingsActivity : SimpleActivity() { } } - private fun setupUseDCIM() { + private fun setupSavePhotosFolder() { var currPath = mConfig.savePhotosFolder settings_save_photos.text = currPath.substring(currPath.lastIndexOf("/") + 1) settings_save_photos_holder.setOnClickListener { @@ -57,9 +57,9 @@ class SettingsActivity : SimpleActivity() { } override fun onSuccess(pickedPath: String) { - currPath = pickedPath - mConfig.savePhotosFolder = pickedPath - settings_save_photos.text = pickedPath.substring(pickedPath.lastIndexOf("/") + 1) + currPath = pickedPath.trimEnd('/') + mConfig.savePhotosFolder = currPath + settings_save_photos.text = currPath.substring(currPath.lastIndexOf("/") + 1) } }) }