From 02ce6bd11b6d362a9f0dd390bdb6c557b7513012 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 17 Jun 2018 20:11:29 +0200 Subject: [PATCH] make bottom actions work well with extended details --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 3 ++- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 2ad42afb4..d69f35829 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -431,6 +431,7 @@ class PhotoFragment : ViewPagerFragment() { private fun getExtendedDetailsY(height: Int): Float { val smallMargin = resources.getDimension(R.dimen.small_margin) val fullscreenOffset = context!!.navigationBarHeight.toFloat() - smallMargin - return context!!.usableScreenSize.y - height + if (isFullscreen) fullscreenOffset else -smallMargin + 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 } } 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 9993663ae..7faf57b2a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -199,6 +199,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee right += context!!.navigationBarWidth bottom += context!!.navigationBarHeight } + + if (context!!.config.bottomActions) { + bottom += resources.getDimension(R.dimen.bottom_actions_height).toInt() + } mTimeHolder!!.setPadding(left, top, right, bottom) }