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