fix #555, check if file exists at viewpager activity
This commit is contained in:
parent
3c06dfd431
commit
4b2d41ec75
|
@ -42,7 +42,7 @@ ext {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:3.5.11'
|
||||
implementation 'com.simplemobiletools:commons:3.6.0'
|
||||
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
|
||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
|
||||
implementation 'com.android.support:multidex:1.0.2'
|
||||
|
|
|
@ -177,6 +177,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
return
|
||||
}
|
||||
|
||||
val file = File(mPath)
|
||||
if (!file.exists()) {
|
||||
deleteFromMediaStore(file)
|
||||
finish()
|
||||
return
|
||||
}
|
||||
|
||||
if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) {
|
||||
if (isShowHiddenFlagNeeded()) {
|
||||
if (!config.isPasswordProtectionOn) {
|
||||
|
@ -189,7 +196,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
showSystemUI()
|
||||
|
||||
mDirectory = File(mPath).parent
|
||||
mDirectory = file.parent
|
||||
supportActionBar?.title = mPath.getFilenameFromPath()
|
||||
|
||||
view_pager.onGlobalLayout {
|
||||
|
|
Loading…
Reference in New Issue