diff --git a/gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/ui/newgame/GridPreviewCalculationServiceMock.kt b/gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/ui/newgame/GridPreviewCalculationServiceMock.kt new file mode 100644 index 00000000..a0322e41 --- /dev/null +++ b/gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/ui/newgame/GridPreviewCalculationServiceMock.kt @@ -0,0 +1,19 @@ +package org.piepmeyer.gauguin.ui.newgame + +import kotlinx.coroutines.CoroutineScope +import org.piepmeyer.gauguin.calculation.GridPreviewCalculationService +import org.piepmeyer.gauguin.grid.Grid +import org.piepmeyer.gauguin.options.GameVariant + +class GridPreviewCalculationServiceMock( + private val grid: Grid, +) : GridPreviewCalculationService() { + override fun calculateGrid( + variant: GameVariant, + scope: CoroutineScope, + ) { + listeners.forEach { + it.previewGridCalculated(grid) + } + } +} diff --git a/gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest.kt b/gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest.kt index 9d4af3e0..a2c7fdad 100644 --- a/gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest.kt +++ b/gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest.kt @@ -3,7 +3,9 @@ package org.piepmeyer.gauguin.ui.newgame import com.github.takahirom.roborazzi.captureRoboImage import com.google.android.material.tabs.TabLayout import io.mockk.every +import io.mockk.just import io.mockk.mockk +import io.mockk.runs import org.junit.After import org.junit.Before import org.junit.Rule @@ -19,6 +21,8 @@ import org.piepmeyer.gauguin.R import org.piepmeyer.gauguin.ScreenshotTest import org.piepmeyer.gauguin.ScreenshotTestUtils import org.piepmeyer.gauguin.Theme +import org.piepmeyer.gauguin.calculation.GridCalculationService +import org.piepmeyer.gauguin.calculation.GridPreviewCalculationService import org.piepmeyer.gauguin.creation.GridCreator import org.piepmeyer.gauguin.creation.RandomPossibleDigitsShuffler import org.piepmeyer.gauguin.creation.SeedRandomizerMock @@ -32,7 +36,6 @@ import org.piepmeyer.gauguin.options.GridCageOperation import org.piepmeyer.gauguin.options.NumeralSystem import org.piepmeyer.gauguin.options.SingleCageUsage import org.piepmeyer.gauguin.preferences.ApplicationPreferences -import org.piepmeyer.gauguin.ui.grid.GridUI import org.robolectric.ParameterizedRobolectricTestRunner import org.robolectric.annotation.Config import org.robolectric.annotation.GraphicsMode @@ -101,11 +104,27 @@ class NewGameActivityScreenshotTest( every { numeralSystem } returns NumeralSystem.Decimal every { operations } returns GridCageOperation.OPERATIONS_ALL every { singleCageUsage } returns SingleCageUsage.FIXED_NUMBER - every { gridWidth } returns 9 - every { gridHeigth } returns 9 - every { gameVariant } returns GameOptionsVariant.createClassic() + every { gridWidth } returns 6 + every { gridHeigth } returns 6 + every { squareOnlyGrid } returns true + every { gameOptionsVariant } returns GameOptionsVariant.createClassic() } } withOptions { binds(listOf(ApplicationPreferences::class)) } + /*single { + GridPreviewCalculationServiceMock(createDefaultGrid()) + } withOptions { binds(listOf(GridPreviewCalculationService::class)) }*/ + single { + mockk(relaxed = true) { + every { takeCalculatedGrid(any()) } just runs + every { calculateGrid(any(), any()) } just runs + } + } withOptions { binds(listOf(GridPreviewCalculationService::class)) } + single { + mockk(relaxed = true) { + every { hasCalculatedNextGrid(any()) } returns true + every { consumeNextGrid() } returns createDefaultGrid() + } + } withOptions { binds(listOf(GridCalculationService::class)) } } } @@ -118,8 +137,6 @@ class NewGameActivityScreenshotTest( @Test fun screenshotTest() { robolectricScreenshotRule.activityScenario.onActivity { - it.findViewById(R.id.newGridPreview).grid = createDefaultGrid() - val tabs = it.findViewById(R.id.new_game_options_tablayout) when (testItem.uiState) { @@ -127,6 +144,8 @@ class NewGameActivityScreenshotTest( UiStateEnum.TabNumbers -> tabs.selectTab(tabs.getTabAt(1)) UiStateEnum.TabAdvanced -> tabs.selectTab(tabs.getTabAt(2)) } + + it.recreate() } robolectricScreenshotRule diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png index fbf9a5c7..2831f3df 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png index ba3d0a41..2831f3df 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png index 5d6ed253..2831f3df 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png index 9913ccda..4636f61a 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png index e59cf3d5..4636f61a 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png index 8eefb986..4636f61a 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png index c3e4a6ad..50507149 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png index e3161d31..50507149 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png index 441f270d..50507149 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png index 621b726a..dcb3187c 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png index 9f01c8d4..dcb3187c 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png index 6a0a8973..dcb3187c 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png index f39611dd..eff0d09c 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png index 32d6f9c1..eff0d09c 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png index 9c7adf86..eff0d09c 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png index d466b0ae..cde4928e 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png index 165c0f62..b843ba38 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png index 76c79388..cde4928e 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png index 324e9ee3..d05add6b 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png index 8e18c660..d05add6b 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png index d02301ce..d05add6b 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png index 15103698..ce46568e 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png index d9d38f27..ce46568e 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png index f7943218..ce46568e 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png index ecefa46f..57dd6765 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png index cd71c118..57dd6765 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png index ab741857..57dd6765 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png index 19cca2c0..a5d19c0f 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png index 562a2c69..a5d19c0f 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png differ diff --git a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png index 9f6140f3..a5d19c0f 100644 Binary files a/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png and b/gauguin-app/src/test/resources/org/piepmeyer/gauguin/ui/newgame/NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png differ diff --git a/gauguin-core/src/main/kotlin/org/piepmeyer/gauguin/calculation/GridPreviewCalculationService.kt b/gauguin-core/src/main/kotlin/org/piepmeyer/gauguin/calculation/GridPreviewCalculationService.kt index f70abd9e..43e5e474 100644 --- a/gauguin-core/src/main/kotlin/org/piepmeyer/gauguin/calculation/GridPreviewCalculationService.kt +++ b/gauguin-core/src/main/kotlin/org/piepmeyer/gauguin/calculation/GridPreviewCalculationService.kt @@ -19,11 +19,11 @@ import java.util.WeakHashMap private val logger = KotlinLogging.logger {} -class GridPreviewCalculationService( +open class GridPreviewCalculationService( private val dispatcher: CoroutineDispatcher = Dispatchers.Default, ) { private val grids: MutableMap = WeakHashMap() - private var listeners = mutableListOf() + var listeners = mutableListOf() private var lastVariant: GameVariant? = null private var lastGridCalculation: Deferred? = null @@ -35,7 +35,7 @@ class GridPreviewCalculationService( listeners.forEach { it.previewGridCreated(grid, false) } } - fun calculateGrid( + open fun calculateGrid( variant: GameVariant, scope: CoroutineScope, ) {