mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
request an overwrite confirmation when replacing the original image with edited
This commit is contained in:
parent
630e4e11b8
commit
ee44432665
2 changed files with 12 additions and 3 deletions
|
@ -32,7 +32,7 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.simplemobiletools:commons:2.18.8'
|
||||
compile 'com.simplemobiletools:commons:2.18.9'
|
||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
|
||||
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
|
||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.simplemobiletools.gallery.dialogs
|
|||
import android.support.v7.app.AlertDialog
|
||||
import android.view.LayoutInflater
|
||||
import android.view.WindowManager
|
||||
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.gallery.R
|
||||
|
@ -62,8 +63,16 @@ class SaveAsDialog(val activity: SimpleActivity, val path: String, val callback:
|
|||
return@setOnClickListener
|
||||
}
|
||||
|
||||
if (newFile.exists()) {
|
||||
val title = String.format(activity.getString(R.string.file_already_exists_overwrite), newFile.name)
|
||||
ConfirmationDialog(activity, title) {
|
||||
callback.invoke(newFile.absolutePath)
|
||||
dismiss()
|
||||
}
|
||||
} else {
|
||||
callback.invoke(newFile.absolutePath)
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue