From cb20c1dcb16fe4a2fe6a7ac7ebbdc438503215f0 Mon Sep 17 00:00:00 2001 From: ashnohe Date: Thu, 12 Jun 2025 16:24:33 -0700 Subject: [PATCH 1/3] Update android_system_bar_protection_kotlin to change alpha --- views/src/main/java/insets/SystemBarProtectionSnippet.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/src/main/java/insets/SystemBarProtectionSnippet.kt b/views/src/main/java/insets/SystemBarProtectionSnippet.kt index d4774fd2f..26312278b 100644 --- a/views/src/main/java/insets/SystemBarProtectionSnippet.kt +++ b/views/src/main/java/insets/SystemBarProtectionSnippet.kt @@ -55,14 +55,14 @@ class SystemBarProtectionSnippet : AppCompatActivity() { val red = 52 val green = 168 val blue = 83 + val paneBackgroundColor = Color.argb(255, red, green, blue) 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 ) ) ) From bbe21edbc2a6835b685d2cbdaebea0112a6794d5 Mon Sep 17 00:00:00 2001 From: ashnohe Date: Thu, 12 Jun 2025 16:28:35 -0700 Subject: [PATCH 2/3] show less code in DAC --- views/src/main/java/insets/SystemBarProtectionSnippet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/src/main/java/insets/SystemBarProtectionSnippet.kt b/views/src/main/java/insets/SystemBarProtectionSnippet.kt index 26312278b..0dd2d2ffe 100644 --- a/views/src/main/java/insets/SystemBarProtectionSnippet.kt +++ b/views/src/main/java/insets/SystemBarProtectionSnippet.kt @@ -51,11 +51,11 @@ class SystemBarProtectionSnippet : AppCompatActivity() { insets } - // [START android_system_bar_protection_kotlin] val red = 52 val green = 168 val blue = 83 val paneBackgroundColor = Color.argb(255, red, green, blue) + // [START android_system_bar_protection_kotlin] findViewById(R.id.list_protection) .setProtections( listOf( From 13cfea7f38aad5ab82b848075da35aa483954a35 Mon Sep 17 00:00:00 2001 From: ashnohe Date: Thu, 12 Jun 2025 17:49:17 -0700 Subject: [PATCH 3/3] use Color.rgb instead --- views/src/main/java/insets/SystemBarProtectionSnippet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/src/main/java/insets/SystemBarProtectionSnippet.kt b/views/src/main/java/insets/SystemBarProtectionSnippet.kt index 0dd2d2ffe..bd44cd4c9 100644 --- a/views/src/main/java/insets/SystemBarProtectionSnippet.kt +++ b/views/src/main/java/insets/SystemBarProtectionSnippet.kt @@ -54,7 +54,7 @@ class SystemBarProtectionSnippet : AppCompatActivity() { val red = 52 val green = 168 val blue = 83 - val paneBackgroundColor = Color.argb(255, red, green, blue) + val paneBackgroundColor = Color.rgb(red, green, blue) // [START android_system_bar_protection_kotlin] findViewById(R.id.list_protection) .setProtections(