From 9643b2b7fd48b67b7d8dc50d050150548dc19283 Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Wed, 16 Dec 2020 17:37:48 -0300 Subject: [PATCH] Center grid --- .../java/dev/lucasnlm/antimine/level/view/LevelFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/dev/lucasnlm/antimine/level/view/LevelFragment.kt b/app/src/main/java/dev/lucasnlm/antimine/level/view/LevelFragment.kt index 3f11bfce..b88db53f 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/level/view/LevelFragment.kt +++ b/app/src/main/java/dev/lucasnlm/antimine/level/view/LevelFragment.kt @@ -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) } }