diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/MainActivity.kt b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/MainActivity.kt index ad95c297f..d73c4bd63 100644 --- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/MainActivity.kt +++ b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/MainActivity.kt @@ -37,6 +37,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import androidx.metrics.performance.JankStats +import androidx.tracing.trace import com.google.samples.apps.nowinandroid.MainActivityUiState.Loading import com.google.samples.apps.nowinandroid.MainActivityUiState.Success import com.google.samples.apps.nowinandroid.core.analytics.AnalyticsHelper @@ -110,7 +111,7 @@ class MainActivity : ComponentActivity() { // Turn off the decor fitting system windows, which allows us to handle insets, // including IME animations, and go edge-to-edge // This also sets up the initial system bar style based on the platform theme - enableEdgeToEdge() + trace("niaEdgeToEdge") { enableEdgeToEdge() } setContent { val darkTheme = shouldUseDarkTheme(uiState) @@ -120,17 +121,19 @@ class MainActivity : ComponentActivity() { // resolve whether or not to show dark theme using uiState, since it can be different // than the configuration's dark theme value based on the user preference. DisposableEffect(darkTheme) { - enableEdgeToEdge( - statusBarStyle = SystemBarStyle.auto( - android.graphics.Color.TRANSPARENT, - android.graphics.Color.TRANSPARENT, - ) { darkTheme }, - navigationBarStyle = SystemBarStyle.auto( - lightScrim, - darkScrim, - ) { darkTheme }, - ) - onDispose {} + trace("niaEdgeToEdge") { + enableEdgeToEdge( + statusBarStyle = SystemBarStyle.auto( + android.graphics.Color.TRANSPARENT, + android.graphics.Color.TRANSPARENT, + ) { darkTheme }, + navigationBarStyle = SystemBarStyle.auto( + lightScrim, + darkScrim, + ) { darkTheme }, + ) + onDispose {} + } } val appState = rememberNiaAppState(