fix some glitches related to calculating the Extended Details location

This commit is contained in:
tibbi 2018-10-02 17:04:07 +02:00
parent 430fa3a1aa
commit cd5804ccb9
2 changed files with 4 additions and 5 deletions

View file

@ -555,8 +555,8 @@ class PhotoFragment : ViewPagerFragment() {
private fun getExtendedDetailsY(height: Int): Float { private fun getExtendedDetailsY(height: Int): Float {
val smallMargin = resources.getDimension(R.dimen.small_margin) 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 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
} }
} }

View file

@ -627,8 +627,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private fun getExtendedDetailsY(height: Int): Float { private fun getExtendedDetailsY(height: Int): Float {
val smallMargin = resources.getDimension(R.dimen.small_margin) val smallMargin = resources.getDimension(R.dimen.small_margin)
val timeHolderHeight = mTimeHolder!!.height - context!!.navigationBarHeight.toFloat() val fullscreenOffset = smallMargin + if (mIsFullscreen) 0 else mTimeHolder!!.height
val fullscreenOffset = context!!.navigationBarHeight.toFloat() - smallMargin return context!!.realScreenSize.y.toFloat() - height - fullscreenOffset
return context!!.usableScreenSize.y - height + if (mIsFullscreen) fullscreenOffset else -(timeHolderHeight + smallMargin)
} }
} }