Update common/src/main/java/dev/lucasnlm/antimine/common/level/view/CommonLevelFragment.kt

This commit is contained in:
Lucas Nunes 2020-12-16 20:12:53 -03:00 committed by GitHub
parent 10597c61a9
commit 589bfff043
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,7 +65,7 @@ abstract class CommonLevelFragment(@LayoutRes val contentLayoutId: Int) : Fragme
val recyclerViewHeight = (dimensionRepository.areaSize() * boardHeight) val recyclerViewHeight = (dimensionRepository.areaSize() * boardHeight)
val separatorsHeight = (2 * dimensionRepository.areaSeparator() * (boardHeight - 1)) val separatorsHeight = (2 * dimensionRepository.areaSeparator() * (boardHeight - 1))
val calculatedHeight = (height - recyclerViewHeight - separatorsHeight - adsHeight) val calculatedHeight = (height - recyclerViewHeight - separatorsHeight - adsHeight)
return ((calculatedHeight / 2) - adsHeight).coerceAtLeast(0f).toInt() return ((calculatedHeight / 2) - adsHeight).coerceAtLeast(0.0f).toInt()
} }
open fun dpFromPx(context: Context, px: Float): Int { open fun dpFromPx(context: Context, px: Float): Int {