implement the folder picker for saving stuff
This commit is contained in:
parent
229f7111f2
commit
9d88e2136c
|
@ -37,7 +37,7 @@ dependencies {
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
compile 'com.android.support:appcompat-v7:23.4.0'
|
compile 'com.android.support:appcompat-v7:23.4.0'
|
||||||
compile 'com.jakewharton:butterknife:8.0.1'
|
compile 'com.jakewharton:butterknife:8.0.1'
|
||||||
compile 'com.simplemobiletools:filepicker:1.3.3@aar'
|
compile 'com.simplemobiletools:filepicker:1.3.5@aar'
|
||||||
compile 'com.github.bumptech.glide:glide:3.7.0'
|
compile 'com.github.bumptech.glide:glide:3.7.0'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.AdapterView
|
import android.widget.AdapterView
|
||||||
import com.simplemobiletools.camera.R
|
import com.simplemobiletools.camera.R
|
||||||
|
import com.simplemobiletools.filepicker.dialogs.FilePickerDialog
|
||||||
import kotlinx.android.synthetic.main.activity_settings.*
|
import kotlinx.android.synthetic.main.activity_settings.*
|
||||||
|
|
||||||
class SettingsActivity : SimpleActivity() {
|
class SettingsActivity : SimpleActivity() {
|
||||||
|
@ -48,9 +49,19 @@ class SettingsActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupUseDCIM() {
|
private fun setupUseDCIM() {
|
||||||
settings_save_photos.text = mConfig.savePhotosFolder.substring(mConfig.savePhotosFolder.lastIndexOf("/") + 1)
|
var currPath = mConfig.savePhotosFolder
|
||||||
|
settings_save_photos.text = currPath.substring(currPath.lastIndexOf("/") + 1)
|
||||||
settings_save_photos_holder.setOnClickListener {
|
settings_save_photos_holder.setOnClickListener {
|
||||||
|
FilePickerDialog(this, currPath, false, false, true, object: FilePickerDialog.OnFilePickerListener {
|
||||||
|
override fun onFail(error: FilePickerDialog.FilePickerResult) {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(pickedPath: String) {
|
||||||
|
currPath = pickedPath
|
||||||
|
mConfig.savePhotosFolder = pickedPath
|
||||||
|
settings_save_photos.text = pickedPath.substring(pickedPath.lastIndexOf("/") + 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue