mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 14:28:00 +01:00
update commons to 2.6.8
This commit is contained in:
parent
f0021bf6d8
commit
2544c91859
7 changed files with 9 additions and 9 deletions
|
@ -32,7 +32,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.6.7'
|
compile 'com.simplemobiletools:commons:2.6.8'
|
||||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
|
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
|
||||||
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
|
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
|
||||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||||
|
|
|
@ -128,7 +128,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||||
if (isShowingPermDialog(file))
|
if (isShowingPermDialog(file))
|
||||||
return
|
return
|
||||||
|
|
||||||
var document = getFileDocument(path, config.treeUri)
|
var document = getFileDocument(path, config.treeUri) ?: return
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
document = document.createFile("", file.name)
|
document = document.createFile("", file.name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,7 +200,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
|
|
||||||
Thread({
|
Thread({
|
||||||
if (!file.delete()) {
|
if (!file.delete()) {
|
||||||
val document = getFileDocument(file.absolutePath, config.treeUri)
|
val document = getFileDocument(file.absolutePath, config.treeUri) ?: return@Thread
|
||||||
|
|
||||||
// double check we have the uri to the proper file path, not some parent folder
|
// double check we have the uri to the proper file path, not some parent folder
|
||||||
val uri = URLDecoder.decode(document.uri.toString(), "UTF-8")
|
val uri = URLDecoder.decode(document.uri.toString(), "UTF-8")
|
||||||
|
|
|
@ -238,7 +238,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
if (it.delete() || tryFastDocumentDelete(it)) {
|
if (it.delete() || tryFastDocumentDelete(it)) {
|
||||||
hadSuccess = true
|
hadSuccess = true
|
||||||
} else {
|
} else {
|
||||||
val document = getFileDocument(it.absolutePath, config.treeUri)
|
val document = getFileDocument(it.absolutePath, config.treeUri) ?: return@forEach
|
||||||
if (document.isFile && document.delete()) {
|
if (document.isFile && document.delete()) {
|
||||||
hadSuccess = true
|
hadSuccess = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,7 +191,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
if (isShowingPermDialog(file))
|
if (isShowingPermDialog(file))
|
||||||
return@SaveAsDialog
|
return@SaveAsDialog
|
||||||
|
|
||||||
var document = getFileDocument(it, config.treeUri)
|
var document = getFileDocument(it, config.treeUri) ?: return@SaveAsDialog
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
document = document.createFile("", file.name)
|
document = document.createFile("", file.name)
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
Thread {
|
Thread {
|
||||||
if (!file.delete() && !tryFastDocumentDelete(file)) {
|
if (!file.delete() && !tryFastDocumentDelete(file)) {
|
||||||
val document = getFileDocument(file.absolutePath, config.treeUri)
|
val document = getFileDocument(file.absolutePath, config.treeUri) ?: return@Thread
|
||||||
|
|
||||||
if (!document.isFile || !document.delete()) {
|
if (!document.isFile || !document.delete()) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
|
|
@ -49,7 +49,7 @@ class RenameDirectoryDialog(val activity: SimpleActivity, val dir: File, val cal
|
||||||
if (activity.isShowingPermDialog(dir))
|
if (activity.isShowingPermDialog(dir))
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
|
|
||||||
val document = context.getFileDocument(dir.absolutePath, context.config.treeUri)
|
val document = context.getFileDocument(dir.absolutePath, context.config.treeUri) ?: return@setOnClickListener
|
||||||
if (document.canWrite())
|
if (document.canWrite())
|
||||||
document.renameTo(newDirName)
|
document.renameTo(newDirName)
|
||||||
sendSuccess(updatedFiles, newDir)
|
sendSuccess(updatedFiles, newDir)
|
||||||
|
|
|
@ -59,11 +59,11 @@ class RenameFileDialog(val activity: SimpleActivity, val file: File, val callbac
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
|
|
||||||
var document = context.getFastDocument(file)
|
var document = context.getFastDocument(file)
|
||||||
if (!document.isFile) {
|
if (document?.isFile == false) {
|
||||||
document = context.getFileDocument(file.absolutePath, context.config.treeUri)
|
document = context.getFileDocument(file.absolutePath, context.config.treeUri)
|
||||||
}
|
}
|
||||||
|
|
||||||
DocumentsContract.renameDocument(context.contentResolver, document.uri, newFile.name)
|
DocumentsContract.renameDocument(context.contentResolver, document!!.uri, newFile.name)
|
||||||
sendSuccess(file, newFile)
|
sendSuccess(file, newFile)
|
||||||
dismiss()
|
dismiss()
|
||||||
} else if (file.renameTo(newFile)) {
|
} else if (file.renameTo(newFile)) {
|
||||||
|
|
Loading…
Reference in a new issue