From d6f5b5738ca34d98ce4a1b122e6e519a2ba6dca0 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 31 Jan 2019 09:05:35 +0100 Subject: [PATCH 1/2] MOBILE-2827 icon: Use small icon for Android notifications --- config.xml | 4 ++++ ...droid_splash.js => 030_android_resources.js} | 0 .../android/icon/drawable-hdpi-smallicon.png | Bin 0 -> 15237 bytes .../android/icon/drawable-ldpi-smallicon.png | Bin 0 -> 14854 bytes .../android/icon/drawable-mdpi-smallicon.png | Bin 0 -> 14957 bytes .../android/icon/drawable-xhdpi-smallicon.png | Bin 0 -> 15436 bytes .../providers/pushnotifications.ts | 3 ++- src/providers/local-notifications.ts | 2 +- 8 files changed, 7 insertions(+), 2 deletions(-) rename hooks/after_prepare/{030_android_splash.js => 030_android_resources.js} (100%) create mode 100644 resources/android/icon/drawable-hdpi-smallicon.png create mode 100644 resources/android/icon/drawable-ldpi-smallicon.png create mode 100644 resources/android/icon/drawable-mdpi-smallicon.png create mode 100644 resources/android/icon/drawable-xhdpi-smallicon.png diff --git a/config.xml b/config.xml index a5eb4c297..4e212fa13 100644 --- a/config.xml +++ b/config.xml @@ -59,6 +59,10 @@ + + + + diff --git a/hooks/after_prepare/030_android_splash.js b/hooks/after_prepare/030_android_resources.js similarity index 100% rename from hooks/after_prepare/030_android_splash.js rename to hooks/after_prepare/030_android_resources.js diff --git a/resources/android/icon/drawable-hdpi-smallicon.png b/resources/android/icon/drawable-hdpi-smallicon.png new file mode 100644 index 0000000000000000000000000000000000000000..5262dcb0fb7308ba6d4429c6c32643c44a895d91 GIT binary patch literal 15237 zcmeI3eNYo;9>=%lq(b#tZ5>~x)Lf|6qG2})fn*J#@+Mpja=a9nL1oEqU?s`MWFvu6 ziryc>QR>aLpr`F=Y3tn0P`n;EaHl;GPdLWw33>ur>ea!iSG7evi;4=jn}qNXL!b7h ze?FN>^2_slzrWw^=XuHg^His$ZdeeqJOsnA1u4l1>B9H(;(K0@@Oc^Aw@>&Awk78} zgto85_h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b6uyOHg-!y)uH|DGDI7Ok!u@9JsU!@Wb3P?ueWvT;jlq|H zpOy7&_vjh@RsNIx_cp3-hHI)?=F67TJ0*|Tmd$UN7q+-(z2SqRSB9lUtCt#_y~W!k z#l0JAs&?&Pdb{#3&LexSjQ{7-?HjAwLyvuWp}VQ{t9f^xJmC1}#p20>D+$2YDLovLnkY{MwkAsBfd?tWcw=VYtI}_ z-ZLyYKDPB%?7SlN*yTTb@a3ili>exeMq8gWcOCfi(CR~srZT3lD>FhO4GO-mywtI~ zb}Y2-LO8FeVc+R2?E5UXvOnm`;zq;$Old_|-m?pu*W@fYG19$ISCid5UQd5fQU2{) z6C<`~xPhHpeqNTExMFyF@2MR_`&%}jZYoH;&CglaeCA>Q8*z;XQ|jTS8ZMR$E=;7yj^#pM>Y4kj&+*el(vES%Ni}q#-8rk zmeF{Y+}(3m{`6?@gQ_D9?^SnXPqhE-zk}z4*#k+3RYjo|*3*XyvQQy_7slRaIq$}v(1LIuheP^HPWcgzU zjiu>>Cvwf-Fdf#@AOGpO*Z*~~e{TMr%8BmLJo$n|*;r5IUsamw4U)_c%W`qmbyINE z`{!B|?^vt9G=FjZrRLh;^IsPXua&3mxS1byZw|z2hyyVuajUP_l8j9Vz=H0@kxskuUbvaM|k>zOL$_Hh^A0m`!-TmS$7 literal 0 HcmV?d00001 diff --git a/resources/android/icon/drawable-ldpi-smallicon.png b/resources/android/icon/drawable-ldpi-smallicon.png new file mode 100644 index 0000000000000000000000000000000000000000..3360a685b4a7297ec51f609cef383072d0160007 GIT binary patch literal 14854 zcmeI3Z)_7~9LH~B5N1XgnLrSv-U1@f-d(q@?RhPMbz{?Y8)Lv06XbgLY&+K8mEM(g z+Y9~~-N4|V1T)E^325L2keEQ2Az%h7i6#pO35tlz2r+`PfG_-$41BKb+NWK|1BRDR zleWJ;&-eTLJ@}TPzfYYKjt8#KNM~4h%~Gv?{8H9zFFXZBb+o zy}{vU{o!)Zrc`xBz}l|bMyab^a?A7zZ@v)YVS*4a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nA( literal 0 HcmV?d00001 diff --git a/resources/android/icon/drawable-mdpi-smallicon.png b/resources/android/icon/drawable-mdpi-smallicon.png new file mode 100644 index 0000000000000000000000000000000000000000..c8df8f94dc67798e25535b55b2715c3bdf0e0382 GIT binary patch literal 14957 zcmeI3eQXnD9LH}4c^NNJ5Vr7UEkYR5-d($H?a`Lu3T}apZH&-?25#4<+lBV7^sclc z@*;=^8O#t&mW&vIpkM$6VwfnxcvVpcAqW8yi2i{h2n3BIfb+SwYoB!;4;cP@nza4( zdA{G@@43(O();Jul$X6WFnf45MNtDwOI(%kJ6C)6?F~P#MjY+%t6#9BT7hlN+B>T> zylNvwStp299@XQX!3lD}$b01)V2lQWP)$+x$AR|4C=&^B_S|tNm-S!WT9a5>L)w1?NJUU2mqDWMFW0G;i3+GEH4LRt(n&AViI+s zLqA0;sPnkXb;WWB=q$zpgTR`tx@Kp&gY7p#+2S*eqID4Fc;u`rwyw>w!o<9GvsjHMNI>SBl>fi$C2sj3eG zx)LaII3$3ni{Yh=$#nIq=u1sbmrPnuk7EZ>u?L&h6Su{dLVSko@LIXz5a3lgR3*!P zXMB~FcOujk7i+7kP&eMq3!uF~HXXIw;lJ z=~N@4Os*@gSoX^yI4s~a+v!Zrh%2_%xKc?`c}W1JE+=d-ilUce^9wCCUXx$|78V%t zZPo&V)nXM4HpXlA)tC#tR+A|P(d|a<-BP<`A*}6}L~8F7rbg`DQqK&D@T}wgh(;Uz zla|Pkrdz2JQGqM89$C3?{l-qSSzuAu*3J&U7(11Md`JP>o^$9sH(l}=OP*4iC$@Jv zUeL}nr=V>K;I-3TT2sSHIukbW|4v{$KVt8>Mx+i%kJ?c2R54Z0Nfg<0(M&a2k?tsry}0kb%r|EZ1)+pYX=(#R|6awADac%PIqfdRgUXD+N}D+ zaeV=!y=YeZOnA}$bZ<4ri}t5`Q`Xs%s5;?Zj14ud8F6XnZ~SPO1#cCAv%q38TkLdt zbGoBki~_&MCBi+dXe-l{pYWu2WHeUyWJEd=#`t6*f9kQhjJLvD26(qZCvR7}PIGcI zJmnyDMNc^~nvN7fX<%c53yTO95L_q?Y)o)r5upNt3#EaL2`(%mR6uZ{G_Wzjg++u4 z2riTcHYT{Rh)@B+h0?&r1Q!+&Dj>K}8rYcN!XiQi1Q$vJ8xveuM5ut^LTO-Qf(wfX z6%bq~4QxzsVG*GMf(xaAjR`I+B2++dp){~D!G%SH3J5Ng1~w+Ru!v9r!G+Sm#sn7@ z5h@_KP#V~n;KCw81q2sL0~-@uSVX9R;6iC&V}c8d2o(@qC=F~(aA6Ul0)h*rfsF|+ zEFx4uaG^A?@gs3%ryc+V5`5|}0w3?Y9XPNDJ{qVKN-EtHwPY+styo1-_d4MB?-Uhg zDC+tGisG6mDo5Th|M)bD$~su;noYvx^NX@a3^pxW-)ubFa-!*<3-{KqGKef*D|GoPI>vF$;hMa%_5 zYyRk~gDRU_7j0_XFk^Mam6_DiqoXe$3%`Es&jGI0bjt|#R!-iwtSyxMDPwDDfi z2IjfD;znuIxTCcKvuV)JW15a{9^7{N+wuY?XZttPP9JQQ228(`S2XlY^FHf4mpqN{ zde-#+qUc`nulsJjWIwWP{PZE`gU@`%G$<9u=*oUO*FC%meyi8@zt{*W+BO%3$E@7H z>aVG@=C!_D+o6A(Y1}d(zuCO?(_JeToc)fO|B3Pb?DnDCzkmPwZGGADJ%{J^W+ ze`?Z>cji^JeK@x1!P)(yp~{jocX#B=>N$LPWXn&v5ASrCeFw%i4cuWla!)w9YzSR^ tZP({*C#%}`-~PD0V_e7Iy{`134(gSU${XFkXb*&zPAzloes#gh{{Sm{e)0eS literal 0 HcmV?d00001 diff --git a/resources/android/icon/drawable-xhdpi-smallicon.png b/resources/android/icon/drawable-xhdpi-smallicon.png new file mode 100644 index 0000000000000000000000000000000000000000..28081d2041c74e5da6a5c0a0dd5e12a530930351 GIT binary patch literal 15436 zcmeI3Yg7|w8po%VY70_b6;PL!7)w#yWHPxxGEHKEV7V9sj1`nBLo&dWBomWCBD#uN ztElMeZWR=5sb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fizfS4i_sTP{82=X|To|E>=XK zfWrmSV2wFktcXAXhYO^^8gsZ<5rF~@7f6FO=5Vnh0tFl{kOph~v$#C_9{|M7^izL1 z^y7V{wMXmdM+15Ks6;IUwDGK8(tH{0Cy*)PnM=vhkxcOs` zT64opV6UA5&c zfAT&9OYTOFy%2q7im~>>FUT!n30zb*3m+L<{QmfTd&;)_Xzn!7Y`H}a^=#!@!vCB@CiJH^T?TXh2tjzlKUb)BO zSf5SHyDa(Lb=%rb`j%ByO|H3eEFAwRW7QcL>C|jlx?PdnuD9mLeUMlm*Ov0($%4Q` z^J5ki9BFEd8Fl~ij}_nCI3iIlPMA4woF?f0{LzPZ{Xm|1_tvS3aUF_l7e9u!Xy%^q zt(|kz^Tdwuo<;YFu-jAE0$CIFoMYnD9rmU)Gp7)K8jME$nPhImrpVo8p literal 0 HcmV?d00001 diff --git a/src/addon/pushnotifications/providers/pushnotifications.ts b/src/addon/pushnotifications/providers/pushnotifications.ts index 01ac2318c..637612df3 100644 --- a/src/addon/pushnotifications/providers/pushnotifications.ts +++ b/src/addon/pushnotifications/providers/pushnotifications.ts @@ -94,7 +94,8 @@ export class AddonPushNotificationsProvider { return { android: { senderID: CoreConfigConstants.gcmpn, - sound: !!soundEnabled + sound: !!soundEnabled, + icon: 'smallicon' }, ios: { alert: 'true', diff --git a/src/providers/local-notifications.ts b/src/providers/local-notifications.ts index 5b64a5f64..75e0b555e 100644 --- a/src/providers/local-notifications.ts +++ b/src/providers/local-notifications.ts @@ -448,7 +448,7 @@ export class CoreLocalNotificationsProvider { if (this.platform.is('android')) { notification.icon = notification.icon || 'res://icon'; - notification.smallIcon = notification.smallIcon || 'res://icon'; + notification.smallIcon = notification.smallIcon || 'res://smallicon'; const led: any = notification.led || {}; notification.led = { From 407e11b4d7d1811b5376c19d5bb3422f0d85aa1f Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 15 Feb 2019 11:25:15 +0100 Subject: [PATCH 2/2] MOBILE-2827 core: Use resource-file instead of a hook --- config.xml | 12 +++++ hooks/after_prepare/030_android_resources.js | 49 -------------------- 2 files changed, 12 insertions(+), 49 deletions(-) delete mode 100755 hooks/after_prepare/030_android_resources.js diff --git a/config.xml b/config.xml index 4e212fa13..cdc0b199d 100644 --- a/config.xml +++ b/config.xml @@ -63,6 +63,18 @@ + + + + + + + + + + + + diff --git a/hooks/after_prepare/030_android_resources.js b/hooks/after_prepare/030_android_resources.js deleted file mode 100755 index 26c1d64f3..000000000 --- a/hooks/after_prepare/030_android_resources.js +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env node - -// This hook copies Android splash screen files from dev directories into the appropriate platform specific location. -// The code was extracted from here: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/ - -var filesToCopy = [{ - 'resources/android/splash/drawable-land-hdpi-screen.png': 'platforms/android/app/src/main/res/drawable-land-hdpi/screen.png' - }, { - 'resources/android/splash/drawable-land-ldpi-screen.png': 'platforms/android/app/src/main/res/drawable-land-ldpi/screen.png' - }, { - 'resources/android/splash/drawable-land-mdpi-screen.png': 'platforms/android/app/src/main/res/drawable-land-mdpi/screen.png' - }, { - 'resources/android/splash/drawable-land-xhdpi-screen.png': 'platforms/android/app/src/main/res/drawable-land-xhdpi/screen.png' - }, { - 'resources/android/splash/drawable-land-xxhdpi-screen.png': 'platforms/android/app/src/main/res/drawable-land-xxhdpi/screen.png' - }, { - 'resources/android/splash/drawable-land-xxxhdpi-screen.png': 'platforms/android/app/src/main/res/drawable-land-xxxhdpi/screen.png' - }, { - 'resources/android/splash/drawable-port-hdpi-screen.png': 'platforms/android/app/src/main/res/drawable-port-hdpi/screen.png' - }, { - 'resources/android/splash/drawable-port-ldpi-screen.png': 'platforms/android/app/src/main/res/drawable-port-ldpi/screen.png' - }, { - 'resources/android/splash/drawable-port-mdpi-screen.png': 'platforms/android/app/src/main/res/drawable-port-mdpi/screen.png' - }, { - 'resources/android/splash/drawable-port-xhdpi-screen.png': 'platforms/android/app/src/main/res/drawable-port-xhdpi/screen.png' - }, { - 'resources/android/splash/drawable-port-xxhdpi-screen.png': 'platforms/android/app/src/main/res/drawable-port-xxhdpi/screen.png' - }, { - 'resources/android/splash/drawable-port-xxxhdpi-screen.png': 'platforms/android/app/src/main/res/drawable-port-xxxhdpi/screen.png' - } -]; - -var fs = require('fs'); -var path = require('path'); - -// no need to configure below -var rootDir = process.argv[2]; - -filesToCopy.forEach(function(obj) { - Object.keys(obj).forEach(function(key) { - var val = obj[key]; - var srcFile = path.join(rootDir, key); - var destFile = path.join(rootDir, val); - var destDir = path.dirname(destFile); - if (fs.existsSync(srcFile) && fs.existsSync(destDir)) { - fs.createReadStream(srcFile).pipe(fs.createWriteStream(destFile)); - } - }); -});