update commons to 2.2.0

This commit is contained in:
tibbi 2017-01-07 15:58:01 +01:00
parent aaab1593c0
commit 92959d474c
3 changed files with 10 additions and 20 deletions

View file

@ -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'

View file

@ -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)
FilePickerDialog(activity, initialPath, false, showHidden) {
callback.invoke(it)
}
override fun onFail(error: FilePickerDialog.FilePickerResult) {
}
})
}
}

View file

@ -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
FilePickerDialog(activity, realPath, false, false) {
file_path.text = activity.humanizePath(it)
realPath = it
}
override fun onFail(error: FilePickerDialog.FilePickerResult) {
}
})
}
}