Skip to content

Commit f51c3a6

Browse files
committed
Use R.bool.debug_show_grid to decide whether or not to display the 8dp grid
1 parent b412b0a commit f51c3a6

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

app/src/debug/res/values/bools.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
Copyright (c) 2021 Olivier Patry
3+
4+
Permission is hereby granted, free of charge, to any person obtaining
5+
a copy of this software and associated documentation files (the "Software"),
6+
to deal in the Software without restriction, including without limitation
7+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
and/or sell copies of the Software, and to permit persons to whom the Software
9+
is furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20+
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
-->
22+
23+
<resources>
24+
<bool name="debug_show_grid">true</bool>
25+
</resources>

app/src/main/java/net/opatry/speedrun/emea/MainActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import androidx.compose.runtime.remember
3333
import androidx.compose.ui.Modifier
3434
import androidx.compose.ui.geometry.Offset
3535
import androidx.compose.ui.graphics.Color
36+
import androidx.compose.ui.res.booleanResource
3637
import androidx.compose.ui.unit.dp
3738
import androidx.core.view.WindowCompat
3839
import dev.chrisbanes.accompanist.insets.ProvideWindowInsets
@@ -76,7 +77,7 @@ fun MySootheApp() {
7677
}
7778
AppState.Home -> HomeScreen()
7879
}
79-
val showGrid = true // TODO booleanResource(id = R.bool.is_debug)
80+
val showGrid = booleanResource(R.bool.debug_show_grid)
8081
if (showGrid) {
8182
GridLayer()
8283
}

app/src/main/res/values/bools.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@
2222

2323
<resources>
2424
<bool name="light_status_bar">true</bool>
25+
<bool name="debug_show_grid">false</bool>
2526
</resources>

0 commit comments

Comments
 (0)