diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index 456680c0b..212f0da68 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -792,7 +792,7 @@ class PhotoFragment : ViewPagerFragment() { } private fun getExtendedDetailsY(height: Int): Float { - val smallMargin = resources.getDimension(R.dimen.small_margin) + val smallMargin = context?.resources?.getDimension(R.dimen.small_margin) ?: return 0f val fullscreenOffset = smallMargin + if (mIsFullscreen) 0 else context!!.navigationBarHeight val actionsHeight = if (context!!.config.bottomActions && !mIsFullscreen) resources.getDimension(R.dimen.bottom_actions_height) else 0f return context!!.realScreenSize.y - height - actionsHeight - fullscreenOffset diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index d120839ae..96879d3c1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -471,7 +471,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } private fun getExtendedDetailsY(height: Int): Float { - val smallMargin = resources.getDimension(R.dimen.small_margin) + val smallMargin = context?.resources?.getDimension(R.dimen.small_margin) ?: return 0f val fullscreenOffset = smallMargin + if (mIsFullscreen) 0 else context!!.navigationBarHeight var actionsHeight = 0f if (!mIsFullscreen) {