From c787ef0949cb3629cf2732b70c642f7dd97c0e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Ker=C3=A4nen?= Date: Tue, 10 Dec 2024 10:01:45 +0200 Subject: [PATCH 01/12] issue-714: Added symbol translations and removed old feels like icons --- .../app/src/main/res/drawable-xhdpi/basic.png | Bin 934 -> 0 bytes .../src/main/res/drawable-xhdpi/easter.png | Bin 1180 -> 0 bytes .../src/main/res/drawable-xhdpi/halloween.png | Bin 1924 -> 0 bytes .../app/src/main/res/drawable-xhdpi/hot.png | Bin 1276 -> 0 bytes .../res/drawable-xhdpi/itsenaisyyspaiva.png | Bin 1226 -> 0 bytes .../src/main/res/drawable-xhdpi/juhannus.png | Bin 1231 -> 0 bytes .../main/res/drawable-xhdpi/naistenpaiva.png | Bin 1632 -> 0 bytes .../src/main/res/drawable-xhdpi/newyear.png | Bin 1647 -> 0 bytes .../src/main/res/drawable-xhdpi/raining.png | Bin 1350 -> 0 bytes .../src/main/res/drawable-xhdpi/valentine.png | Bin 1234 -> 0 bytes .../app/src/main/res/drawable-xhdpi/vappu.png | Bin 1574 -> 0 bytes .../app/src/main/res/drawable-xhdpi/windy.png | Bin 969 -> 0 bytes .../src/main/res/drawable-xhdpi/winter.png | Bin 1079 -> 0 bytes .../app/src/main/res/drawable-xhdpi/xmas.png | Bin 1718 -> 0 bytes .../src/main/res/layout/forecast_timestep.xml | 6 +++ .../app/src/main/res/values-en/strings.xml | 45 ++++++++++++++++++ .../app/src/main/res/values-fi/strings.xml | 45 ++++++++++++++++++ .../app/src/main/res/values-sv/strings.xml | 45 ++++++++++++++++++ android/app/src/main/res/values/strings.xml | 45 ++++++++++++++++++ 19 files changed, 186 insertions(+) delete mode 100644 android/app/src/main/res/drawable-xhdpi/basic.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/easter.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/halloween.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/hot.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/itsenaisyyspaiva.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/juhannus.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/naistenpaiva.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/newyear.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/raining.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/valentine.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/vappu.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/windy.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/winter.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/xmas.png create mode 100644 android/app/src/main/res/layout/forecast_timestep.xml diff --git a/android/app/src/main/res/drawable-xhdpi/basic.png b/android/app/src/main/res/drawable-xhdpi/basic.png deleted file mode 100644 index f0f9137dc6446786f504e9e1639c7d3c7e2d64a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 934 zcmV;X16lluP)GLOPn|Lcu`FWSrb+8!M8ihzR-% z3IZ|u2ZGsze}oGc=3mecn?OV>kQoaXVLCBoZ7P@+J}vJ1&SI+3x#!;RdEa-=vz_;x z&-p%c?t9*I?!8c{R4SE9rBbO>DwRs5QmIrbl}e>jsZ=T>O)5QrA!-7i0bT|U1CIfZ z5B_`;_!;;dxR6r1Qe=>$h?>;b)$86r*VU5)=^GbyO1-oWajThAcb2ZB2j`BbZ@B|`LzXv;M0J+2Pp1taG>?_PZ6Brh!LYdy*v@@iyF zVgIec%vb=P>^W*7rSx>q87n*x6$Bihe|Z2;sRsgbfLMVq1!kRy3W^kXcoMTB1#Sz> z+8z}YDRAo~Wxk3W^kXD=_P)sGvxJ7X!1tj0%brcs?-eLR3)nR&E~H z({t2hZsk%+0v`oLeHf5Y2AkuouX{X+x#%PxXTi#W>QWE#med`k>kGktj`WX|t}7Jv z1-m)gUs9(_*HZ+W+nRG3^5)bhO4m^on}y}1>$|Z&uf9@x>@Y%)b^zF%B%c7LX--tO z19xe*fwzG#fKO9O-xM2UrBbO>Rw%xR*lfM_0yDrqU^lP>*bF>8_}Cx7@4%11_rQ0+ zXTbbmkG=6w52Mhs59!V0`i93bX*S_)OXdt3(6a^tiDs)$GT8Ym$vpF zoGR_*zEDqf5Ca-GjU8n_br2*-k_~NORn@sjEJF;xFJxO6hVJopmBm zeFXTHW(zhB+yM5cl>W@^sH^+Jvy6{CfGObPE;`Ddf$FosTo-)>BXBVHQqG!zHYX{w zjGsJc#yp$bN$w^5B5){o5Cxf5kL7fbEAWHN_M^aiIgMLidg?x!m3Q0`*qc&XXwx`n z2ELKec9cj!>mS!SGw=p5DK9(!kWy;(7FDYmsP18MoS^F&u+I`MASRLc;9dMH@~Hnwyd|&Kcjdkm7|JN`~Uy|07*qo IM6N<$f_X2wHvj+t diff --git a/android/app/src/main/res/drawable-xhdpi/easter.png b/android/app/src/main/res/drawable-xhdpi/easter.png deleted file mode 100644 index b2cbadf002346067f8b0e2bdae6fd954ef7833ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1180 zcmV;N1Y`S&P)ShLblEZ_2>~@jx&}4@!c;cmaW`U@D40Nkn5TV2WNaQA;82d>ni&BW zR9#0U0QUpGcMx8kbHGs5^^{5)-lRi#btW&F5P^Q+H^=bmOaOgV*B2C$0i%;=-b@^1 zE)Oig69L1k^LW*D&P1UroZcB@l5X?0GmSAbTNGHMBWeZzZ;8T(CrN|Ak`im{vG(oyM^G^J!3 zct+Cal0G)GBcVJ*B9TZWEUtqH$<*t1NkftrOIj#tzNG6UU87_W`9soqNk2U6NKP`5j`vqy>`ZNxC-u*!fiJRQh*V(pQqcOXu?41F#Z!3pm@s_rRZk zw}HFc=&S&?0jE3A8Be_~FEgX8Vy*z50lw*=m{z<4T$$?BfQ^B4MuB0HJG#{H)&a+y zi}?rmfQG3Y@NfW~ERF&Xlo8zZz=r_}*bm&;x`r(piS@azH31fn`})O`FOA^CW$%WD4fR z5lPF<>_UUi)sjXPer?%{F-c3!?9ax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_v0oVgmjN zXcokCg_&KQl7AdTCwIV{k?x4hQu-g$; z*v$S3cuxkc18ym5q$31Oa5>--5|?0(nXN8rq+IGI}r%<(YPF#-aZ*0RhbHD#8$2%*gNp;BYfr>&2(z1Oza%KLdLL_Yvk^nqdH#W@gjP z?CX}2i-DvWRXzL7!f7R46>0a%3~6?ebfKijBrTEjp~AcRLP^&stkWCb1to)ks)(qt zrelVrrxX@74oX@r=?R6Emc2>3DW96WX`^kfLuV}m| zLz?}Pts_w0lF)*XGzmD0Fuyzrc)-kVsJebBVNz>3uo!p|c;0(nx1$7i;oA^L z73I}20s^y04pX64M+HUXDJ=3AUIeXM{Gw3w@$;lJ$?@PWvD4+2QqB4hdq zHTxJ`Ch795iQ6UM0^qfrd6obVCBJvfn5Reytj26fr)Npn76FsM^y!2UiY)j9I5Wuy zaA3xK9wiXMeEEDy6PqP$TQ?>N^*xB@C2=V*)y$Sxoy+=tg^F-ROCW?k<9xMaX;`zt zgqpNHlFm|yxL={Lf_;U;qV6+mhn^%IpzOirLkf!`(>`<&gPE;Wk9-2=w7Y|(WjSy7 zWH;#oK2n1u8cd{&Wnt)Jet@8H@$EkghEv>Hr0000< KMNUMnLSTZ9pO^0d diff --git a/android/app/src/main/res/drawable-xhdpi/hot.png b/android/app/src/main/res/drawable-xhdpi/hot.png deleted file mode 100644 index 81dfdb3dd03e7b43a8853c652585eb356d9e2d0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1276 zcmVMlY^^bl4r z20`@_JxcY^LqYW_5=23yCPgpy7DYrLnr4{xAX%wPv1)%bSK1Z*^e}f>+3wz*bI#m5 zGkQL7pYF_WzVp4mGiPSboGaDT)YR0}Txq{PBR|^Ao#@3fKKyM54Mp+zN=Y@2|7BG(IJ<2@Sb`?1S z%oum)orob|Mr^&Kq?CdElCJP5H(k=|Hf!-FB?BL8Q`xqX#JmcaCh3@@S)Nr+O1jp} zhTEsgk5n>nx%|zOq}h^^Sl*>#;HnPQ2~H{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jthq>UB5(@$0oV(C1nj7+P_JI4zNx;g7M-t9C#hT2w@TF8mL2V-r_NUQ z4jJnE)$Rg%UH<=j;e8e8brsO-&NLeI<p zbtJt+y@qsdm`XZVtRbB{F1JP;B(2YG2X+I$0zYTxZUJrr?k1hnLh1DZAC#=Oopdff t2@E9a_$*A9#MrE%)<`t4Akn~r{0q4h?$E2}`N9AI002ovPDHLkV1f~=PN4t* diff --git a/android/app/src/main/res/drawable-xhdpi/naistenpaiva.png b/android/app/src/main/res/drawable-xhdpi/naistenpaiva.png deleted file mode 100644 index ea296a8f194727da59a97fd7212044b5570d335f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1632 zcmV-m2A}zfP)C^O9HJ5z z4nf3?2@7Kk1}8|=2rD#7VjLh!G)^cqZWJ`Yf`CFaqJn@#P!MP!bbl`Hd*RX4*zdl2 z)mq=`b=_0vocixjw{G2Psi2^sprD|jprD|jprD|jprD|jprD|jpr9ZIt9Jrv0QyRr zCTW7CVUmVQYLm1}(oRWhBzkiNdcpYd>AY6M| zfER!>>U|w`0T=;n?tpOZ`3e|V@9W7FU?i}|gLq}O0fXy(U6}y%1Gab+uS_%lhwco# zTLbaRJnK8(Tuozu@sif6c6l9@G|J3&_;T3Amm^O+r`lF(Pf1VvbeNkKh?}?lnn9=| zk_MSsiw|dcYJs>xxO6bNx;6H zF;<=g+}jyr(& zm;sy!SghOwTv(;=?zophwPL$39m=F?fj|#QizIaoC>|>5`D&6ev*VIBR^uavb-o>@ z?ZV?F4T&hfxr$uM{NTYy7+ZZi>=soBG)S5y>6Vi1;TV6tfMt?K$W0fPn%T0HIqgqr zpN4(D9fk^s+eXnW>GBYhW0JPX&D%!lZ(LRLArLgXh$QMR{C&W&^)Xw=*2>jtd$yE+l+M3R($|SH%!Usn z-C<^}-aG<#2GmmIEFS2_>67du!1)2TJ%KlC+NR=Z#qHoq-SU!(_#~$a@(&O?MgiBi zOYkos@@*UL$!2c`VzuXI;A;P>oqmDiICX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>1Xzk`DFAw)t@5Q0L;sAM4$21nxsq7WB(TvRtqX8Ka;?sMMi%=xXG zdQbg1HRo0}P*qh`RaI40RaI40RaI40RaI40Rn=)Jx&gze2{;J61{?(*0v-kKiELNT zYD#H2x)B4ZNqs~8!EX9heX!r&J0ru|N?iax1D=a+%Lu1ZN*mFQ*hYO(y*h&)@|Suv z`hJS)g?D`h;q_fpPn2kT_#mP_349Igj&92s0|$=K0BuIvZ|L^lJb(@0nL&U1b_FzM zvt_y;9*h_`!g^q@_pJd>WiGXrQhGYq#Up#*BKgAu*r&db>*A3CzFM%>xd}(}FUDOs zGQh6S)i!`r<9-ww;3I*x+i11oh+N7&T(H)Sl+qnJE*w3LnR}4|t{1GeYnB7YO&8A9 z;ufw1)*hzSz_D3mfad~h57W)9szKDn3Fl^$$TpFVUdmkp_GT`1doJZtN&+7jD7CLe z551*iQH@jdk@C z_4(-gDMGzVeOtXS-4t!03pOuZcIth`nNd%w7c&I6)kXDW^!?6^x?5c>5ZqRus}Drq z|5ViD>Xm@-`hHQDqH~yt`o8*KV0eAk)%T+FxFzaG(Wwn^COVf^)HBgZjqpKqJ|n5` zMkh4J4fUdv zk;#(!Qtl$70{k#{@d8fgE->)%R1eUMyz@?Ae@baBSAk(Y@XcHW3rj%O$@Q=vco}#i zXW@c=N-1UgB5GR?RQGcGga@$4=1cf220g;_xyLrzv0N7(6kxXZi31h=*s#PGl%-{R r4}04nqFx2&`@CVhKT=9r{-wbGUu44(WNRr<00000NkvXXu0mjfZ$rX_ diff --git a/android/app/src/main/res/drawable-xhdpi/winter.png b/android/app/src/main/res/drawable-xhdpi/winter.png deleted file mode 100644 index a6bac967f67fc7ede4d6da60357e735392d803c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1079 zcmV-71jze|P);zkBYB=lz;_XQV=*P$(1%g+ifFC=?3W0Tu&$fiHns!kO)5>;>*?doCA%G2m>3 zv|)S;jI}*qR_Lz0a~b5#aTZwYInzC!%_O}kXzU#;)5O@KY?mtB4>Q&LZpJ`xcu3p)eIxr<^ zJXd~0rp)Y-9KksSx~;f68(MPMXFU?fFgBt>8(MPMXFU?fFg zBt>8(IR#E<%x=n5uHc*k_h>XEPRaR$ra}YUK05#oO8Q;WRY^0FuJj&XHM5S_>qw2K zz?+g5Rs5@?o=A12&h-8LYv1D;NmtD5FP9fw6HkGENP0Ly)OFn!I!yG>W_Bq-uh9Yc zI^!)JgBN>c{TDB_^D&B&%GLX?gJl?^oyjWnOmJVv-O#K%;UBK&1_cE z5rUT0Os3d2YxLPsGiuUf?qmSla|;9(0T*gUZTFfz8Niv$0{7I6IpZ~R zQh=?w1Om%|-)hEe^_)8?!0Ai^->VsM+H>CI09#TE1Re$ct{JiLuTFqdi3OghS$-<_ zY}wz90Uk=6_q3#4HJ|=|%HHk(+knfVt8Z`x0tS51p!_nhxvlx50A2xZ#>lG>xH}-? zAKa^TMd zaUG!U0mv6%GjOBfKqu+`hQb&yQT2pg_D3PLL%0rXY}?lz084-$nwaY`-j}g*$aB_G zeK4w1JB&*}k}rOzIuAT7X?3Eks_d$JYGQay(xJqeVE~&5-|tNTQNel12wl0%q_H0Z*)Fw>#o8Svoo+Ld3JQouXyAOOPvVIhJH>Nmv69!hR zdzXRh-3=K)(&J|KV@Pq#3VdDh@+Q>%U4?N;P2YNosqM!k`Clso7XyxbgT$Q6#ncXR zG1NoQ3ItY3S`*rI1X%+F{i;XkCj5M0-5?*+JC~F6iDPXQK}X}zGyEq5>jv4W@NW^t x)K;-U($S_xp)2r-z`9XpZAeiOc$=V^ZUG3oyD&Rkp!)y-002ovPDHLkV1nok_)7o) diff --git a/android/app/src/main/res/drawable-xhdpi/xmas.png b/android/app/src/main/res/drawable-xhdpi/xmas.png deleted file mode 100644 index eadf065916fe28626fa885406882cbc11ca4f385..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcmV;n21)seP)*NmDXm0)#8O()hSDM+F_nM@2s90}fTAQ` zh*k>Gm-SD|@B>t1CUP-zzFi~L?JvT+Zj0I-4 z-8)IDE_{R1nkPwjq)6h{0)aV_Zk2Soq(zdh_R3Yl7BjovJBg=(2P9qWr60kdr0HgM z&@+i=7f#(}i;R=BBt;T0-f`59#r-_!Y2aZ;?N}CPR{(B!8u+fGb}app#(O51;HaIt z3lB>Am!xfywq~E(&Fr{mQcnXtTOg8lDVQ{5*k8@;eaD;~`7pFVB<<0eR<%viHZwa~ z8UPnaI+bD)*3-a4HRImUnO3z`p&M2;Vv3}%OZsWeV~A$7yYOC}-3_;zSyNsATfj;) z8*E6gBc29!x&zoG=~ZRj(ah?$(ikpPxRrd#F^3<(MBp31l5CC+V0NP1^Rs*#Qsi?5 z_&9JftI#!xa$cL|8vri!%#~s~>nl2Qs+f@=pCk<}GJQnS-JXe37}Q3kl9uvT#dm@-27j{*+@ zzX$pXv3u2x2Zh_kFR1(M_v>c%sS4WBcpEsNa49j`95J(xc?f%7#*78?B*%v0ZQy&(`mywT z340s3!&yI;-Cn}p25xrNkL6EZ!rlh1ch-+3`VOcnt_GUfHc5Z+%n`vWX7&#+@f4E@ zk0r=45|58^{@wvLMc!dF&2PNxmTG_C3`ws`a=Dl-;jpBu%CuT-em*9!6DfnPLi z-s%s9d6EPytXR37B|1ND$h_qR-POR)sIZQb6yWDIDmkY_>)V{Y@Kl9kz`Y&xhIkD~ zy}7+Rgz5OIlrHQ5*8%$~>g@$SQ_xvR7`*Zv1**(+`$N5v^s~A6c^xz_1YVBRdJ#Ck z5dUeys$VBg0{5lxCJNvO70o*VoSTc^4Gh}=P8giN3-p)h^a0gi&D7x}aHWqM4FXJ|yybOb72(w=owU9WoNB9DA_Q%oEjFa?0j~dkhcJ+AfnVHl2M8eok{JpLZwOSzI`mWo) zziyl?`R*OtiK~HGbpq>l;hSp4 + + + \ No newline at end of file diff --git a/android/app/src/main/res/values-en/strings.xml b/android/app/src/main/res/values-en/strings.xml index 97325bd9..a86467e0 100644 --- a/android/app/src/main/res/values-en/strings.xml +++ b/android/app/src/main/res/values-en/strings.xml @@ -60,4 +60,49 @@ Do you want to enable location service? Ask permission "Updated at" + Clear + Mostly clear + Partly cloudy + Mostly cloudy + Overcast + Fog + Drizzle + Freezing drizzle + Freezing rain + Isolated showers + Scattered showers + Showers + Partly cloudy and periods of light rain + Partly cloudy and periods of moderate rain + Partly cloudy and periods of heavy rain + Mostly cloudy and periods of light rain + Mostly cloudy and periods of moderate rain + Mostly cloudy and periods of heavy rain + Light rain + Moderate rain + Heavy rain + Isolated light sleet showers + Isolated moderate sleet showers + Isolated heavy sleet showers + Scattered light sleet showers + Scattered moderate sleet showers + Scattered heavy sleet showers + Light sleet + Moderate sleet + Heavy sleet + Isolated light snow showers + Isolated moderate snow showers + Isolated heavy snow showers + Scattered light snow showers + Scattered moderate snow showers + Scattered heavy snow showers + Light snowfall + Moderate snowfall + Heavy snowfall + Isolated hail showers + Scattered hail showers + Hail showers + Isolated thundershowers + Scattered thundershowers + Thundershowers diff --git a/android/app/src/main/res/values-fi/strings.xml b/android/app/src/main/res/values-fi/strings.xml index 001dd52c..1b16538c 100644 --- a/android/app/src/main/res/values-fi/strings.xml +++ b/android/app/src/main/res/values-fi/strings.xml @@ -60,4 +60,49 @@ Haluatko sallia paikannuksen? Salli paikannus "Päivitetty klo " + Selkeää + Enimmäkseen selkeää + Puolipilvistä + Enimmäkseen pilvistä + Pilvistä + Sumua + Tihkusadetta + Jäätävää tihkua + Jäätävää sadetta + Yksittäisiä sadekuuroja + Paikoin sadekuuroja + Sadekuuroja + Puolipilvistä ja ajoittain heikkoa vesisadetta + Puolipilvistä ja ajoittain kohtalaista vesisadetta + Puolipilvistä ja ajoittain voimakasta vesisadetta + Enimmäkseen pilvistä ja ajoittain heikkoa vesisadetta + Enimmäkseen pilvistä ja ajoittain kohtalaista vesisadetta + Enimmäkseen pilvistä ja ajoittain voimakasta vesisadetta + Heikkoa vesisadetta + Kohtalaista vesisadetta + Voimakasta vesisadetta + Puolipilvistä ja ajoittain heikkoa räntäsadetta tai räntäkuuroja + Puolipilvistä ja ajoittain kohtalaista räntäsadetta tai räntäkuuroja + Puolipilvistä ja ajoittain voimakasta räntäsadetta tai räntäkuuroja + Enimmäkseen pilvistä ja ajoittain heikkoa räntäsadetta tai räntäkuuroja + Enimmäkseen pilvistä ja ajoittain kohtalaista räntäsadetta tai räntäkuuroja + Enimmäkseen pilvistä ja ajoittain voimakasta räntäsadetta tai räntäkuuroja + Heikkoa räntäsadetta + Kohtalaista räntäsadetta + Voimakasta räntäsadetta + Puolipilvistä ja ajoittain heikkoa lumisadetta tai lumikuuroja + Puolipilvistä ja ajoittain kohtalaista lumisadetta tai lumikuuroja + Puolipilvistä ja ajoittain voimakasta lumisadetta tai lumikuuroja + Enimmäkseen pilvistä ja ajoittain heikkoa lumisadetta tai lumikuuroja + Enimmäkseen pilvistä ja ajoittain kohtalaista lumisadetta tai lumikuuroja + Enimmäkseen pilvistä ja ajoittain voimakasta lumisadetta tai lumikuuroja + Enimmäkseen pilvistä ja ajoittain voimakasta lumisadetta tai lumikuuroja + Kohtalaista lumisadetta + Runsasta lumisadetta + Yksittäisiä raekuuroja + Paikoin raekuuroja + Raekuuroja + Yksittäisiä ukkoskuuroja + Paikoin ukkoskuuroja + Ukkoskuuroja diff --git a/android/app/src/main/res/values-sv/strings.xml b/android/app/src/main/res/values-sv/strings.xml index c2160500..6bd26774 100644 --- a/android/app/src/main/res/values-sv/strings.xml +++ b/android/app/src/main/res/values-sv/strings.xml @@ -60,4 +60,49 @@ Vill du aktivera platstjänst? Tillåta "Uppdaterad kl." + Klart + Mest Klart + Halvklart + Molnigt + Mulet + Dimma + Duggregn + Underkylt duggregn + Underkylt regn + Enstaka regnskurar + Lokalt regnskurar + Regnskurar + Halvklart och tidvis lätt regn + Halvklart och tidvis måttligt regn + Halvklart och tidvis kraftigt regn + Molnigt och tidvis lätt regn + Molnigt och tidvis måttligt regn + Molnigt och tidvis kraftigt regn + Lätt regn + Måttligt regn + Kraftigt regn + Halvklart och enstaka byar av lätt snöblandat regn + Halvklart och enstaka byar av måttligt snöblandat regn + Halvklart och enstaka byar av kraftigt snöblandat regn + Molnigt och spridda byar av lätt snöblandat regn + Molnigt och spridda byar av måttligt snöblandat regn + Molnigt och spridda byar av lätt snöblandat regn + Lätt snöblandat regn + Måttligt snöblandat regn + Kraftigt snöblandat regn + Halvklart och enstaka lätta snöbyar + Halvklart och enstaka måttliga snöbya + Halvklart och enstaka ymniga snöbyar + Molnigt och spridda lätta snöbyar + Molnigt och spridda måttliga snöbyar + Molnigt och spridda ymniga snöbyar + Lätt snöfall + Måttligt snöfall + Ymnigt snöfall + Enstaka hagelskurar + Lokalt hagelskurar + Hagelskurar + Enstaka åskskurar + Lokalt åskskurar + Lokalt åskskurar diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 25d7b849..94acbba5 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -62,4 +62,49 @@ Do you want to enable location service? Ask permission "Updated" + Clear + Mostly clear + Partly cloudy + Mostly cloudy + Overcast + Fog + Drizzle + Freezing drizzle + Freezing rain + Isolated showers + Scattered showers + Showers + Partly cloudy and periods of light rain + Partly cloudy and periods of moderate rain + Partly cloudy and periods of heavy rain + Mostly cloudy and periods of light rain + Mostly cloudy and periods of moderate rain + Mostly cloudy and periods of heavy rain + Light rain + Moderate rain + Heavy rain + Isolated light sleet showers + Isolated moderate sleet showers + Isolated heavy sleet showers + Scattered light sleet showers + Scattered moderate sleet showers + Scattered heavy sleet showers + Light sleet + Moderate sleet + Heavy sleet + Isolated light snow showers + Isolated moderate snow showers + Isolated heavy snow showers + Scattered light snow showers + Scattered moderate snow showers + Scattered heavy snow showers + Light snowfall + Moderate snowfall + Heavy snowfall + Isolated hail showers + Scattered hail showers + Hail showers + Isolated thundershowers + Scattered thundershowers + Thundershowers From 26f4603eb6bccbd70d6db82753fa0a83566ad0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Ker=C3=A4nen?= Date: Tue, 10 Dec 2024 11:30:46 +0200 Subject: [PATCH 02/12] issue-714: Added some initial logic for adding timesteps dynamically --- .../LargeForecastWidgetProvider.java | 17 +- .../src/main/res/layout/forecast_timestep.xml | 45 ++++- .../layout/large_forecast_widget_layout.xml | 187 ------------------ 3 files changed, 50 insertions(+), 199 deletions(-) diff --git a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java index 3a26d834..5a41cd4d 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java @@ -2,6 +2,7 @@ import static fi.fmi.mobileweather.Theme.LIGHT; +import android.adservices.adselection.RemoveAdSelectionOverrideRequest; import android.util.Log; import android.widget.RemoteViews; @@ -52,6 +53,8 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe throw new Exception("No future time found or less than 5 future times available"); } + RemoteViews forecastContainer = new RemoteViews(context.getPackageName(), R.id.hourForecastRowLayout); + // handle the first 5 JsonObjects with future time for (int i = firstFutureTimeIndex; i < (firstFutureTimeIndex + 5); i++) { JSONObject forecast = data.getJSONObject(i); @@ -65,27 +68,25 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe widgetRemoteViews.setTextViewText(R.id.locationRegionTextView, region); } + RemoteViews timeStep = new RemoteViews(context.getPackageName(), R.layout.forecast_timestep); // time at the selected location String localTime = forecast.getString("localtime"); String temperature = forecast.getString("temperature"); String weatherSymbol = forecast.getString("smartSymbol"); - // get timeTextView0 or timeTextView1 etc. based on i from widgetRemoteViews - int timeTextViewId = context.getResources().getIdentifier("timeTextView" + i, "id", context.getPackageName()); - int temperatureTextViewId = context.getResources().getIdentifier("temperatureTextView" + i, "id", context.getPackageName()); - int weatherIconImageViewId = context.getResources().getIdentifier("weatherIconImageView" + i, "id", context.getPackageName()); - // ** set the time, temperature and weather icon String formattedTime = getFormattedWeatherTime(localTime); - widgetRemoteViews.setTextViewText(timeTextViewId, formattedTime); + timeStep.setTextViewText(R.id.timeTextView, formattedTime); temperature = addPlusIfNeeded(temperature); - widgetRemoteViews.setTextViewText(temperatureTextViewId, temperature + "°"); + timeStep.setTextViewText(R.id.temperatureTextView, temperature + "°"); int drawableResId = context.getResources().getIdentifier("s_" + weatherSymbol + (theme.equals(LIGHT) ? "_light" : "_dark"), "drawable", context.getPackageName()); - widgetRemoteViews.setImageViewResource(weatherIconImageViewId, drawableResId); + widgetRemoteViews.setImageViewResource(R.id.weatherIconImageView, drawableResId); + + forecastContainer.ap } // Update time TODO: should be hidden for release diff --git a/android/app/src/main/res/layout/forecast_timestep.xml b/android/app/src/main/res/layout/forecast_timestep.xml index 8127a45d..66663abd 100644 --- a/android/app/src/main/res/layout/forecast_timestep.xml +++ b/android/app/src/main/res/layout/forecast_timestep.xml @@ -1,6 +1,43 @@ - + - \ No newline at end of file + + + + + + + + + + diff --git a/android/app/src/main/res/layout/large_forecast_widget_layout.xml b/android/app/src/main/res/layout/large_forecast_widget_layout.xml index 38e02397..5735432a 100644 --- a/android/app/src/main/res/layout/large_forecast_widget_layout.xml +++ b/android/app/src/main/res/layout/large_forecast_widget_layout.xml @@ -45,193 +45,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Date: Tue, 10 Dec 2024 14:52:10 +0200 Subject: [PATCH 03/12] issue-714: Added accessibility labels to large widget --- .../LargeForecastWidgetProvider.java | 28 +++++++++++-------- .../src/main/res/layout/forecast_timestep.xml | 11 ++++---- .../layout/large_forecast_widget_layout.xml | 13 ++------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java index 5a41cd4d..7e0a70bd 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java @@ -2,15 +2,13 @@ import static fi.fmi.mobileweather.Theme.LIGHT; -import android.adservices.adselection.RemoveAdSelectionOverrideRequest; import android.util.Log; import android.widget.RemoteViews; +import android.view.View; import org.json.JSONArray; import org.json.JSONObject; -import java.text.DateFormat; -import java.util.Date; import java.util.Iterator; public class LargeForecastWidgetProvider extends BaseWidgetProvider { @@ -23,6 +21,7 @@ protected int getLayoutResourceId() { // populate widget with data @Override protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelper pref, WidgetInitResult widgetInitResult) { + int TIMESTEP_COUNT = 5; JSONObject forecastJson = widgetInitResult.forecastJson(); RemoteViews widgetRemoteViews = widgetInitResult.widgetRemoteViews(); String theme = widgetInitResult.theme(); @@ -53,10 +52,10 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe throw new Exception("No future time found or less than 5 future times available"); } - RemoteViews forecastContainer = new RemoteViews(context.getPackageName(), R.id.hourForecastRowLayout); + widgetRemoteViews.removeAllViews(R.id.hourForecastRowLayout); // handle the first 5 JsonObjects with future time - for (int i = firstFutureTimeIndex; i < (firstFutureTimeIndex + 5); i++) { + for (int i = firstFutureTimeIndex; i < (firstFutureTimeIndex + TIMESTEP_COUNT); i++) { JSONObject forecast = data.getJSONObject(i); // if first future index @@ -73,7 +72,7 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe // time at the selected location String localTime = forecast.getString("localtime"); String temperature = forecast.getString("temperature"); - String weatherSymbol = forecast.getString("smartSymbol"); + int weatherSymbol = forecast.getInt("smartSymbol"); // ** set the time, temperature and weather icon @@ -84,14 +83,21 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe timeStep.setTextViewText(R.id.temperatureTextView, temperature + "°"); int drawableResId = context.getResources().getIdentifier("s_" + weatherSymbol + (theme.equals(LIGHT) ? "_light" : "_dark"), "drawable", context.getPackageName()); - widgetRemoteViews.setImageViewResource(R.id.weatherIconImageView, drawableResId); + timeStep.setImageViewResource(R.id.weatherIconImageView, drawableResId); + int symbolId = context.getResources().getIdentifier( + weatherSymbol > 100 ? "s_"+(weatherSymbol-100) : "s_"+weatherSymbol, + "string", + context.getPackageName() + ); + timeStep.setContentDescription(R.id.weatherIconImageView, context.getString(symbolId)); + + if (i == TIMESTEP_COUNT - 1) { + timeStep.setViewVisibility(R.id.forecastBorder, View.GONE); + } - forecastContainer.ap + widgetRemoteViews.addView(R.id.hourForecastRowLayout, timeStep); } - // Update time TODO: should be hidden for release - widgetRemoteViews.setTextViewText(R.id.updateTimeTextView, DateFormat.getTimeInstance().format(new Date())); - // Crisis view showCrisisViewIfNeeded(announcementsJson, widgetRemoteViews, pref); diff --git a/android/app/src/main/res/layout/forecast_timestep.xml b/android/app/src/main/res/layout/forecast_timestep.xml index 66663abd..40939310 100644 --- a/android/app/src/main/res/layout/forecast_timestep.xml +++ b/android/app/src/main/res/layout/forecast_timestep.xml @@ -13,11 +13,11 @@ android:orientation="vertical"> + style="@style/time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|top" + tools:text="13:00" /> diff --git a/android/app/src/main/res/layout/large_forecast_widget_layout.xml b/android/app/src/main/res/layout/large_forecast_widget_layout.xml index 5735432a..8fd1318c 100644 --- a/android/app/src/main/res/layout/large_forecast_widget_layout.xml +++ b/android/app/src/main/res/layout/large_forecast_widget_layout.xml @@ -53,6 +53,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:src="@drawable/fmi_logo_blue" + android:contentDescription="" android:visibility="gone" /> - - Date: Wed, 11 Dec 2024 09:52:30 +0200 Subject: [PATCH 04/12] issue-714: Added accessibility labels to small and max widgets --- .../fi/fmi/mobileweather/BaseWidgetProvider.java | 16 ++++++++++++---- .../LargeForecastWidgetProvider.java | 7 +------ .../mobileweather/MaxForecastWidgetProvider.java | 4 ++-- .../res/layout/max_forecast_widget_layout.xml | 14 +++++++------- .../res/layout/small_forecast_widget_layout.xml | 11 ----------- 5 files changed, 22 insertions(+), 30 deletions(-) diff --git a/android/app/src/main/java/fi/fmi/mobileweather/BaseWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/BaseWidgetProvider.java index ce559630..c7df4917 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/BaseWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/BaseWidgetProvider.java @@ -357,12 +357,10 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe // ** set the weather icon - String weatherSymbol = first.getString("smartSymbol"); + int weatherSymbol = first.getInt("smartSymbol"); int drawableResId = context.getResources().getIdentifier("s_" + weatherSymbol + (theme.equals(LIGHT) ? "_light" : "_dark"), "drawable", context.getPackageName()); widgetRemoteViews.setImageViewResource(R.id.weatherIconImageView, drawableResId); - - // Update time TODO: should be hidden for release - widgetRemoteViews.setTextViewText(R.id.updateTimeTextView, DateFormat.getTimeInstance().format(new Date())); + widgetRemoteViews.setContentDescription(R.id.weatherIconImageView, getSymbolTranslation(weatherSymbol)); // Crisis view showCrisisViewIfNeeded(announcementsJson, widgetRemoteViews, pref); @@ -785,4 +783,14 @@ protected int getFirstFutureTimeIndex(JSONArray data) throws JSONException { // if no future time found return -1; } + + protected String getSymbolTranslation(int symbol) { + // > 100 is night version, but we can use day symbol translation + int symbolId = context.getResources().getIdentifier( + symbol > 100 ? "s_"+(symbol-100) : "s_"+symbol, + "string", + context.getPackageName() + ); + return context.getString(symbolId); + } } \ No newline at end of file diff --git a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java index 7e0a70bd..d3ddacf7 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java @@ -84,12 +84,7 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe int drawableResId = context.getResources().getIdentifier("s_" + weatherSymbol + (theme.equals(LIGHT) ? "_light" : "_dark"), "drawable", context.getPackageName()); timeStep.setImageViewResource(R.id.weatherIconImageView, drawableResId); - int symbolId = context.getResources().getIdentifier( - weatherSymbol > 100 ? "s_"+(weatherSymbol-100) : "s_"+weatherSymbol, - "string", - context.getPackageName() - ); - timeStep.setContentDescription(R.id.weatherIconImageView, context.getString(symbolId)); + timeStep.setContentDescription(R.id.weatherIconImageView, getSymbolTranslation(weatherSymbol)); if (i == TIMESTEP_COUNT - 1) { timeStep.setViewVisibility(R.id.forecastBorder, View.GONE); diff --git a/android/app/src/main/java/fi/fmi/mobileweather/MaxForecastWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/MaxForecastWidgetProvider.java index dd4c5f32..df743316 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/MaxForecastWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/MaxForecastWidgetProvider.java @@ -92,7 +92,7 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe // time at the selected location String localTime = forecast.getString("localtime"); String temperature = forecast.getString("temperature"); - String weatherSymbol = forecast.getString("smartSymbol"); + int weatherSymbol = forecast.getInt("smartSymbol"); // j = weather row layout index int j = i - 1; @@ -112,6 +112,7 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe int drawableResId = context.getResources().getIdentifier("s_" + weatherSymbol + (theme.equals(LIGHT) ? "_light" : "_dark"), "drawable", context.getPackageName()); widgetRemoteViews.setImageViewResource(weatherIconImageViewId, drawableResId); + widgetRemoteViews.setContentDescription(weatherIconImageViewId, getSymbolTranslation(weatherSymbol)); } // Get the current time @@ -137,7 +138,6 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe widgetRemoteViews.setTextViewText(R.id.updateTimeTextView, formattedText); - // Crisis view showCrisisViewIfNeeded(announcementsJson, widgetRemoteViews, pref); diff --git a/android/app/src/main/res/layout/max_forecast_widget_layout.xml b/android/app/src/main/res/layout/max_forecast_widget_layout.xml index 4618be98..79685d1c 100644 --- a/android/app/src/main/res/layout/max_forecast_widget_layout.xml +++ b/android/app/src/main/res/layout/max_forecast_widget_layout.xml @@ -67,7 +67,7 @@ android:layout_width="46dp" android:layout_height="46dp" android:layout_marginEnd="18dp" - android:contentDescription="TODO" + android:contentDescription="" tools:src="@drawable/s_32_light" /> - - Date: Wed, 11 Dec 2024 10:09:13 +0200 Subject: [PATCH 05/12] issue-714: Added final keyword to constant int --- .../java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java index d3ddacf7..ef7d0205 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java @@ -21,7 +21,7 @@ protected int getLayoutResourceId() { // populate widget with data @Override protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelper pref, WidgetInitResult widgetInitResult) { - int TIMESTEP_COUNT = 5; + final int TIMESTEP_COUNT = 5; JSONObject forecastJson = widgetInitResult.forecastJson(); RemoteViews widgetRemoteViews = widgetInitResult.widgetRemoteViews(); String theme = widgetInitResult.theme(); From 1fea51e28ac94f033eefab81062c821f096d2293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Ker=C3=A4nen?= Date: Wed, 11 Dec 2024 12:49:45 +0200 Subject: [PATCH 06/12] issue-717: Removed unnecessary files --- .../app/src/main/res/layout/weathercell.xml | 30 ---------- .../src/main/res/layout/weathercellsmall.xml | 35 ----------- android/app/src/main/res/layout/widgetng.xml | 60 ------------------- .../res/xml/large_widget_provider_info.xml | 8 +-- 4 files changed, 4 insertions(+), 129 deletions(-) delete mode 100644 android/app/src/main/res/layout/weathercell.xml delete mode 100644 android/app/src/main/res/layout/weathercellsmall.xml delete mode 100644 android/app/src/main/res/layout/widgetng.xml diff --git a/android/app/src/main/res/layout/weathercell.xml b/android/app/src/main/res/layout/weathercell.xml deleted file mode 100644 index 1d7cc7b1..00000000 --- a/android/app/src/main/res/layout/weathercell.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - diff --git a/android/app/src/main/res/layout/weathercellsmall.xml b/android/app/src/main/res/layout/weathercellsmall.xml deleted file mode 100644 index 8f20e6ef..00000000 --- a/android/app/src/main/res/layout/weathercellsmall.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - diff --git a/android/app/src/main/res/layout/widgetng.xml b/android/app/src/main/res/layout/widgetng.xml deleted file mode 100644 index fd0fb872..00000000 --- a/android/app/src/main/res/layout/widgetng.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/android/app/src/main/res/xml/large_widget_provider_info.xml b/android/app/src/main/res/xml/large_widget_provider_info.xml index 43724d14..923e9f41 100644 --- a/android/app/src/main/res/xml/large_widget_provider_info.xml +++ b/android/app/src/main/res/xml/large_widget_provider_info.xml @@ -2,12 +2,12 @@ From 81135d5a6d37a94ee440374d3cf6571a2828a317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Ker=C3=A4nen?= Date: Wed, 11 Dec 2024 13:59:21 +0200 Subject: [PATCH 07/12] issue-717: Layout experiments --- .../main/res/layout/large_forecast_widget_layout.xml | 8 +++++++- .../main/res/xml-v31/large_widget_provider_info.xml | 11 +++++++++++ .../src/main/res/xml/large_widget_provider_info.xml | 6 ++---- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 android/app/src/main/res/xml-v31/large_widget_provider_info.xml diff --git a/android/app/src/main/res/layout/large_forecast_widget_layout.xml b/android/app/src/main/res/layout/large_forecast_widget_layout.xml index 38e02397..fd83d4c2 100644 --- a/android/app/src/main/res/layout/large_forecast_widget_layout.xml +++ b/android/app/src/main/res/layout/large_forecast_widget_layout.xml @@ -44,13 +44,15 @@ android:id="@+id/hourForecastRowLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="horizontal"> + android:orientation="horizontal" + > + + diff --git a/android/app/src/main/res/xml/large_widget_provider_info.xml b/android/app/src/main/res/xml/large_widget_provider_info.xml index 923e9f41..092b3c3c 100644 --- a/android/app/src/main/res/xml/large_widget_provider_info.xml +++ b/android/app/src/main/res/xml/large_widget_provider_info.xml @@ -2,10 +2,8 @@ Date: Thu, 12 Dec 2024 09:34:46 +0200 Subject: [PATCH 08/12] issue-717: More widget size experiments --- .../layout/large_forecast_widget_layout.xml | 25 +++++-------------- .../res/layout/max_forecast_widget_layout.xml | 4 +-- .../xml-v31/large_widget_provider_info.xml | 2 +- .../res/xml-v31/max_widget_provider_info.xml | 11 ++++++++ .../xml-v31/small_widget_provider_info.xml | 15 +++++++++++ .../main/res/xml/max_widget_provider_info.xml | 2 -- .../res/xml/small_widget_provider_info.xml | 4 --- 7 files changed, 35 insertions(+), 28 deletions(-) create mode 100644 android/app/src/main/res/xml-v31/max_widget_provider_info.xml create mode 100644 android/app/src/main/res/xml-v31/small_widget_provider_info.xml diff --git a/android/app/src/main/res/layout/large_forecast_widget_layout.xml b/android/app/src/main/res/layout/large_forecast_widget_layout.xml index fd83d4c2..ad92f87d 100644 --- a/android/app/src/main/res/layout/large_forecast_widget_layout.xml +++ b/android/app/src/main/res/layout/large_forecast_widget_layout.xml @@ -1,8 +1,8 @@ @@ -17,7 +17,9 @@ android:id="@+id/locationLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="horizontal"> + android:orientation="horizontal" + android:gravity="top" + > - - diff --git a/android/app/src/main/res/xml-v31/large_widget_provider_info.xml b/android/app/src/main/res/xml-v31/large_widget_provider_info.xml index f5aa42c8..7ca86ce5 100644 --- a/android/app/src/main/res/xml-v31/large_widget_provider_info.xml +++ b/android/app/src/main/res/xml-v31/large_widget_provider_info.xml @@ -3,7 +3,7 @@ android:configure="fi.fmi.mobileweather.LargeForecastWidgetConfigurationActivity" android:initialLayout="@layout/large_forecast_widget_layout" android:targetCellWidth="4" - android:targetCellHeight="2" + android:targetCellHeight="1" android:previewImage="@drawable/large_forecast_widget_preview" android:resizeMode="none" android:updatePeriodMillis="0" diff --git a/android/app/src/main/res/xml-v31/max_widget_provider_info.xml b/android/app/src/main/res/xml-v31/max_widget_provider_info.xml new file mode 100644 index 00000000..c798f178 --- /dev/null +++ b/android/app/src/main/res/xml-v31/max_widget_provider_info.xml @@ -0,0 +1,11 @@ + + + diff --git a/android/app/src/main/res/xml-v31/small_widget_provider_info.xml b/android/app/src/main/res/xml-v31/small_widget_provider_info.xml new file mode 100644 index 00000000..bd88c604 --- /dev/null +++ b/android/app/src/main/res/xml-v31/small_widget_provider_info.xml @@ -0,0 +1,15 @@ + + + diff --git a/android/app/src/main/res/xml/max_widget_provider_info.xml b/android/app/src/main/res/xml/max_widget_provider_info.xml index e6099888..6d25b263 100644 --- a/android/app/src/main/res/xml/max_widget_provider_info.xml +++ b/android/app/src/main/res/xml/max_widget_provider_info.xml @@ -6,8 +6,6 @@ android:minHeight="100dp" android:previewImage="@drawable/max_forecast_widget_preview" android:resizeMode="none" - android:targetCellWidth="4" - android:targetCellHeight="3" android:updatePeriodMillis="0" android:widgetCategory="home_screen"> diff --git a/android/app/src/main/res/xml/small_widget_provider_info.xml b/android/app/src/main/res/xml/small_widget_provider_info.xml index bd88c604..c74651b7 100644 --- a/android/app/src/main/res/xml/small_widget_provider_info.xml +++ b/android/app/src/main/res/xml/small_widget_provider_info.xml @@ -2,14 +2,10 @@ From 59eb9abdb1d5da9529837adb45dc26ee259a3d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Ker=C3=A4nen?= Date: Fri, 13 Dec 2024 08:21:37 +0200 Subject: [PATCH 09/12] issue-714: Improved large and max widget layouts --- .../fmi/mobileweather/BaseWidgetProvider.java | 10 + .../LargeForecastWidgetProvider.java | 11 +- .../MaxForecastWidgetProvider.java | 29 +- .../res/layout/forecast_symbol_column.xml | 38 +++ .../src/main/res/layout/forecast_timestep.xml | 14 +- .../res/layout/large_forecast_timestep.xml | 38 +++ .../layout/large_forecast_widget_layout.xml | 9 +- .../res/layout/max_forecast_widget_layout.xml | 315 ++---------------- android/app/src/main/res/values/styles.xml | 9 +- 9 files changed, 162 insertions(+), 311 deletions(-) create mode 100644 android/app/src/main/res/layout/forecast_symbol_column.xml create mode 100644 android/app/src/main/res/layout/large_forecast_timestep.xml diff --git a/android/app/src/main/java/fi/fmi/mobileweather/BaseWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/BaseWidgetProvider.java index 95bf3277..ef7baeab 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/BaseWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/BaseWidgetProvider.java @@ -20,6 +20,7 @@ import android.content.pm.PackageManager; import android.graphics.Color; import android.location.Location; +import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.util.Log; @@ -645,6 +646,7 @@ protected void setColors(RemoteViews remoteViews, int backgroundResource, int ba } protected void setWeatherRowColors(RemoteViews remoteViews, int textColor) { + /* int[] timeTextViews = { R.id.timeTextView0, R.id.timeTextView1, R.id.timeTextView2, R.id.timeTextView3, R.id.timeTextView4 @@ -660,6 +662,7 @@ protected void setWeatherRowColors(RemoteViews remoteViews, int textColor) { for (int textView : temperatureTextViews) { remoteViews.setInt(textView, "setTextColor", textColor); } + */ } protected String addPlusIfNeeded(String temperature) { @@ -846,4 +849,11 @@ protected String getSymbolTranslation(int symbol) { ); return context.getString(symbolId); } + + protected int getWidgetWidthInPixels(int appWidgetId) { + Bundle options = appWidgetManager.getAppWidgetOptions(appWidgetId); + int minWidth = options.getInt(appWidgetManager.OPTION_APPWIDGET_MIN_WIDTH); + return minWidth; + } + } \ No newline at end of file diff --git a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java index eb171ea6..dc4803d7 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/LargeForecastWidgetProvider.java @@ -2,6 +2,7 @@ import static fi.fmi.mobileweather.Theme.LIGHT; +import android.os.Bundle; import android.util.Log; import android.widget.RemoteViews; import android.view.View; @@ -21,11 +22,13 @@ protected int getLayoutResourceId() { // populate widget with data @Override protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelper pref, WidgetInitResult widgetInitResult, int appWidgetId) { - final int TIMESTEP_COUNT = 5; JSONObject forecastJson = widgetInitResult.forecastJson(); RemoteViews widgetRemoteViews = widgetInitResult.widgetRemoteViews(); String theme = widgetInitResult.theme(); - + + final int timeStepCount = getWidgetWidthInPixels(appWidgetId) > 380 ? 7 : 6; + Log.d("widgetWidth", String.valueOf(getWidgetWidthInPixels(appWidgetId))); + // set colors for views which are specific for large widget // (not set in the initWidget) setLargeWidgetSpecificColors(widgetRemoteViews, theme); @@ -55,7 +58,7 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe widgetRemoteViews.removeAllViews(R.id.hourForecastRowLayout); // handle the first 5 JsonObjects with future time - for (int i = firstFutureTimeIndex; i < (firstFutureTimeIndex + TIMESTEP_COUNT); i++) { + for (int i = firstFutureTimeIndex; i < (firstFutureTimeIndex + timeStepCount); i++) { JSONObject forecast = data.getJSONObject(i); // if first future index @@ -86,7 +89,7 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe timeStep.setImageViewResource(R.id.weatherIconImageView, drawableResId); timeStep.setContentDescription(R.id.weatherIconImageView, getSymbolTranslation(weatherSymbol)); - if (i == TIMESTEP_COUNT - 1) { + if (i == timeStepCount - 1) { timeStep.setViewVisibility(R.id.forecastBorder, View.GONE); } diff --git a/android/app/src/main/java/fi/fmi/mobileweather/MaxForecastWidgetProvider.java b/android/app/src/main/java/fi/fmi/mobileweather/MaxForecastWidgetProvider.java index 59897820..08a1e78f 100644 --- a/android/app/src/main/java/fi/fmi/mobileweather/MaxForecastWidgetProvider.java +++ b/android/app/src/main/java/fi/fmi/mobileweather/MaxForecastWidgetProvider.java @@ -10,6 +10,7 @@ import android.graphics.Color; import android.text.Html; import android.util.Log; +import android.view.View; import android.widget.RemoteViews; import org.json.JSONArray; @@ -33,6 +34,9 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe JSONObject forecastJson = widgetInitResult.forecastJson(); RemoteViews widgetRemoteViews = widgetInitResult.widgetRemoteViews(); String theme = widgetInitResult.theme(); + final int timeStepCount = getWidgetWidthInPixels(appWidgetId) > 380 ? 8 : 7; + + Log.d("widgetWidth", String.valueOf(getWidgetWidthInPixels(appWidgetId))); // set colors for views which are specific for large and max widgets // (not set in the initWidget) @@ -61,8 +65,10 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe throw new Exception("No future time found or less than 6 future times available"); } + widgetRemoteViews.removeAllViews(R.id.forecastContainer); + // handle the first 6 JsonObjects with future time - for (int i = firstFutureTimeIndex; i < (firstFutureTimeIndex + 6); i++) { + for (int i = firstFutureTimeIndex; i < (firstFutureTimeIndex + timeStepCount); i++) { JSONObject forecast = data.getJSONObject(i); // if first future index set main part of the widget @@ -78,16 +84,18 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe widgetRemoteViews.setTextViewText(R.id.timeTextView, formattedTime); String temperature = forecast.getString("temperature"); - String weatherSymbol = forecast.getString("smartSymbol"); + int weatherSymbol = forecast.getInt("smartSymbol"); widgetRemoteViews.setTextViewText(R.id.temperatureTextView, addPlusIfNeeded(temperature) + "°"); int drawableResId = context.getResources().getIdentifier("s_" + weatherSymbol + (theme.equals(LIGHT) ? "_light" : "_dark"), "drawable", context.getPackageName()); widgetRemoteViews.setImageViewResource(R.id.weatherIconImageView, drawableResId); + widgetRemoteViews.setContentDescription(R.id.weatherIconImageView, getSymbolTranslation(weatherSymbol)); // next iteration in loop continue; } + RemoteViews timeStep = new RemoteViews(context.getPackageName(), R.layout.large_forecast_timestep); // time at the selected location String localTime = forecast.getString("localtime"); @@ -97,22 +105,19 @@ protected void setWidgetData(JSONArray announcementsJson, SharedPreferencesHelpe // j = weather row layout index int j = i - 1; - // get timeTextView0 or timeTextView1 etc. based on i from widgetRemoteViews - int timeTextViewId = context.getResources().getIdentifier("timeTextView" + j, "id", context.getPackageName()); - int temperatureTextViewId = context.getResources().getIdentifier("temperatureTextView" + j, "id", context.getPackageName()); - int weatherIconImageViewId = context.getResources().getIdentifier("weatherIconImageView" + j, "id", context.getPackageName()); - // ** set the time, temperature and weather icon String formattedTime = getFormattedWeatherTime(localTime); - widgetRemoteViews.setTextViewText(timeTextViewId, formattedTime); + timeStep.setTextViewText(R.id.timeTextView, formattedTime); temperature = addPlusIfNeeded(temperature); - widgetRemoteViews.setTextViewText(temperatureTextViewId, temperature + "°"); + timeStep.setTextViewText(R.id.temperatureTextView, temperature + "°"); int drawableResId = context.getResources().getIdentifier("s_" + weatherSymbol + (theme.equals(LIGHT) ? "_light" : "_dark"), "drawable", context.getPackageName()); - widgetRemoteViews.setImageViewResource(weatherIconImageViewId, drawableResId); - widgetRemoteViews.setContentDescription(weatherIconImageViewId, getSymbolTranslation(weatherSymbol)); + timeStep.setImageViewResource(R.id.weatherIconImageView, drawableResId); + timeStep.setContentDescription(R.id.weatherIconImageView, getSymbolTranslation(weatherSymbol)); + + widgetRemoteViews.addView(R.id.forecastContainer, timeStep); } // Get the current time @@ -168,12 +173,14 @@ private void setMaxWidgetSpecificColors(RemoteViews remoteViews, String theme) { int logoIcon = isDarkOrGradient ? R.drawable.fmi_logo_white : R.drawable.fmi_logo_blue; remoteViews.setInt(R.id.timeTextView, "setTextColor", textColor); + /* remoteViews.setViewVisibility(R.id.verticalBarImageView0, visibility); remoteViews.setViewVisibility(R.id.verticalBarImageView1, visibility); remoteViews.setImageViewResource(R.id.clockSymbolImageView, clockIcon); remoteViews.setImageViewResource(R.id.weatherSymbolImageView, weatherIcon); remoteViews.setImageViewResource(R.id.temperatureSymbolImageView, temperatureIcon); remoteViews.setImageViewResource(R.id.logoImageView, logoIcon); + */ } } diff --git a/android/app/src/main/res/layout/forecast_symbol_column.xml b/android/app/src/main/res/layout/forecast_symbol_column.xml new file mode 100644 index 00000000..a04b506c --- /dev/null +++ b/android/app/src/main/res/layout/forecast_symbol_column.xml @@ -0,0 +1,38 @@ + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/layout/forecast_timestep.xml b/android/app/src/main/res/layout/forecast_timestep.xml index 40939310..e83033cb 100644 --- a/android/app/src/main/res/layout/forecast_timestep.xml +++ b/android/app/src/main/res/layout/forecast_timestep.xml @@ -4,25 +4,25 @@ android:id="@+id/forecastTimeStep" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="6dp" - android:layout_marginBottom="6dp" android:orientation="horizontal"> - + android:orientation="vertical" + android:paddingHorizontal="3dp"> diff --git a/android/app/src/main/res/layout/large_forecast_timestep.xml b/android/app/src/main/res/layout/large_forecast_timestep.xml new file mode 100644 index 00000000..2b044ee1 --- /dev/null +++ b/android/app/src/main/res/layout/large_forecast_timestep.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + diff --git a/android/app/src/main/res/layout/large_forecast_widget_layout.xml b/android/app/src/main/res/layout/large_forecast_widget_layout.xml index 93f40661..d32f948d 100644 --- a/android/app/src/main/res/layout/large_forecast_widget_layout.xml +++ b/android/app/src/main/res/layout/large_forecast_widget_layout.xml @@ -5,7 +5,9 @@ android:layout_height="match_parent" android:background="@android:color/white" android:orientation="vertical" - android:padding="16dp"> + android:paddingVertical="8dp" + android:paddingHorizontal="16dp" + > + android:paddingHorizontal="3dp" + android:layout_marginBottom="8dp" > diff --git a/android/app/src/main/res/layout/max_forecast_widget_layout.xml b/android/app/src/main/res/layout/max_forecast_widget_layout.xml index e676d641..f1d761a9 100644 --- a/android/app/src/main/res/layout/max_forecast_widget_layout.xml +++ b/android/app/src/main/res/layout/max_forecast_widget_layout.xml @@ -10,7 +10,7 @@ @@ -88,265 +88,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + + + - - - + android:background="#F6F6F7"> + + + - - - - - - + + - + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:orientation="horizontal" + android:layout_marginHorizontal="6dp" /> - - + - - - - - - - - @@ -43,8 +44,8 @@ @@ -78,8 +79,8 @@