Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
meikpiep committed Oct 3, 2024
1 parent f6495fd commit b06e4d6
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class LoadGameListActivity : AppCompatActivity() {
setContentView(R.layout.activity_savegame)

val recyclerView = findViewById<RecyclerView>(android.R.id.list)

activityUtils.configureNightMode(this)
activityUtils.configureFullscreen(this)

empty = findViewById(android.R.id.empty)
Expand Down Expand Up @@ -110,8 +112,7 @@ class LoadGameListActivity : AppCompatActivity() {
deleteSaveGame(
filename,
)
}
.show()
}.show()
}

private fun deleteAllGamesDialog() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -35,7 +34,7 @@ class GridUI :
var cellShape = CellShape.Square

var isSelectorShown = false
private var backgroundColor = 0

override var grid =
Grid(
GameVariant(
Expand All @@ -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()
Expand Down Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class NewGameActivity :
val binding = ActivityNewgameBinding.inflate(layoutInflater)
setContentView(binding.root)

activityUtils.configureNightMode(this)
activityUtils.configureFullscreen(this)

val startNewGameButton = binding.startnewgame
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class StatisticsActivity : AppCompatActivity() {
resetStatisticsDialog()
}

activityUtils.configureNightMode(this)
activityUtils.configureFullscreen(this)

scatterPlotDiagramFragment = StatisticsScatterPlotDiagramFragment()
Expand Down
2 changes: 2 additions & 0 deletions gauguin-app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
</style>

<style name="MainFab" parent="Widget.Material3.FloatingActionButton.Secondary">
<item name="tint">?attr/colorMainFabForeground</item>
<item name="android:backgroundTint">?attr/colorMainFabBackground</item>
<item name="srcCompat">@drawable/baseline_question_mark_24</item>
</style>

Expand Down
2 changes: 2 additions & 0 deletions gauguin-app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<item name="colorOnCustomColor2Container">#ffdad8</item>
<item name="harmonizeCustomColor2">false</item>
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary</item>
<item name="colorMainFabForeground">@color/md_theme_light_onSecondary</item>
<item name="colorMainFabBackground">@color/md_theme_light_secondary</item>
<item name="colorMainTopPanelForeground">@color/md_theme_dark_onTertiaryContainer</item>
<item name="colorMainTopPanelBackground">@color/md_theme_dark_tertiaryContainer</item>
<item name="colorMainHintPopupSuccessForeground">@color/md_theme_light_onPrimaryContainer</item>
Expand Down
2 changes: 2 additions & 0 deletions gauguin-app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<attr name="colorMainHintPopupSuccessBackground" format="color" />
<attr name="colorMainHintPopupErrorsForeground" format="color" />
<attr name="colorMainHintPopupErrorsBackground" format="color" />
<attr name="colorMainFabForeground" format="color" />
<attr name="colorMainFabBackground" format="color" />
<attr name="colorGridSelected" format="color" />
<attr name="colorGridSelectedText" format="color" />
<attr name="colorGridCage" format="color" />
Expand Down
55 changes: 31 additions & 24 deletions gauguin-app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,36 +61,43 @@
<color name="md_theme_dark_surfaceTint">#AFD439</color>
<color name="md_theme_dark_outlineVariant">#46483C</color>
<color name="md_theme_dark_scrim">#000000</color>
<color name="md_theme_monochrome_primary">#888888</color><!--#AFD439 #283500-->
<color name="md_theme_monochrome_onPrimary">#EEEEEE</color>
<color name="md_theme_monochrome_primaryContainer">#3C4D00</color>
<color name="md_theme_monochrome_onPrimaryContainer">#CAF154</color>
<color name="md_theme_monochrome_secondary">#A6C8FF</color>
<color name="md_theme_monochrome_onSecondary">#00315F</color>
<color name="md_theme_monochrome_secondaryContainer">#004786</color>
<color name="md_theme_monochrome_onSecondaryContainer">#D5E3FF</color>
<color name="md_theme_monochrome_tertiary">#FFB599</color>
<color name="md_theme_monochrome_onTertiary">#5A1C00</color>
<color name="md_theme_monochrome_tertiaryContainer">#7F2B00</color>
<color name="md_theme_monochrome_onTertiaryContainer">#FFDBCE</color>
<color name="md_theme_monochrome_primary">#c7c7c7</color><!--#AFD439 #283500-->
<color name="md_theme_monochrome_onPrimary">#313131</color>
<color name="md_theme_monochrome_primaryContainer">#474747</color>
<color name="md_theme_monochrome_onPrimaryContainer">#e3e3e3</color>
<color name="md_theme_monochrome_secondary">#c5c5c5</color>
<color name="md_theme_monochrome_onSecondary">#2f2f2f</color>
<color name="md_theme_monochrome_secondaryContainer">#454545</color>
<color name="md_theme_monochrome_onSecondaryContainer">#e2e2e2</color>
<color name="md_theme_monochrome_tertiary">#c7c7c7</color>
<color name="md_theme_monochrome_onTertiary">#313131</color>
<color name="md_theme_monochrome_tertiaryContainer">#484848</color>
<color name="md_theme_monochrome_onTertiaryContainer">#e3e3e3</color>
<color name="md_theme_monochrome_error">#FFB4AB</color>
<color name="md_theme_monochrome_errorContainer">#93000A</color>
<color name="md_theme_monochrome_onError">#690005</color>
<color name="md_theme_monochrome_onErrorContainer">#FFDAD6</color>
<color name="md_theme_monochrome_background">#1B1C17</color>
<color name="md_theme_monochrome_onBackground">#E4E3DB</color>
<color name="md_theme_monochrome_surface">#1B1C17</color>
<color name="md_theme_monochrome_onSurface">#E4E3DB</color>
<color name="md_theme_monochrome_surfaceVariant">#46483C</color>
<color name="md_theme_monochrome_onSurfaceVariant">#C6C8B8</color>
<color name="md_theme_monochrome_outline">#909284</color>
<color name="md_theme_monochrome_inverseOnSurface">#1B1C17</color>
<color name="md_theme_monochrome_inverseSurface">#E4E3DB</color>
<color name="md_theme_monochrome_inversePrimary">#506600</color>
<color name="md_theme_monochrome_background">#1b1b1b</color>
<color name="md_theme_monochrome_onBackground">#e3e3e3</color>
<color name="md_theme_monochrome_surface">#1b1b1b</color>
<color name="md_theme_monochrome_onSurface">#e3e3e3</color>
<color name="md_theme_monochrome_surfaceVariant">#474747</color>
<color name="md_theme_monochrome_onSurfaceVariant">#c7c7c7</color>
<color name="md_theme_monochrome_outline">#919191</color>
<color name="md_theme_monochrome_inverseOnSurface">#1b1b1b</color>
<color name="md_theme_monochrome_inverseSurface">#e3e3e3</color>
<color name="md_theme_monochrome_inversePrimary">#5e5e5e</color>
<color name="md_theme_monochrome_shadow">#000000</color>
<color name="md_theme_monochrome_surfaceTint">#AFD439</color>
<color name="md_theme_monochrome_outlineVariant">#46483C</color>
<color name="md_theme_monochrome_surfaceTint">#c7c7c7</color>
<color name="md_theme_monochrome_outlineVariant">#474747</color>
<color name="md_theme_monochrome_scrim">#000000</color>
<color name="md_theme_monochrome_popup_success">#c7c7c7</color>
<color name="md_theme_monochrome_popup_onSuccess">#313131</color>
<color name="md_theme_monochrome_popup_error">#313131</color>
<color name="md_theme_monochrome_popup_onError">#c7c7c7</color>
<color name="md_theme_monochrome_grid_selected">#e0e0e0</color>
<color name="md_theme_monochrome_grid_selected_text">#222222</color>
<color name="md_theme_monochrome_grid_cage">#d0d0d0</color>
<color name="CustomColor1">#EECE50</color>
<color name="CustomColor2">#E17976</color>
<color name="fwv_cabin_line_color">#00000000</color>
Expand Down
4 changes: 2 additions & 2 deletions gauguin-app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
</style>

<style name="MainFab" parent="Widget.Material3.FloatingActionButton.Secondary">
<item name="tint">@color/md_theme_light_onSecondary</item>
<item name="android:backgroundTint">@color/md_theme_light_secondary</item>
<item name="tint">?attr/colorMainFabForeground</item>
<item name="android:backgroundTint">?attr/colorMainFabBackground</item>
<item name="srcCompat">@drawable/baseline_question_mark_24</item>
</style>

Expand Down
18 changes: 11 additions & 7 deletions gauguin-app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
<item name="colorOnCustomColor2Container">#410006</item>
<item name="harmonizeCustomColor2">false</item>
<item name="colorPrimaryInverse">@color/md_theme_light_inversePrimary</item>
<item name="colorMainFabForeground">@color/md_theme_light_onSecondary</item>
<item name="colorMainFabBackground">@color/md_theme_light_secondary</item>
<item name="colorMainTopPanelForeground">@color/md_theme_light_onTertiary</item>
<item name="colorMainTopPanelBackground">@color/md_theme_light_tertiary</item>
<item name="colorMainHintPopupSuccessForeground">@color/md_theme_light_onPrimaryContainer</item>
Expand Down Expand Up @@ -103,15 +105,17 @@
<item name="colorOnCustomColor2Container">#410006</item>
<item name="harmonizeCustomColor2">false</item>
<item name="colorPrimaryInverse">@color/md_theme_monochrome_inversePrimary</item>
<item name="colorMainFabForeground">@color/md_theme_monochrome_secondary</item>
<item name="colorMainFabBackground">@color/md_theme_monochrome_onSecondary</item>
<item name="colorMainTopPanelForeground">@color/md_theme_monochrome_onTertiary</item>
<item name="colorMainTopPanelBackground">@color/md_theme_monochrome_tertiary</item>
<item name="colorMainHintPopupSuccessForeground">@color/md_theme_monochrome_onPrimaryContainer</item>
<item name="colorMainHintPopupSuccessBackground">@color/md_theme_monochrome_primaryContainer</item>
<item name="colorMainHintPopupErrorsForeground">#221b00</item>
<item name="colorMainHintPopupErrorsBackground">#ffe171</item>
<item name="colorGridSelected">@color/md_theme_monochrome_secondary</item>
<item name="colorGridSelectedText">@color/md_theme_monochrome_onSecondary</item>
<item name="colorGridCage">#512f36</item>
<item name="colorMainHintPopupSuccessForeground">@color/md_theme_monochrome_popup_onSuccess</item>
<item name="colorMainHintPopupSuccessBackground">@color/md_theme_monochrome_popup_success</item>
<item name="colorMainHintPopupErrorsForeground">@color/md_theme_monochrome_popup_onError</item>
<item name="colorMainHintPopupErrorsBackground">@color/md_theme_monochrome_popup_error</item>
<item name="colorGridSelected">@color/md_theme_monochrome_grid_selected</item>
<item name="colorGridSelectedText">@color/md_theme_monochrome_grid_selected_text</item>
<item name="colorGridCage">@color/md_theme_monochrome_grid_cage</item>

</style>
</resources>

0 comments on commit b06e4d6

Please sign in to comment.