diff --git a/app/build.gradle b/app/build.gradle index 3b6f30473..624352e24 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.1.10' + compile 'com.simplemobiletools:commons:2.2.0' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickAlbumDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickAlbumDialog.kt index bd8bd8a01..8bc09e677 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickAlbumDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickAlbumDialog.kt @@ -40,13 +40,8 @@ class PickAlbumDialog(val activity: SimpleActivity, val callback: (path: String) fun showOtherFolder() { val initialPath = Environment.getExternalStorageDirectory().toString() val showHidden = Config.newInstance(activity).showHiddenFolders - FilePickerDialog(activity, initialPath, false, showHidden, object : FilePickerDialog.OnFilePickerListener { - override fun onSuccess(pickedPath: String) { - callback.invoke(pickedPath) - } - - override fun onFail(error: FilePickerDialog.FilePickerResult) { - } - }) + FilePickerDialog(activity, initialPath, false, showHidden) { + callback.invoke(it) + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt index 96543012d..2ae3ae11e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt @@ -1,16 +1,16 @@ package com.simplemobiletools.gallery.dialogs -import android.app.Activity import android.support.v7.app.AlertDialog import android.view.LayoutInflater import android.view.WindowManager import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.activities.SimpleActivity import kotlinx.android.synthetic.main.rename_file.view.* import java.io.File -class SaveAsDialog(val activity: Activity, val path: String, val callback: (savePath: String) -> Unit) { +class SaveAsDialog(val activity: SimpleActivity, val path: String, val callback: (savePath: String) -> Unit) { init { var realPath = File(path).parent.trimEnd('/') @@ -29,15 +29,10 @@ class SaveAsDialog(val activity: Activity, val path: String, val callback: (save file_name.setText(name) file_path.setOnClickListener { - FilePickerDialog(activity, realPath, false, false, listener = object : FilePickerDialog.OnFilePickerListener { - override fun onSuccess(pickedPath: String) { - file_path.text = activity.humanizePath(pickedPath) - realPath = pickedPath - } - - override fun onFail(error: FilePickerDialog.FilePickerResult) { - } - }) + FilePickerDialog(activity, realPath, false, false) { + file_path.text = activity.humanizePath(it) + realPath = it + } } }