From cd5804ccb962715b10eff725bc622f5229f9c8e7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 2 Oct 2018 17:04:07 +0200 Subject: [PATCH] fix some glitches related to calculating the Extended Details location --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 4 ++-- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index fa9f26286..abaa96355 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -555,8 +555,8 @@ class PhotoFragment : ViewPagerFragment() { private fun getExtendedDetailsY(height: Int): Float { val smallMargin = resources.getDimension(R.dimen.small_margin) - val fullscreenOffset = context!!.navigationBarHeight.toFloat() - smallMargin + val fullscreenOffset = smallMargin + if (isFullscreen) 0 else context!!.navigationBarHeight val actionsHeight = if (context!!.config.bottomActions && !isFullscreen) resources.getDimension(R.dimen.bottom_actions_height) else 0f - return context!!.usableScreenSize.y - height - actionsHeight + if (isFullscreen) fullscreenOffset else -smallMargin + return context!!.realScreenSize.y - height - actionsHeight - fullscreenOffset } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 2c6927ea9..f9c53aac5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -627,8 +627,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S private fun getExtendedDetailsY(height: Int): Float { val smallMargin = resources.getDimension(R.dimen.small_margin) - val timeHolderHeight = mTimeHolder!!.height - context!!.navigationBarHeight.toFloat() - val fullscreenOffset = context!!.navigationBarHeight.toFloat() - smallMargin - return context!!.usableScreenSize.y - height + if (mIsFullscreen) fullscreenOffset else -(timeHolderHeight + smallMargin) + val fullscreenOffset = smallMargin + if (mIsFullscreen) 0 else mTimeHolder!!.height + return context!!.realScreenSize.y.toFloat() - height - fullscreenOffset } }