updating commons to 5.21.0
This commit is contained in:
parent
980b57250c
commit
37cb4f2608
7 changed files with 27 additions and 5 deletions
|
@ -62,7 +62,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.20.10'
|
implementation 'com.simplemobiletools:commons:5.21.0'
|
||||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
||||||
|
|
|
@ -633,7 +633,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
val currentPath = getCurrentPath()
|
val currentPath = getCurrentPath()
|
||||||
if (needsStupidWritePermissions(currentPath)) {
|
if (needsStupidWritePermissions(currentPath)) {
|
||||||
handleSAFDialog(currentPath) {
|
handleSAFDialog(currentPath) {
|
||||||
rotateBy(degrees)
|
if (it) {
|
||||||
|
rotateBy(degrees)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rotateBy(degrees)
|
rotateBy(degrees)
|
||||||
|
@ -668,6 +670,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
SaveAsDialog(this, currPath, false) {
|
SaveAsDialog(this, currPath, false) {
|
||||||
val newPath = it
|
val newPath = it
|
||||||
handleSAFDialog(it) {
|
handleSAFDialog(it) {
|
||||||
|
if (!it) {
|
||||||
|
return@handleSAFDialog
|
||||||
|
}
|
||||||
|
|
||||||
toast(R.string.saving)
|
toast(R.string.saving)
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
val photoFragment = getCurrentPhotoFragment() ?: return@ensureBackgroundThread
|
val photoFragment = getCurrentPhotoFragment() ?: return@ensureBackgroundThread
|
||||||
|
|
|
@ -544,6 +544,10 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.handleSAFDialog(SAFPath) {
|
activity.handleSAFDialog(SAFPath) {
|
||||||
|
if (!it) {
|
||||||
|
return@handleSAFDialog
|
||||||
|
}
|
||||||
|
|
||||||
var foldersToDelete = ArrayList<File>(selectedKeys.size)
|
var foldersToDelete = ArrayList<File>(selectedKeys.size)
|
||||||
selectedDirs.forEach {
|
selectedDirs.forEach {
|
||||||
if (it.areFavorites() || it.isRecycleBin()) {
|
if (it.areFavorites() || it.isRecycleBin()) {
|
||||||
|
|
|
@ -81,7 +81,9 @@ class ManageHiddenFoldersAdapter(activity: BaseSimpleActivity, var folders: Arra
|
||||||
|
|
||||||
if (sdCardPaths.isNotEmpty()) {
|
if (sdCardPaths.isNotEmpty()) {
|
||||||
activity.handleSAFDialog(sdCardPaths.first()) {
|
activity.handleSAFDialog(sdCardPaths.first()) {
|
||||||
unhideFolders(removeFolders)
|
if (it) {
|
||||||
|
unhideFolders(removeFolders)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unhideFolders(removeFolders)
|
unhideFolders(removeFolders)
|
||||||
|
|
|
@ -426,6 +426,10 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
||||||
|
|
||||||
val SAFPath = getSelectedPaths().firstOrNull { activity.needsStupidWritePermissions(it) } ?: getFirstSelectedItemPath() ?: return
|
val SAFPath = getSelectedPaths().firstOrNull { activity.needsStupidWritePermissions(it) } ?: getFirstSelectedItemPath() ?: return
|
||||||
activity.handleSAFDialog(SAFPath) {
|
activity.handleSAFDialog(SAFPath) {
|
||||||
|
if (!it) {
|
||||||
|
return@handleSAFDialog
|
||||||
|
}
|
||||||
|
|
||||||
val fileDirItems = ArrayList<FileDirItem>(selectedKeys.size)
|
val fileDirItems = ArrayList<FileDirItem>(selectedKeys.size)
|
||||||
val removeMedia = ArrayList<Medium>(selectedKeys.size)
|
val removeMedia = ArrayList<Medium>(selectedKeys.size)
|
||||||
val positions = getSelectedItemPositions()
|
val positions = getSelectedItemPositions()
|
||||||
|
|
|
@ -8,7 +8,8 @@ import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import kotlinx.android.synthetic.main.dialog_save_as.view.*
|
import kotlinx.android.synthetic.main.dialog_save_as.view.*
|
||||||
|
|
||||||
class SaveAsDialog(val activity: BaseSimpleActivity, val path: String, val appendFilename: Boolean, val callback: (savePath: String) -> Unit) {
|
class SaveAsDialog(val activity: BaseSimpleActivity, val path: String, val appendFilename: Boolean, val cancelCallback: (() -> Unit)? = null,
|
||||||
|
val callback: (savePath: String) -> Unit) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
var realPath = path.getParentPath()
|
var realPath = path.getParentPath()
|
||||||
|
@ -41,7 +42,8 @@ class SaveAsDialog(val activity: BaseSimpleActivity, val path: String, val appen
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
AlertDialog.Builder(activity)
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel) { dialog, which -> cancelCallback?.invoke() }
|
||||||
|
.setOnCancelListener { cancelCallback?.invoke() }
|
||||||
.create().apply {
|
.create().apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.save_as) {
|
activity.setupDialogStuff(view, this, R.string.save_as) {
|
||||||
showKeyboard(view.save_as_name)
|
showKeyboard(view.save_as_name)
|
||||||
|
|
|
@ -138,6 +138,10 @@ fun BaseSimpleActivity.addNoMedia(path: String, callback: () -> Unit) {
|
||||||
|
|
||||||
if (needsStupidWritePermissions(path)) {
|
if (needsStupidWritePermissions(path)) {
|
||||||
handleSAFDialog(file.absolutePath) {
|
handleSAFDialog(file.absolutePath) {
|
||||||
|
if (!it) {
|
||||||
|
return@handleSAFDialog
|
||||||
|
}
|
||||||
|
|
||||||
val fileDocument = getDocumentFile(path)
|
val fileDocument = getDocumentFile(path)
|
||||||
if (fileDocument?.exists() == true && fileDocument.isDirectory) {
|
if (fileDocument?.exists() == true && fileDocument.isDirectory) {
|
||||||
fileDocument.createFile("", NOMEDIA)
|
fileDocument.createFile("", NOMEDIA)
|
||||||
|
|
Loading…
Reference in a new issue