Center grid

This commit is contained in:
Lucas Lima 2020-12-16 17:37:48 -03:00
parent dd0cc81a42
commit 9643b2b7fd
No known key found for this signature in database
GPG key ID: 049CCC5A365B00D2

View file

@ -71,8 +71,8 @@ open class LevelFragment : CommonLevelFragment(R.layout.fragment_level) {
recyclerGrid.post {
levelSetup.value?.let { minefield ->
val size = dimensionRepository.areaSizeWithPadding()
val dx = (minefield.width + 2) * size * 0.25f
val dy = (minefield.height + 2) * size * 0.25f
val dx = minefield.width * size * 0.25f
val dy = (minefield.height * size + dimensionRepository.actionBarSize()) * 0.25f - size * 3
recyclerGrid.smoothScrollBy(dx.toInt(), dy.toInt(), null, 200)
}
}