From b06e4d6553d28440950344b5e5d2f52aeef9f061 Mon Sep 17 00:00:00 2001 From: meikpiep Date: Thu, 3 Oct 2024 14:24:09 +0200 Subject: [PATCH] wip --- .../gauguin/ui/LoadGameListActivity.kt | 5 +- .../org/piepmeyer/gauguin/ui/grid/GridUI.kt | 8 +-- .../gauguin/ui/newgame/NewGameActivity.kt | 1 + .../ui/statistics/StatisticsActivity.kt | 1 + .../src/main/res/values-night/styles.xml | 2 + .../src/main/res/values-night/themes.xml | 2 + gauguin-app/src/main/res/values/attrs.xml | 2 + gauguin-app/src/main/res/values/colors.xml | 55 +++++++++++-------- gauguin-app/src/main/res/values/styles.xml | 4 +- gauguin-app/src/main/res/values/themes.xml | 18 +++--- 10 files changed, 59 insertions(+), 39 deletions(-) diff --git a/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/LoadGameListActivity.kt b/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/LoadGameListActivity.kt index ea28f081..4f7a14ca 100644 --- a/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/LoadGameListActivity.kt +++ b/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/LoadGameListActivity.kt @@ -29,6 +29,8 @@ class LoadGameListActivity : AppCompatActivity() { setContentView(R.layout.activity_savegame) val recyclerView = findViewById(android.R.id.list) + + activityUtils.configureNightMode(this) activityUtils.configureFullscreen(this) empty = findViewById(android.R.id.empty) @@ -110,8 +112,7 @@ class LoadGameListActivity : AppCompatActivity() { deleteSaveGame( filename, ) - } - .show() + }.show() } private fun deleteAllGamesDialog() { diff --git a/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/grid/GridUI.kt b/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/grid/GridUI.kt index f9a9041d..0224ece4 100644 --- a/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/grid/GridUI.kt +++ b/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/grid/GridUI.kt @@ -7,7 +7,6 @@ import android.util.AttributeSet import android.view.MotionEvent import android.view.View import android.view.View.OnTouchListener -import com.google.android.material.color.MaterialColors import org.koin.core.component.KoinComponent import org.piepmeyer.gauguin.R import org.piepmeyer.gauguin.grid.Grid @@ -35,7 +34,7 @@ class GridUI : var cellShape = CellShape.Square var isSelectorShown = false - private var backgroundColor = 0 + override var grid = Grid( GameVariant( @@ -49,7 +48,7 @@ class GridUI : updatePadding() } - private val paintHolder = GridPaintHolder(this, context) + private var paintHolder = GridPaintHolder(this, context) var isPreviewMode = false private var previewStillCalculating = false private var maximumCellSizeInDP = gridUiInjectionStrategy.maximumCellSizeInDP() @@ -79,7 +78,8 @@ class GridUI : } fun updateTheme() { - backgroundColor = MaterialColors.getColor(this, com.google.android.material.R.attr.colorSurface) + paintHolder = GridPaintHolder(this, context) + rebuildCellsFromGrid() this.invalidate() } diff --git a/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/newgame/NewGameActivity.kt b/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/newgame/NewGameActivity.kt index d0f5cb32..04060e34 100644 --- a/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/newgame/NewGameActivity.kt +++ b/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/newgame/NewGameActivity.kt @@ -38,6 +38,7 @@ class NewGameActivity : val binding = ActivityNewgameBinding.inflate(layoutInflater) setContentView(binding.root) + activityUtils.configureNightMode(this) activityUtils.configureFullscreen(this) val startNewGameButton = binding.startnewgame diff --git a/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/statistics/StatisticsActivity.kt b/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/statistics/StatisticsActivity.kt index 799ff2e5..dc5f6933 100644 --- a/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/statistics/StatisticsActivity.kt +++ b/gauguin-app/src/main/kotlin/org/piepmeyer/gauguin/ui/statistics/StatisticsActivity.kt @@ -43,6 +43,7 @@ class StatisticsActivity : AppCompatActivity() { resetStatisticsDialog() } + activityUtils.configureNightMode(this) activityUtils.configureFullscreen(this) scatterPlotDiagramFragment = StatisticsScatterPlotDiagramFragment() diff --git a/gauguin-app/src/main/res/values-night/styles.xml b/gauguin-app/src/main/res/values-night/styles.xml index 3634b64d..b6ca481b 100644 --- a/gauguin-app/src/main/res/values-night/styles.xml +++ b/gauguin-app/src/main/res/values-night/styles.xml @@ -17,6 +17,8 @@ diff --git a/gauguin-app/src/main/res/values-night/themes.xml b/gauguin-app/src/main/res/values-night/themes.xml index 5f4367b7..ece28090 100644 --- a/gauguin-app/src/main/res/values-night/themes.xml +++ b/gauguin-app/src/main/res/values-night/themes.xml @@ -37,6 +37,8 @@ #ffdad8 false @color/md_theme_dark_inversePrimary + @color/md_theme_light_onSecondary + @color/md_theme_light_secondary @color/md_theme_dark_onTertiaryContainer @color/md_theme_dark_tertiaryContainer @color/md_theme_light_onPrimaryContainer diff --git a/gauguin-app/src/main/res/values/attrs.xml b/gauguin-app/src/main/res/values/attrs.xml index b8f9f2b7..781b5a94 100644 --- a/gauguin-app/src/main/res/values/attrs.xml +++ b/gauguin-app/src/main/res/values/attrs.xml @@ -16,6 +16,8 @@ + + diff --git a/gauguin-app/src/main/res/values/colors.xml b/gauguin-app/src/main/res/values/colors.xml index 1c656fbd..e6cd9db1 100644 --- a/gauguin-app/src/main/res/values/colors.xml +++ b/gauguin-app/src/main/res/values/colors.xml @@ -61,36 +61,43 @@ #AFD439 #46483C #000000 - #888888 - #EEEEEE - #3C4D00 - #CAF154 - #A6C8FF - #00315F - #004786 - #D5E3FF - #FFB599 - #5A1C00 - #7F2B00 - #FFDBCE + #c7c7c7 + #313131 + #474747 + #e3e3e3 + #c5c5c5 + #2f2f2f + #454545 + #e2e2e2 + #c7c7c7 + #313131 + #484848 + #e3e3e3 #FFB4AB #93000A #690005 #FFDAD6 - #1B1C17 - #E4E3DB - #1B1C17 - #E4E3DB - #46483C - #C6C8B8 - #909284 - #1B1C17 - #E4E3DB - #506600 + #1b1b1b + #e3e3e3 + #1b1b1b + #e3e3e3 + #474747 + #c7c7c7 + #919191 + #1b1b1b + #e3e3e3 + #5e5e5e #000000 - #AFD439 - #46483C + #c7c7c7 + #474747 #000000 + #c7c7c7 + #313131 + #313131 + #c7c7c7 + #e0e0e0 + #222222 + #d0d0d0 #EECE50 #E17976 #00000000 diff --git a/gauguin-app/src/main/res/values/styles.xml b/gauguin-app/src/main/res/values/styles.xml index 111366a3..4aa4e24e 100644 --- a/gauguin-app/src/main/res/values/styles.xml +++ b/gauguin-app/src/main/res/values/styles.xml @@ -74,8 +74,8 @@ diff --git a/gauguin-app/src/main/res/values/themes.xml b/gauguin-app/src/main/res/values/themes.xml index 5274f7a3..fcd20699 100644 --- a/gauguin-app/src/main/res/values/themes.xml +++ b/gauguin-app/src/main/res/values/themes.xml @@ -46,6 +46,8 @@ #410006 false @color/md_theme_light_inversePrimary + @color/md_theme_light_onSecondary + @color/md_theme_light_secondary @color/md_theme_light_onTertiary @color/md_theme_light_tertiary @color/md_theme_light_onPrimaryContainer @@ -103,15 +105,17 @@ #410006 false @color/md_theme_monochrome_inversePrimary + @color/md_theme_monochrome_secondary + @color/md_theme_monochrome_onSecondary @color/md_theme_monochrome_onTertiary @color/md_theme_monochrome_tertiary - @color/md_theme_monochrome_onPrimaryContainer - @color/md_theme_monochrome_primaryContainer - #221b00 - #ffe171 - @color/md_theme_monochrome_secondary - @color/md_theme_monochrome_onSecondary - #512f36 + @color/md_theme_monochrome_popup_onSuccess + @color/md_theme_monochrome_popup_success + @color/md_theme_monochrome_popup_onError + @color/md_theme_monochrome_popup_error + @color/md_theme_monochrome_grid_selected + @color/md_theme_monochrome_grid_selected_text + @color/md_theme_monochrome_grid_cage