adding extra null checks at extended details fetching
This commit is contained in:
parent
d730278659
commit
290ff6f993
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue