From 494745c10fb6e7c2cf574dc0af660761e9de5dee Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 15 Jan 2019 21:11:00 +0100 Subject: [PATCH] fix the video time holder right margin at landscape video fragment --- .../gallery/pro/fragments/VideoFragment.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 57ab7dcae..5e78802a8 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 @@ -410,12 +410,20 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } private fun initTimeHolder() { - var bottomMargin = context!!.navigationBarHeight + var right = 0 + var bottom = context!!.navigationBarHeight if (mConfig.bottomActions) { - bottomMargin += resources.getDimension(R.dimen.bottom_actions_height).toInt() + bottom += resources.getDimension(R.dimen.bottom_actions_height).toInt() } - (mTimeHolder.layoutParams as RelativeLayout.LayoutParams).bottomMargin = bottomMargin + if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE && activity?.hasNavBar() == true) { + right += activity!!.navigationBarWidth + } + + (mTimeHolder.layoutParams as RelativeLayout.LayoutParams).apply { + bottomMargin = bottom + rightMargin = right + } mTimeHolder.beInvisibleIf(mIsFullscreen) }