-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
114 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ApplicationModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.piepmeyer.gauguin | ||
|
||
import android.content.SharedPreferences | ||
import org.koin.core.module.Module | ||
import org.koin.core.module.dsl.binds | ||
import org.koin.core.module.dsl.createdAtStart | ||
import org.koin.core.module.dsl.withOptions | ||
import org.piepmeyer.gauguin.preferences.ApplicationPreferences | ||
import org.piepmeyer.gauguin.preferences.ApplicationPreferencesImpl | ||
import org.piepmeyer.gauguin.preferences.StatisticsManager | ||
import org.piepmeyer.gauguin.preferences.StatisticsManagerImpl | ||
import org.piepmeyer.gauguin.ui.ActivityUtils | ||
import java.io.File | ||
|
||
class ApplicationModule( | ||
private val filesDir: File, | ||
private val statisticsPreferences: SharedPreferences, | ||
private val applicationPreferences: ApplicationPreferencesImpl, | ||
) { | ||
fun module(): Module = | ||
org.koin.dsl.module { | ||
single { | ||
applicationPreferences | ||
} withOptions { binds(listOf(ApplicationPreferences::class)) } | ||
single { | ||
StatisticsManagerImpl( | ||
filesDir, | ||
statisticsPreferences, | ||
) | ||
} withOptions { | ||
binds(listOf(StatisticsManager::class)) | ||
createdAtStart() | ||
} | ||
single { ActivityUtils() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/InstrumentationTestRunner.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.piepmeyer.gauguin | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import androidx.test.runner.AndroidJUnitRunner | ||
|
||
class InstrumentationTestRunner : AndroidJUnitRunner() { | ||
override fun newApplication( | ||
classLoader: ClassLoader?, | ||
className: String?, | ||
context: Context?, | ||
): Application = super.newApplication(classLoader, TestApplication::class.java.name, context) | ||
} |
26 changes: 26 additions & 0 deletions
26
gauguin-app/src/test/kotlin/org/piepmeyer/gauguin/TestApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.piepmeyer.gauguin | ||
|
||
import android.app.Application | ||
import io.mockk.every | ||
import io.mockk.mockk | ||
import org.koin.core.context.startKoin | ||
import org.piepmeyer.gauguin.preferences.ApplicationPreferencesImpl | ||
import kotlin.io.path.createTempDirectory | ||
|
||
class TestApplication : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
val mockedPreferences = | ||
mockk<ApplicationPreferencesImpl> { | ||
every { theme } returns Theme.LIGHT | ||
} | ||
|
||
startKoin { | ||
modules( | ||
CoreModule(createTempDirectory().toFile()).module(), | ||
ApplicationModule(createTempDirectory().toFile(), mockk(), mockedPreferences).module(), | ||
) | ||
} | ||
} | ||
} |
Binary file modified
BIN
-1.05 KB
(98%)
...eActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-837 Bytes
(99%)
...GameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-926 Bytes
(99%)
...meActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1006 Bytes
(99%)
...meActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-786 Bytes
(99%)
...wGameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-876 Bytes
(99%)
...ameActivityScreenshotTest_LARGE_DESKTOP_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.72 KB
(98%)
...eActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.28 KB
(98%)
...GameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.16 KB
(99%)
...meActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.96 KB
(98%)
...meActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.67 KB
(98%)
...wGameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.21 KB
(98%)
...ameActivityScreenshotTest_MEDIUM_TABLET_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-486 Bytes
(99%)
...wGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-236 Bytes
(99%)
.../NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-205 Bytes
(100%)
...ewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-215 Bytes
(99%)
...ewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+105 Bytes
(100%)
...e/NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-68 Bytes
(100%)
...NewGameActivityScreenshotTest_NEXUS_ONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.61 KB
(98%)
...ewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.21 KB
(98%)
...e/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.24 KB
(98%)
...NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 KB
(97%)
...NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.78 KB
(98%)
...me/NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.91 KB
(98%)
.../NewGameActivityScreenshotTest_PIXEL_4A_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.48 KB
(98%)
...ameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabAdvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.15 KB
(99%)
...ewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabBasic.png
Oops, something went wrong.
Binary file modified
BIN
-1.27 KB
(98%)
...GameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_LANDSCAPE_TabNumbers.png
Oops, something went wrong.
Binary file modified
BIN
-1.07 KB
(98%)
...GameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabAdvanced.png
Oops, something went wrong.
Binary file modified
BIN
-810 Bytes
(99%)
...NewGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabBasic.png
Oops, something went wrong.
Binary file modified
BIN
-896 Bytes
(99%)
...wGameActivityScreenshotTest_SMALL_PHONE_DAY_FONT_NORMAL_PORTRAIT_TabNumbers.png
Oops, something went wrong.
Binary file modified
BIN
+856 Bytes
(100%)
...tatisticsActivityScreenshotTest_LARGE_DESKTOP_DAY_PORTRAIT_FilledStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+79 Bytes
(100%)
...cs/StatisticsActivityScreenshotTest_LARGE_DESKTOP_DAY_PORTRAIT_NoStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+6.9 KB
(100%)
...tatisticsActivityScreenshotTest_MEDIUM_TABLET_DAY_PORTRAIT_FilledStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+247 Bytes
(100%)
...cs/StatisticsActivityScreenshotTest_MEDIUM_TABLET_DAY_PORTRAIT_NoStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+140 Bytes
(100%)
...cs/StatisticsActivityScreenshotTest_NEXUS_ONE_DAY_PORTRAIT_FilledStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+106 Bytes
(100%)
...istics/StatisticsActivityScreenshotTest_NEXUS_ONE_DAY_PORTRAIT_NoStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+876 Bytes
(100%)
...ics/StatisticsActivityScreenshotTest_PIXEL_4A_DAY_PORTRAIT_FilledStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+333 Bytes
(100%)
...tistics/StatisticsActivityScreenshotTest_PIXEL_4A_DAY_PORTRAIT_NoStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+848 Bytes
(100%)
.../StatisticsActivityScreenshotTest_SMALL_PHONE_DAY_PORTRAIT_FilledStatistics.png
Oops, something went wrong.
Binary file modified
BIN
+230 Bytes
(100%)
...tics/StatisticsActivityScreenshotTest_SMALL_PHONE_DAY_PORTRAIT_NoStatistics.png
Oops, something went wrong.