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 // https://developer.android.com/guide/topics/ui/look-and-feel/darktheme#configuration_changes
int uiMode = context.getResources().getConfiguration().uiMode; int uiMode = context.getResources().getConfiguration().uiMode;
Log.i("UI mode=0x" + Integer.toHexString(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) { static boolean isDarkTheme(Context context) {

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

Loading…
Cancel
Save