Skip to content

Commit b198bf0

Browse files
authored
Update android_system_bar_protection_kotlin to change alpha (#544)
* Update android_system_bar_protection_kotlin to change alpha * show less code in DAC * use Color.rgb instead
1 parent f34038d commit b198bf0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

views/src/main/java/insets/SystemBarProtectionSnippet.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ class SystemBarProtectionSnippet : AppCompatActivity() {
5151
insets
5252
}
5353

54-
// [START android_system_bar_protection_kotlin]
5554
val red = 52
5655
val green = 168
5756
val blue = 83
57+
val paneBackgroundColor = Color.rgb(red, green, blue)
58+
// [START android_system_bar_protection_kotlin]
5859
findViewById<ProtectionLayout>(R.id.list_protection)
5960
.setProtections(
6061
listOf(
6162
GradientProtection(
6263
WindowInsetsCompat.Side.TOP,
6364
// Ideally, this is the pane's background color
64-
// alpha = 204 for an 80% gradient
65-
Color.argb(204, red, green, blue)
65+
paneBackgroundColor
6666
)
6767
)
6868
)

0 commit comments

Comments
 (0)