Created
November 16, 2020 21:25
-
-
Save G00fY2/ce88eb2dc2ee68f25b4a292571321f97 to your computer and use it in GitHub Desktop.
Android DeviceDefault AccentColor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var accentColor = Color.WHITE | |
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) { | |
context.obtainStyledAttributes( | |
android.R.style.ThemeOverlay_DeviceDefault_Accent_DayNight, | |
intArrayOf(android.R.attr.colorAccent) | |
).also { | |
accentColor = it.getColor(0, accentColor) | |
}.recycle() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment