always refresh viewpager when successfully returning from the editor

This commit is contained in:
tibbi 2018-02-24 20:16:03 +01:00
parent 02b6525ee9
commit 97236d6ed2
4 changed files with 5 additions and 3 deletions

View File

@ -46,7 +46,7 @@ ext {
}
dependencies {
implementation 'com.simplemobiletools:commons:3.13.0'
implementation 'com.simplemobiletools:commons:3.13.4'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.google.code.gson:gson:2.8.2'

View File

@ -204,7 +204,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
Thread {
val file = File(path)
val fileDirItem = FileDirItem(path, path.getFilenameFromPath())
getFileOutputStream(fileDirItem) {
getFileOutputStream(fileDirItem, true) {
if (it != null) {
saveBitmap(file, bitmap, it)
} else {

View File

@ -654,8 +654,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
}
private fun checkLastMediaChanged() {
if (isActivityDestroyed())
if (isActivityDestroyed()) {
return
}
mLastMediaHandler.removeCallbacksAndMessages(null)
mLastMediaHandler.postDelayed({

View File

@ -713,6 +713,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
if (requestCode == REQUEST_EDIT_IMAGE) {
if (resultCode == Activity.RESULT_OK && resultData != null) {
mPos = -1
mPrevHashcode = 0
refreshViewPager()
}
} else if (requestCode == REQUEST_SET_AS) {