Answers for "kotlin detect dark mode"

1

kotlin detect dark mode

val mode = context?.resources?.configuration?.uiMode?.and(Configuration.UI_MODE_NIGHT_MASK)
    when (mode) {
        Configuration.UI_MODE_NIGHT_YES -> {}
        Configuration.UI_MODE_NIGHT_NO -> {}
        Configuration.UI_MODE_NIGHT_UNDEFINED -> {}
    }
Posted by: Guest on April-16-2020

Browse Popular Code Answers by Language