From fd578d1c365abc21e143bae9527f09cf7bbf75ad Mon Sep 17 00:00:00 2001
From: Andrey Mukamolov <4471821+fobo66@users.noreply.github.com>
Date: Mon, 29 May 2023 13:36:47 +0300
Subject: [PATCH] Android: Fixes #7766: Support monochrome icons (#7772)
---
Assets/ImageSources/JoplinIconForeground.svg | 78 ++++++
.../ImageSources/JoplinNotificationIcon.svg | 1 +
package.json | 1 +
.../drawable-anydpi-v24/ic_notification.xml | 9 +
.../res/drawable-hdpi/ic_notification.png | Bin 0 -> 568 bytes
.../res/drawable-mdpi/ic_notification.png | Bin 0 -> 421 bytes
.../res/drawable-xhdpi/ic_notification.png | Bin 0 -> 697 bytes
.../res/drawable-xxhdpi/ic_notification.png | Bin 0 -> 1045 bytes
.../res/drawable/ic_launcher_foreground.png | Bin 13531 -> 0 bytes
.../res/drawable/ic_launcher_foreground.xml | 15 ++
.../res/mipmap-anydpi-v26/ic_launcher.xml | 4 +-
.../mipmap-anydpi-v26/ic_launcher_round.xml | 4 +-
.../mipmap-hdpi/ic_launcher_foreground.png | Bin 1045 -> 0 bytes
.../mipmap-mdpi/ic_launcher_foreground.png | Bin 725 -> 0 bytes
.../mipmap-xhdpi/ic_launcher_foreground.png | Bin 1395 -> 0 bytes
.../mipmap-xxhdpi/ic_launcher_foreground.png | Bin 2286 -> 0 bytes
.../mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 3251 -> 0 bytes
.../services/AlarmServiceDriver.android.ts | 3 +-
.../android/src/main/AndroidManifest.xml | 1 +
.../react/alarm/notification/AlarmModel.java | 4 +-
.../alarm/notification/AlarmReceiver.java | 3 +-
.../react/alarm/notification/AlarmUtil.java | 51 ++--
packages/tools/generate-images.json | 6 +-
packages/tools/generate-images.ts | 59 +++++
packages/tools/package.json | 1 +
yarn.lock | 226 +++++++++++++++++-
26 files changed, 427 insertions(+), 39 deletions(-)
create mode 100644 Assets/ImageSources/JoplinIconForeground.svg
create mode 100644 Assets/ImageSources/JoplinNotificationIcon.svg
create mode 100644 packages/app-mobile/android/app/src/main/res/drawable-anydpi-v24/ic_notification.xml
create mode 100644 packages/app-mobile/android/app/src/main/res/drawable-hdpi/ic_notification.png
create mode 100644 packages/app-mobile/android/app/src/main/res/drawable-mdpi/ic_notification.png
create mode 100644 packages/app-mobile/android/app/src/main/res/drawable-xhdpi/ic_notification.png
create mode 100644 packages/app-mobile/android/app/src/main/res/drawable-xxhdpi/ic_notification.png
delete mode 100644 packages/app-mobile/android/app/src/main/res/drawable/ic_launcher_foreground.png
create mode 100644 packages/app-mobile/android/app/src/main/res/drawable/ic_launcher_foreground.xml
delete mode 100644 packages/app-mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
delete mode 100644 packages/app-mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
delete mode 100644 packages/app-mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
delete mode 100644 packages/app-mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
delete mode 100644 packages/app-mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
diff --git a/Assets/ImageSources/JoplinIconForeground.svg b/Assets/ImageSources/JoplinIconForeground.svg
new file mode 100644
index 000000000..aab92f311
--- /dev/null
+++ b/Assets/ImageSources/JoplinIconForeground.svg
@@ -0,0 +1,78 @@
+
+
diff --git a/Assets/ImageSources/JoplinNotificationIcon.svg b/Assets/ImageSources/JoplinNotificationIcon.svg
new file mode 100644
index 000000000..9f263309b
--- /dev/null
+++ b/Assets/ImageSources/JoplinNotificationIcon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/package.json b/package.json
index 63d3392b9..8add31d02 100644
--- a/package.json
+++ b/package.json
@@ -84,6 +84,7 @@
"lint-staged": "13.2.2",
"madge": "6.0.0",
"npm-package-json-lint": "6.4.0",
+ "svg2vectordrawable": "^2.9.1",
"typedoc": "0.17.8",
"typescript": "4.9.4"
},
diff --git a/packages/app-mobile/android/app/src/main/res/drawable-anydpi-v24/ic_notification.xml b/packages/app-mobile/android/app/src/main/res/drawable-anydpi-v24/ic_notification.xml
new file mode 100644
index 000000000..307d85a37
--- /dev/null
+++ b/packages/app-mobile/android/app/src/main/res/drawable-anydpi-v24/ic_notification.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/packages/app-mobile/android/app/src/main/res/drawable-hdpi/ic_notification.png b/packages/app-mobile/android/app/src/main/res/drawable-hdpi/ic_notification.png
new file mode 100644
index 0000000000000000000000000000000000000000..b9b2e87af3dfdc404e5bd8120213a0f4bf5054b8
GIT binary patch
literal 568
zcmV-80>}M{P)PbXFRCwC$m^&{-K@`V_B`DB}5QT&&gh;UA1L!n%5iM$kLZeU;
zkIHxODkTaMm5xNRR%g8mB#5B!2!1j$WOL2EJ9l^X?n?ZV?PkyU?Rm_eGeS57gn$8H
z4LAj!u_tNk1Xxu*Lc&Wx7jQ^$iUVOcn10LAFx3+f(M2W~Fv(Eie-S!DrvY
z#=%!j0fQEP;e{|1@Zw=7DpWV+3(&Gqt(`AG$HG!EzXDt8eyP9()2V
z*aT|OI9SRh(1^x?EaFR-^P`&ci#CCFUAn9R*m0aa0?IXKH*H^xLoQGSK&y?6!rlOlA`Jmke)cn=c5M@#15G|*y8T24NC-8Uo9a=eCu9KA3*7mfCcf67
zfixcp#(+8pL>bVdHjIxn>_)#=>39Z%+AR+*w3U$Eq%u
literal 0
HcmV?d00001
diff --git a/packages/app-mobile/android/app/src/main/res/drawable-mdpi/ic_notification.png b/packages/app-mobile/android/app/src/main/res/drawable-mdpi/ic_notification.png
new file mode 100644
index 0000000000000000000000000000000000000000..57d55b2f0cf6e570871d94893946d33f4b927d45
GIT binary patch
literal 421
zcmV;W0b2fvP)@0GogBr*sqa9q
zf1m{yN8dm}uoYZfdUrv4}QIrUu
zu!3XUYG1d>+$GebP#DCy>U4%i_~ccFhmd*}cg9|?4Dcfe=)x8*v0D{jCJ2})*hRf%0N;Xu;kN*6r)s~N8ea>>`pW?B
zF_eOQ#X7#nEk3wERRqXuc1QRewGcY6*CPL>s9m36Bquy>az6_`)aQ1+RA73*4(9L$
z<7nc~E80sl2Go<|t!ka3_OjeY#gNl~hkj7gcqNN*-TvdZonumqH-yh`%F#D5L}Z9!52r-5nQ(HzjOYyJjM#yts7
zeR1X=;l3uK%-_Zz-3*&=2ev!{DDTs{mDi{~X{@6(Gan?JKbC3&1uo3tRz?hD_B07hDGT40Ohn1TC%tya4Jn
zY8od2-s_l82yoaIz()94_YGhqVOgvT&|nMTgu?7`U=(-<%mWXAOD^4krI;&SG)QDt
z?!b%!;GtnAwgND%0C?^Lz^nq`z7GID6aa0qtVj#cXe$b}8192}5p$bt0o+vp)Bsb8
zxnF?&5pz3j0sI6G#3Zka|LARg0y-3PuG_4I#x%2VGjJ9-sWCQh0+6(^C7Mn>K}G_)
zGy_0nV=GN-Q51Du8JMpF77gA>ezz7EQchk6E*qHN2fQ?VBb*Q9QKpF|fg=gcACm>2
zsRnkEkg3*XHqONu7xDfcu$EC1p>=2BHyL&&L|5V&Fer~~`+;%bL&oQDufiwtE}jiX
zsr={a?}E7H5kPO$Gdkgc`SG|2A&xmW9er&2bi>>!xe;B_T-vWzax$9aWyZGkxlKXl
fiNU`%Ye>HU#w%R1IUGn#00000NkvXXu0mjfJ&+`|
literal 0
HcmV?d00001
diff --git a/packages/app-mobile/android/app/src/main/res/drawable-xxhdpi/ic_notification.png b/packages/app-mobile/android/app/src/main/res/drawable-xxhdpi/ic_notification.png
new file mode 100644
index 0000000000000000000000000000000000000000..9dc753ac6212c19e3750fa104a0e5608742c4fa4
GIT binary patch
literal 1045
zcmV+w1nT>VP)ZFTG8*)Ac$HNWkzKgwFum_i-H!d
zB!WmPZ4pS;#`+7)MZY#hE&6RywCNXRzo2FGJA+C=&5fFU;>aju?>%Skz4N^9-uc2?
zzPWQgckawNXJ$?!VIUw6*aRE{?f@TwF2XD6+Xvvb>T{*okO*49G@t=!Bm32+Y$*-`
z%y^&<_(k+2HXRZhy~0@lJR$me4lFW-QwIDbKI#D0>B3n9^bkLZ&E=!PDFxbzujH#)
zm~KLD#p!9%i5ocV*bM7nGC!v$B=bNs&=k<`EbzxeKf3?%la!Yk2EDZ4{yNj>hogo>?jfRbv1G;rJjO7oeisN4Zcu3HI}4sd{y>s=ybk$Q*n$0UPL3seC)
zhS`Vh>i_aP0{r%qPm)FlLhiJkFaUHd;AamcvcRkTrU|Feqf?kx*#M|R6VOZ>4|jkZ
zAP2|+a)2D5i~ySD0Hp^s+W~Tb93WAj${;*fI|y%p?{Nq8Q0;@S0P<59SPUG98=y-9
z#UL7A85cmGfh``ATYdn|$reBlfEgaMe~||yaHjZ3k475MTS;2^%pdy!G&jtEByC$3
zK!QE8Bj{8>I}ni^K{9$4J3y&*&k%xq3j2YJz+H8kV~etyCR$Ib-aRk(>+4%_>$Op{}>nAoz(|}KL1++xd
zfabUY+OBE9GLJ`5bOFr|E1)I=Kd8||`(LviP`klAB&*qV!}f1zw!JFM!Rl^3rl9&Q|QH%ho~i#tgxk
zZuubm;6d`+mKv9(yuc!y0v{<9UEQ>OS4@`w5=$fJKK3G{m=-sYIe4{6d7K|Hf+JT!*P8krlH+|8130o`mij5tbwDk}QIjm?H7O@#
zLr_H$mt@ezx9uU<|L5lf6bDJ2j|~b|3-DfL62q!a)yEdq=ZfL*K~sMLrwrNi+C@7!
P00000NkvXXu0mjfhJoH3
literal 0
HcmV?d00001
diff --git a/packages/app-mobile/android/app/src/main/res/drawable/ic_launcher_foreground.png b/packages/app-mobile/android/app/src/main/res/drawable/ic_launcher_foreground.png
deleted file mode 100644
index e673f82e1e77c22828a1ca4700908492da7e5d80..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 13531
zcmd6NXH-*Lx9AQnbOZ%M*MkU33%vzUP*77cd$r5e!Yr+jze5?)|>+-uK3MW85*`kBptY*4(qLx#pZ}&UO2|jfDWO
z1TO#p0%y;hx&Q!d2=K?`<^o5uWb0`4t?ce)Bfcph70N}N~YG!u+{FT7#
zf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