Skip to content

Commit 9f954a2

Browse files
[1.0.5] Implemented support for edge-to-edge enforcement;
1 parent 2c0203d commit 9f954a2

File tree

2 files changed

+11
-8
lines changed
  • app/src/main/java/xyz/teamgravity/timerflowdemo
  • timer-flow/src/main/java/xyz/teamgravity/timer_flow

2 files changed

+11
-8
lines changed

app/src/main/java/xyz/teamgravity/timerflowdemo/MainActivity.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ import androidx.activity.enableEdgeToEdge
77
import androidx.compose.animation.core.animateFloatAsState
88
import androidx.compose.foundation.layout.Arrangement
99
import androidx.compose.foundation.layout.Column
10+
import androidx.compose.foundation.layout.WindowInsets
1011
import androidx.compose.foundation.layout.fillMaxSize
1112
import androidx.compose.foundation.layout.fillMaxWidth
13+
import androidx.compose.foundation.layout.padding
14+
import androidx.compose.foundation.layout.safeDrawing
1215
import androidx.compose.material3.LinearProgressIndicator
13-
import androidx.compose.material3.MaterialTheme
1416
import androidx.compose.material3.ProgressIndicatorDefaults
15-
import androidx.compose.material3.Surface
17+
import androidx.compose.material3.Scaffold
1618
import androidx.compose.material3.Text
1719
import androidx.compose.runtime.derivedStateOf
1820
import androidx.compose.runtime.getValue
@@ -31,10 +33,9 @@ class MainActivity : ComponentActivity() {
3133
enableEdgeToEdge()
3234
setContent {
3335
TimerFlowDemoTheme {
34-
Surface(
35-
modifier = Modifier.fillMaxSize(),
36-
color = MaterialTheme.colorScheme.background
37-
) {
36+
Scaffold(
37+
contentWindowInsets = WindowInsets.safeDrawing
38+
) { padding ->
3839
val timer = remember {
3940
Timer().apply {
4041
timerDuration = 6_000L
@@ -55,7 +56,9 @@ class MainActivity : ComponentActivity() {
5556
space = 16.dp,
5657
alignment = Alignment.CenterVertically
5758
),
58-
modifier = Modifier.fillMaxSize()
59+
modifier = Modifier
60+
.fillMaxSize()
61+
.padding(padding)
5962
) {
6063
Text(
6164
text = time.toString()

timer-flow/src/main/java/xyz/teamgravity/timer_flow/Timer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class Timer {
139139
}
140140

141141
///////////////////////////////////////////////////////////////////////////
142-
// MISC
142+
// Misc
143143
///////////////////////////////////////////////////////////////////////////
144144

145145
enum class TimerState {

0 commit comments

Comments
 (0)