Merge branch 'add-recycler-padding' of github.com:lucasnlm/antimine-android into add-recycler-padding

This commit is contained in:
Lucas Lima 2020-12-16 21:48:29 -03:00
commit 0ba4bb4a11

View file

@ -54,7 +54,7 @@ abstract class CommonLevelFragment(@LayoutRes val contentLayoutId: Int) : Fragme
val width = view.measuredWidth
val recyclerViewWidth = (dimensionRepository.areaSize() * boardWidth)
val separatorsWidth = (dimensionRepository.areaSeparator() * (boardWidth + 2))
return ((width - recyclerViewWidth - separatorsWidth) / 2).coerceAtLeast(0f).nextDown().toInt()
return ((width - recyclerViewWidth - separatorsWidth) / 2).coerceAtLeast(0.0f).nextDown().toInt()
}
private fun calcVerticalPadding(view: View, boardHeight: Int): Int {
@ -65,7 +65,7 @@ abstract class CommonLevelFragment(@LayoutRes val contentLayoutId: Int) : Fragme
val recyclerViewHeight = (dimensionRepository.areaSize() * boardHeight)
val separatorsHeight = (2 * dimensionRepository.areaSeparator() * (boardHeight - 1))
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 {