update commons to 3.13.9

This commit is contained in:
tibbi
2018-02-26 11:22:58 +01:00
parent d02f391ed6
commit c023445b3b
5 changed files with 7 additions and 5 deletions

View File

@ -45,7 +45,7 @@ ext {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:3.8.2' implementation 'com.simplemobiletools:commons:3.13.9'
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion" debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion" releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"

View File

@ -245,7 +245,8 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
private fun showLastMediaPreview() { private fun showLastMediaPreview() {
if (mPreviewUri != null) { if (mPreviewUri != null) {
openFile(mPreviewUri!!, false, BuildConfig.APPLICATION_ID) val path = applicationContext.getRealPathFromURI(mPreviewUri!!) ?: mPreviewUri!!.toString()
openPathIntent(path, false, BuildConfig.APPLICATION_ID)
} }
} }

View File

@ -155,7 +155,7 @@ class SettingsActivity : SimpleActivity() {
settings_save_photos.text = getLastPart(config.savePhotosFolder) settings_save_photos.text = getLastPart(config.savePhotosFolder)
settings_save_photos_holder.setOnClickListener { settings_save_photos_holder.setOnClickListener {
FilePickerDialog(this, config.savePhotosFolder, false, showFAB = true) { FilePickerDialog(this, config.savePhotosFolder, false, showFAB = true) {
handleSAFDialog(File(it)) { handleSAFDialog(it) {
config.savePhotosFolder = it config.savePhotosFolder = it
settings_save_photos.text = getLastPart(config.savePhotosFolder) settings_save_photos.text = getLastPart(config.savePhotosFolder)
} }

View File

@ -48,7 +48,8 @@ class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId
activity.config.savePhotosFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).toString() activity.config.savePhotosFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).toString()
return "" return ""
} }
var document = activity.getFileDocument(path)
var document = activity.getDocumentFile(path)
document = document?.createFile("", path.substring(path.lastIndexOf('/') + 1)) document = document?.createFile("", path.substring(path.lastIndexOf('/') + 1))
fos = activity.contentResolver.openOutputStream(document?.uri) fos = activity.contentResolver.openOutputStream(document?.uri)
} else { } else {

View File

@ -680,7 +680,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
} }
try { try {
var document = mActivity!!.getFileDocument(mCurrVideoPath) var document = mActivity!!.getDocumentFile(mCurrVideoPath)
if (document == null) { if (document == null) {
mActivity!!.toast(R.string.unknown_error_occurred) mActivity!!.toast(R.string.unknown_error_occurred)
return false return false