diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt index 4b60f9b7b..c45cdf28a 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt @@ -380,10 +380,10 @@ object Utils { } fun getDarkModeStatus(context: Context): Boolean { - val mode = context.resources.configuration.uiMode and UI_MODE_NIGHT_MASK - return mode != UI_MODE_NIGHT_NO + return context.resources.configuration.uiMode and UI_MODE_NIGHT_MASK != UI_MODE_NIGHT_NO } + fun setNightMode(context: Context) { when (settingsStorage?.decodeString(AppConfig.PREF_UI_MODE_NIGHT, "0")) { "0" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)