📅  最后修改于: 2022-03-11 14:53:32.976000             🧑  作者: Mango
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 -> {}
}