abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Config.java
diff options
context:
space:
mode:
authorTadaCZE2024-07-06 20:32:01 +0000
committerGitHub2024-07-06 22:32:01 +0200
commitcd0f61da744f38f90aa942d08d038e09b6d32b79 (patch)
treec66adf2ee0f9f5e36682672a24e85924713e96f5 /srcs/juloo.keyboard2/Config.java
parentce57b5a4a2dfa78c90cc1fb4c6ccc2b513431d1e (diff)
downloadunexpected-keyboard-cd0f61da744f38f90aa942d08d038e09b6d32b79.tar.gz
unexpected-keyboard-cd0f61da744f38f90aa942d08d038e09b6d32b79.zip
Add support for Android 12+ dynamic colors (#647)
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
-rw-r--r--srcs/juloo.keyboard2/Config.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index 061183c..2afe5ef 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -405,6 +405,7 @@ public final class Config
private int getThemeId(Resources res, String theme_name)
{
+ int night_mode = res.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
switch (theme_name)
{
case "light": return R.style.Light;
@@ -415,9 +416,14 @@ public final class Config
case "epaper": return R.style.ePaper;
case "desert": return R.style.Desert;
case "jungle": return R.style.Jungle;
+ case "monetlight": return R.style.MonetLight;
+ case "monetdark": return R.style.MonetDark;
+ case "monet":
+ if ((night_mode & Configuration.UI_MODE_NIGHT_NO) != 0)
+ return R.style.MonetLight;
+ return R.style.MonetDark;
default:
case "system":
- int night_mode = res.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
if ((night_mode & Configuration.UI_MODE_NIGHT_NO) != 0)
return R.style.Light;
return R.style.Dark;