From cd0f61da744f38f90aa942d08d038e09b6d32b79 Mon Sep 17 00:00:00 2001
From: TadaCZE <33400123+TadaCZE@users.noreply.github.com>
Date: Sat, 6 Jul 2024 20:32:01 +0000
Subject: [PATCH] Add support for Android 12+ dynamic colors (#647)
---
res/values-cs/strings.xml | 3 +++
res/values-de/strings.xml | 3 +++
res/values-es/strings.xml | 3 +++
res/values-fa/strings.xml | 3 +++
res/values-fr/strings.xml | 3 +++
res/values-it/strings.xml | 3 +++
res/values-ko/strings.xml | 3 +++
res/values-lv/strings.xml | 3 +++
res/values-pl/strings.xml | 3 +++
res/values-pt/strings.xml | 3 +++
res/values-ro/strings.xml | 3 +++
res/values-ru/strings.xml | 3 +++
res/values-tr/strings.xml | 3 +++
res/values-uk/strings.xml | 3 +++
res/values-vi/strings.xml | 3 +++
res/values-zh-rCN/strings.xml | 3 +++
res/values/arrays.xml | 6 ++++++
res/values/strings.xml | 3 +++
res/values/themes.xml | 24 ++++++++++++++++++++++++
srcs/juloo.keyboard2/Config.java | 8 +++++++-
20 files changed, 88 insertions(+), 1 deletion(-)
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 4e7c785..8e2c122 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -68,6 +68,9 @@ Tato aplikace neobsahuje žádné reklamy, nevyužívá připojení k síti a je
ePapír
Poušťě
Džungle
+
+
+
Velmi krátká
Krátká
Běžná
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 890d8af..08dbafa 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -68,6 +68,9 @@ Diese App enthält keine Werbung, benötigt keinen Netzwerkzugriff und ist quell
ePaper
Wüste
Dschungel
+
+
+
Sehr kurz
Kurz
Normal
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index dc8578f..a82feaa 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -68,6 +68,9 @@ La misma no contiene ningún anuncio/publicidad, no realiza peticiones de red y
ePaper
Desierto
Selva
+
+
+
Muy corta
Corta
Normal
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index 46e9310..f61c4ac 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -68,6 +68,9 @@ This application contains no ads, doesn't make any network requests and is Open
ای-پیپر
+
+
+
بسیار کوتاه
کوتاه
عادی
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 93d7ff0..0d348c9 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -68,6 +68,9 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est
ePaper
Desert
Jungle
+
+
+
Très courte
Courte
Normale
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 0d58124..43c2184 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -68,6 +68,9 @@ This application contains no ads, doesn't make any network requests and is Open
+
+
+
Veramente breve
Breve
Normale
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index c2036f2..3e70996 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -68,6 +68,9 @@ This application contains no ads, doesn't make any network requests and is Open
+
+
+
매우 짧음
짧음
보통
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index db6eded..a9693bc 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -68,6 +68,9 @@ Tagad lieliski piemērota izmantošanai ikdienā.
ePapīrs
Tuksnesis
Džungļi
+
+
+
Ļoti tuvs
Tuvs
Vidējs
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index dff1b05..b1e4bec 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -68,6 +68,9 @@ Aplikacja nie zawiera reklam, nie żąda dostępu do internetu, a jej kod źród
e-paper
Pustynny
Dżunglowy
+
+
+
Bardzo mała
Mała
Normalna
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 651eb0b..60a584b 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -68,6 +68,9 @@ Este aplicativo não contém anúncios, não faz nenhuma solicitação de rede e
Papel Eletrônico
Deserto
Selva
+
+
+
Bem curto
Curto
Normal
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 13086c5..0ba2e21 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -68,6 +68,9 @@ Această aplicație nu conține publicitate, nu folosește rețeaua deloc și e
ePaper
+
+
+
Foarte apropiată
Apropiată
Normală
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 982dcb3..6c38443 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -68,6 +68,9 @@
Электронная бумага
Пустыня
Джунгли
+
+
+
Очень короткая
Короткая
Обычная
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index ce8c205..ebf5ab6 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -68,6 +68,9 @@ Bu uygulama açık kaynaklıdır. Reklam içermez ve internete bağlanmaz."E-Kağıt
Çöl
Orman
+
+
+
Çok kısa
Kısa
Normal
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index 0f7e81f..6a027ad 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -68,6 +68,9 @@
ePaper
Пустеля
Джунглі
+
+
+
Дуже коротка
Коротка
Звичайна
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index a97068a..5e6c724 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -68,6 +68,9 @@ Bây giờ đã hoàn hảo cho việc sử dụng hàng ngày.
ePaper
+
+
+
Rất gần
Gần
Trungbình
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 8809ff2..99aa7bd 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -68,6 +68,9 @@
白色带边框
沙漠
雨林
+
+
+
非常短
短
中(默认)
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 9176882..9fe5b38 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -28,6 +28,9 @@
- @string/pref_theme_e_epaper
- @string/pref_theme_e_desert
- @string/pref_theme_e_jungle
+ - @string/pref_theme_e_monet
+ - @string/pref_theme_e_monetlight
+ - @string/pref_theme_e_monetdark
- system
@@ -39,6 +42,9 @@
- epaper
- desert
- jungle
+ - monet
+ - monetlight
+ - monetdark
- @string/pref_swipe_dist_e_very_short
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 75df689..edd9a10 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -68,6 +68,9 @@ This application contains no ads, doesn't make any network requests and is Open
ePaper
Desert
Jungle
+ Monet (System)
+ Monet (Light)
+ Monet (Dark)
Very short
Short
Normal
diff --git a/res/values/themes.xml b/res/values/themes.xml
index aa30080..4aba4e3 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -179,4 +179,28 @@
- ?colorKeyActivated
- #000000
+
+
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;