From d71383c2888b6ea1e3d8ec06b4059def30a7918d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Wed, 10 Apr 2024 12:26:36 +0200 Subject: [PATCH] Add niaEdgeToEdge trace tag Change-Id: I8012c8b4544abc9488f96f6f01822fb15bb0775a --- .../samples/apps/nowinandroid/MainActivity.kt | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) 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(