Small improvement

pull/199/head
M66B 3 years ago
parent de843ba57c
commit b6fc9a02d2

@ -1081,7 +1081,7 @@ public class Helper {
// https://developer.android.com/guide/topics/ui/look-and-feel/darktheme#configuration_changes
int uiMode = context.getResources().getConfiguration().uiMode;
Log.i("UI mode=0x" + Integer.toHexString(uiMode));
return ((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0);
return ((uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES);
}
static boolean isDarkTheme(Context context) {

@ -1695,9 +1695,7 @@ public class Log {
int uiMode = context.getResources().getConfiguration().uiMode;
sb.append(String.format("UI mode: 0x"))
.append(Integer.toHexString(uiMode))
.append(" night")
.append(" no=").append((uiMode & Configuration.UI_MODE_NIGHT_NO) != 0)
.append(" yes=").append((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0)
.append(" night=").append(Helper.isNight(context))
.append("\r\n");
sb.append("Transliterate: ")

Loading…
Cancel
Save