Add support for Android 12+ dynamic colors (#647)

This commit is contained in:
TadaCZE 2024-07-06 20:32:01 +00:00 committed by GitHub
parent ce57b5a4a2
commit cd0f61da74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 88 additions and 1 deletions

View File

@ -68,6 +68,9 @@ Tato aplikace neobsahuje žádné reklamy, nevyužívá připojení k síti a je
<string name="pref_theme_e_epaper">ePapír</string>
<string name="pref_theme_e_desert">Poušťě</string>
<string name="pref_theme_e_jungle">Džungle</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Velmi krátká</string>
<string name="pref_swipe_dist_e_short">Krátká</string>
<string name="pref_swipe_dist_e_default">Běžná</string>

View File

@ -68,6 +68,9 @@ Diese App enthält keine Werbung, benötigt keinen Netzwerkzugriff und ist quell
<string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_theme_e_desert">Wüste</string>
<string name="pref_theme_e_jungle">Dschungel</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Sehr kurz</string>
<string name="pref_swipe_dist_e_short">Kurz</string>
<string name="pref_swipe_dist_e_default">Normal</string>

View File

@ -68,6 +68,9 @@ La misma no contiene ningún anuncio/publicidad, no realiza peticiones de red y
<string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_theme_e_desert">Desierto</string>
<string name="pref_theme_e_jungle">Selva</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Muy corta</string>
<string name="pref_swipe_dist_e_short">Corta</string>
<string name="pref_swipe_dist_e_default">Normal</string>

View File

@ -68,6 +68,9 @@ This application contains no ads, doesn't make any network requests and is Open
<string name="pref_theme_e_epaper">ای-پیپر</string>
<!-- <string name="pref_theme_e_desert">Desert</string> -->
<!-- <string name="pref_theme_e_jungle">Jungle</string> -->
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">بسیار کوتاه</string>
<string name="pref_swipe_dist_e_short">کوتاه</string>
<string name="pref_swipe_dist_e_default">عادی</string>

View File

@ -68,6 +68,9 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est
<string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_theme_e_desert">Desert</string>
<string name="pref_theme_e_jungle">Jungle</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Très courte</string>
<string name="pref_swipe_dist_e_short">Courte</string>
<string name="pref_swipe_dist_e_default">Normale</string>

View File

@ -68,6 +68,9 @@ This application contains no ads, doesn't make any network requests and is Open
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<!-- <string name="pref_theme_e_desert">Desert</string> -->
<!-- <string name="pref_theme_e_jungle">Jungle</string> -->
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Veramente breve</string>
<string name="pref_swipe_dist_e_short">Breve</string>
<string name="pref_swipe_dist_e_default">Normale</string>

View File

@ -68,6 +68,9 @@ This application contains no ads, doesn't make any network requests and is Open
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<!-- <string name="pref_theme_e_desert">Desert</string> -->
<!-- <string name="pref_theme_e_jungle">Jungle</string> -->
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">매우 짧음</string>
<string name="pref_swipe_dist_e_short">짧음</string>
<string name="pref_swipe_dist_e_default">보통</string>

View File

@ -68,6 +68,9 @@ Tagad lieliski piemērota izmantošanai ikdienā.
<string name="pref_theme_e_epaper">ePapīrs</string>
<string name="pref_theme_e_desert">Tuksnesis</string>
<string name="pref_theme_e_jungle">Džungļi</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Ļoti tuvs</string>
<string name="pref_swipe_dist_e_short">Tuvs</string>
<string name="pref_swipe_dist_e_default">Vidējs</string>

View File

@ -68,6 +68,9 @@ Aplikacja nie zawiera reklam, nie żąda dostępu do internetu, a jej kod źród
<string name="pref_theme_e_epaper">e-paper</string>
<string name="pref_theme_e_desert">Pustynny</string>
<string name="pref_theme_e_jungle">Dżunglowy</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Bardzo mała</string>
<string name="pref_swipe_dist_e_short">Mała</string>
<string name="pref_swipe_dist_e_default">Normalna</string>

View File

@ -68,6 +68,9 @@ Este aplicativo não contém anúncios, não faz nenhuma solicitação de rede e
<string name="pref_theme_e_epaper">Papel Eletrônico</string>
<string name="pref_theme_e_desert">Deserto</string>
<string name="pref_theme_e_jungle">Selva</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Bem curto</string>
<string name="pref_swipe_dist_e_short">Curto</string>
<string name="pref_swipe_dist_e_default">Normal</string>

View File

@ -68,6 +68,9 @@ Această aplicație nu conține publicitate, nu folosește rețeaua deloc și e
<string name="pref_theme_e_epaper">ePaper</string>
<!-- <string name="pref_theme_e_desert">Desert</string> -->
<!-- <string name="pref_theme_e_jungle">Jungle</string> -->
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Foarte apropiată</string>
<string name="pref_swipe_dist_e_short">Apropiată</string>
<string name="pref_swipe_dist_e_default">Normală</string>

View File

@ -68,6 +68,9 @@
<string name="pref_theme_e_epaper">Электронная бумага</string>
<string name="pref_theme_e_desert">Пустыня</string>
<string name="pref_theme_e_jungle">Джунгли</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Очень короткая</string>
<string name="pref_swipe_dist_e_short">Короткая</string>
<string name="pref_swipe_dist_e_default">Обычная</string>

View File

@ -68,6 +68,9 @@ Bu uygulama açık kaynaklıdır. Reklam içermez ve internete bağlanmaz."</str
<string name="pref_theme_e_epaper">E-Kağıt</string>
<string name="pref_theme_e_desert">Çöl</string>
<string name="pref_theme_e_jungle">Orman</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Çok kısa</string>
<string name="pref_swipe_dist_e_short">Kısa</string>
<string name="pref_swipe_dist_e_default">Normal</string>

View File

@ -68,6 +68,9 @@
<string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_theme_e_desert">Пустеля</string>
<string name="pref_theme_e_jungle">Джунглі</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Дуже коротка</string>
<string name="pref_swipe_dist_e_short">Коротка</string>
<string name="pref_swipe_dist_e_default">Звичайна</string>

View File

@ -68,6 +68,9 @@ Bây giờ đã hoàn hảo cho việc sử dụng hàng ngày.
<string name="pref_theme_e_epaper">ePaper</string>
<!-- <string name="pref_theme_e_desert">Desert</string> -->
<!-- <string name="pref_theme_e_jungle">Jungle</string> -->
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">Rất gần</string>
<string name="pref_swipe_dist_e_short">Gần</string>
<string name="pref_swipe_dist_e_default">Trungbình</string>

View File

@ -68,6 +68,9 @@
<string name="pref_theme_e_epaper">白色带边框</string>
<string name="pref_theme_e_desert">沙漠</string>
<string name="pref_theme_e_jungle">雨林</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_swipe_dist_e_very_short">非常短</string>
<string name="pref_swipe_dist_e_short"></string>
<string name="pref_swipe_dist_e_default">中(默认)</string>

View File

@ -28,6 +28,9 @@
<item>@string/pref_theme_e_epaper</item>
<item>@string/pref_theme_e_desert</item>
<item>@string/pref_theme_e_jungle</item>
<item>@string/pref_theme_e_monet</item>
<item>@string/pref_theme_e_monetlight</item>
<item>@string/pref_theme_e_monetdark</item>
</string-array>
<string-array name="pref_theme_values">
<item>system</item>
@ -39,6 +42,9 @@
<item>epaper</item>
<item>desert</item>
<item>jungle</item>
<item>monet</item>
<item>monetlight</item>
<item>monetdark</item>
</string-array>
<string-array name="pref_swipe_dist_entries">
<item>@string/pref_swipe_dist_e_very_short</item>

View File

@ -68,6 +68,9 @@ This application contains no ads, doesn't make any network requests and is Open
<string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_theme_e_desert">Desert</string>
<string name="pref_theme_e_jungle">Jungle</string>
<string name="pref_theme_e_monet">Monet (System)</string>
<string name="pref_theme_e_monetlight">Monet (Light)</string>
<string name="pref_theme_e_monetdark">Monet (Dark)</string>
<string name="pref_swipe_dist_e_very_short">Very short</string>
<string name="pref_swipe_dist_e_short">Short</string>
<string name="pref_swipe_dist_e_default">Normal</string>

View File

@ -179,4 +179,28 @@
<item name="emoji_button_bg">?colorKeyActivated</item>
<item name="emoji_color">#000000</item>
</style>
<style name="MonetLight" parent="@style/BaseTheme">
<item name="android:isLightTheme">true</item>
<item name="colorKeyboard">@android:color/system_accent1_100</item>
<item name="colorKey">@android:color/system_accent1_0</item>
<item name="colorKeyActivated">@android:color/system_accent1_300</item>
<item name="colorLabel">@android:color/system_accent1_1000</item>
<item name="colorLabelActivated">@android:color/system_accent1_1000</item>
<item name="colorLabelLocked">@android:color/system_accent1_500</item>
<item name="colorSubLabel">@android:color/system_accent1_900</item>
<item name="emoji_button_bg">?colorKeyActivated</item>
<item name="emoji_color">@android:color/system_accent1_1000</item>
</style>
<style name="MonetDark" parent="@style/BaseTheme">
<item name="android:isLightTheme">false</item>
<item name="colorKeyboard">@android:color/system_accent1_900</item>
<item name="colorKey">@android:color/system_accent1_800</item>
<item name="colorKeyActivated">@android:color/system_accent1_600</item>
<item name="colorLabel">@android:color/system_neutral1_0</item>
<item name="colorLabelActivated">@android:color/system_accent2_300</item>
<item name="colorLabelLocked">@android:color/system_accent2_100</item>
<item name="colorSubLabel">@android:color/system_neutral1_300</item>
<item name="emoji_button_bg">?colorKeyActivated</item>
<item name="emoji_color">@android:color/system_accent1_900</item>
</style>
</resources>

View File

@ -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;