diff --git a/views/src/main/java/insets/SystemBarProtectionSnippet.kt b/views/src/main/java/insets/SystemBarProtectionSnippet.kt index d4774fd2f..bd44cd4c9 100644 --- a/views/src/main/java/insets/SystemBarProtectionSnippet.kt +++ b/views/src/main/java/insets/SystemBarProtectionSnippet.kt @@ -51,18 +51,18 @@ class SystemBarProtectionSnippet : AppCompatActivity() { insets } - // [START android_system_bar_protection_kotlin] val red = 52 val green = 168 val blue = 83 + val paneBackgroundColor = Color.rgb(red, green, blue) + // [START android_system_bar_protection_kotlin] findViewById(R.id.list_protection) .setProtections( listOf( GradientProtection( WindowInsetsCompat.Side.TOP, // Ideally, this is the pane's background color - // alpha = 204 for an 80% gradient - Color.argb(204, red, green, blue) + paneBackgroundColor ) ) )