From f4c7d280d76624dd83727de24202f204752de681 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Sat, 1 Oct 2022 22:18:19 +0200 Subject: [PATCH] [android] use numbers for transit intermediate points Signed-off-by: Arnaud Vergnet --- .../drawable-hdpi/ic_24px_route_point_a.webp | Bin 426 -> 0 bytes .../drawable-hdpi/ic_24px_route_point_b.webp | Bin 398 -> 0 bytes .../drawable-hdpi/ic_24px_route_point_c.webp | Bin 438 -> 0 bytes .../drawable-mdpi/ic_24px_route_point_a.webp | Bin 266 -> 0 bytes .../drawable-mdpi/ic_24px_route_point_b.webp | Bin 276 -> 0 bytes .../drawable-mdpi/ic_24px_route_point_c.webp | Bin 302 -> 0 bytes .../drawable-xhdpi/ic_24px_route_point_a.webp | Bin 502 -> 0 bytes .../drawable-xhdpi/ic_24px_route_point_b.webp | Bin 478 -> 0 bytes .../drawable-xhdpi/ic_24px_route_point_c.webp | Bin 526 -> 0 bytes .../ic_24px_route_point_a.webp | Bin 794 -> 0 bytes .../ic_24px_route_point_b.webp | Bin 714 -> 0 bytes .../ic_24px_route_point_c.webp | Bin 808 -> 0 bytes .../ic_24px_route_point_a.webp | Bin 1034 -> 0 bytes .../ic_24px_route_point_b.webp | Bin 946 -> 0 bytes .../ic_24px_route_point_c.webp | Bin 1062 -> 0 bytes android/res/values/colors.xml | 1 - .../maps/routing/TransitStepType.java | 2 +- .../maps/routing/TransitStepView.java | 70 +++++++----------- 18 files changed, 29 insertions(+), 44 deletions(-) delete mode 100644 android/res/drawable-hdpi/ic_24px_route_point_a.webp delete mode 100644 android/res/drawable-hdpi/ic_24px_route_point_b.webp delete mode 100644 android/res/drawable-hdpi/ic_24px_route_point_c.webp delete mode 100644 android/res/drawable-mdpi/ic_24px_route_point_a.webp delete mode 100644 android/res/drawable-mdpi/ic_24px_route_point_b.webp delete mode 100644 android/res/drawable-mdpi/ic_24px_route_point_c.webp delete mode 100644 android/res/drawable-xhdpi/ic_24px_route_point_a.webp delete mode 100644 android/res/drawable-xhdpi/ic_24px_route_point_b.webp delete mode 100644 android/res/drawable-xhdpi/ic_24px_route_point_c.webp delete mode 100644 android/res/drawable-xxhdpi/ic_24px_route_point_a.webp delete mode 100644 android/res/drawable-xxhdpi/ic_24px_route_point_b.webp delete mode 100644 android/res/drawable-xxhdpi/ic_24px_route_point_c.webp delete mode 100644 android/res/drawable-xxxhdpi/ic_24px_route_point_a.webp delete mode 100644 android/res/drawable-xxxhdpi/ic_24px_route_point_b.webp delete mode 100644 android/res/drawable-xxxhdpi/ic_24px_route_point_c.webp diff --git a/android/res/drawable-hdpi/ic_24px_route_point_a.webp b/android/res/drawable-hdpi/ic_24px_route_point_a.webp deleted file mode 100644 index 3ac6a7b2984ddaad3e8591db916d115f4210ca34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 426 zcmV;b0agA|Nk&GZ0RRA3MM6+kP&iDL0RR9mBftm{M`9ptoA@_qcdLq<>o03Qha01N;K0_PGC6%zoF2Ou~G99}?> zP$7|oix)&xg8&Q=WZO>L{4isgG0e;i)&7^%%1@5Efv1T6GjQ8T(c~C2v+xM{2O^nV zkvSK+;7YbMQyyletiPjF`>Y_Yo$|51AC!^3GaUsx$`>7n*Rk@6gNxzVaERVe7vMZ= zYJW-WogQs0GpTcmJ=)ruHMB=wc!fRA*}o`Zm8FneVUv=OoMDqMA^D9>WF z!E|yh>~7c<-awh0;gPj?39OM##_*vs2$qpe1h?If6Mi;GehQtpX|%ROePASvofJtI z7Y@BPrQa3xr6=Kw(s&a-Dh*Fx0)4Vp;aq7fDy%9EPoK2Zx9yA(+8Jw>#;ldGuf5>o UV|yoNtjtBEl{rnrFgIET0Ms49lK=n! diff --git a/android/res/drawable-hdpi/ic_24px_route_point_b.webp b/android/res/drawable-hdpi/ic_24px_route_point_b.webp deleted file mode 100644 index 23e842bc0f18189adf3cda872b73ca51868ac7f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 398 zcmV;90df9PNk&G70RRA3MM6+kP&iC^0RR9mBftm{KSGdgQ-A4araaz0H9!4js!3$fJ=iy20=g|aG*H=8w`OzG1%v_bO{~@ zo;bmo2?0QmZ98rA!pupz4Ks7O4Ql^eq9<9|Kt%r;xNRH9>fLVhdOZR+Ad$^iD*0?8 zKufN*5eA!9&aIRlUIgVbOgqH-QCKqI5CRxI2Vr0X|R+nMfQXUfcZfB5JZQx zuAynH|;AjXG2ttIo>|&?ROzkhHkMu~-B^@|&1xNgGak38l4Z#n?-1Pwv`^ s&X|>iu_rz4Z9iuOe$JYwGwbE-YY#ZQ>`;dlKX(z}<4)6HcjFBJ0L22en*aa+ diff --git a/android/res/drawable-hdpi/ic_24px_route_point_c.webp b/android/res/drawable-hdpi/ic_24px_route_point_c.webp deleted file mode 100644 index c99d840b9ff19d55794f1f10bed7d980a54848de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 438 zcmV;n0ZIN+Nk&Gl0RRA3MM6+kP&iDY0RR9mBftm{uVNr=oA@_uOYbQB;31j7Ihm|;j1!3G!=iG|{~ z_gwtuVnOIQiE{yf0fKE?%aUi)ownG7t%R*~*Ej#U{PEt$#{}*l(SHVR+cvVVyLYF~ zN6;GVOJwq12EG+)QkAB1*{h`Va-sA-fnMRzFCl}Bc#~%_zF2t4%-aL!m)@IF4Q&%n*jpiV}_+- ztHoeUBZT{@>g^M*7?`FNqFnk!I8m0ngfK_rBOGuPr-XM0!1X0Y3{8Si;FKo(Dh+1{ zC5~d3(9uy|&^Do~qnuDk5&m_Q5xN``J{$ngkKTl#NeCY*6E2kHJ|Vy@x=&cUp^vue zOEo$ooG~y>aSvFF2Y=G~S#ZFxROG$%y64zS*+1p7YcC0Vviopexcg*jtBzo3Z<{$I gFmu)nomn$y-+n>W=z)ms?vIHy1?0_Jd0^@*^WQ0Or z#}psa{c`a_4>yio47|X*M6evkLPQc1pXh0rA0lBI4?4;DeRfFCnKHEJOm9!){x#l9 Q<9#*$1Fruc;PQXF1RuzLr2qf` diff --git a/android/res/drawable-mdpi/ic_24px_route_point_b.webp b/android/res/drawable-mdpi/ic_24px_route_point_b.webp deleted file mode 100644 index 4b1ad3388c5832f7b0eaf96fd52cf83fa16db75b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 276 zcmV+v0qg!!Nk&Et0RRA3MM6+kP&iEg0000l7r+G&m!TkS11A1W@2Hsn`B&JsksA7A zeo~vZ0W+rO4y=q&000OXf~^Sw0D*vTG#CT~0-#_36a|A}L-z$A1%TiHq1Y%ia3_8b z4s6?2l1qc#MR$Y#`HxQDfB0t*(SHVR8!1Yc_h9H1P?hbM-86NjZ}TfX8ib@F(wXkH zf>rCuy%!7WY18>NUFts~@rNP+HvL*?S=Q=QQ3f0EsR;qLmkqRH+`P55U)(ssI4;6nT6A diff --git a/android/res/drawable-mdpi/ic_24px_route_point_c.webp b/android/res/drawable-mdpi/ic_24px_route_point_c.webp deleted file mode 100644 index 9b02507ba28e581c20662493bd8032f342cfb798..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 302 zcmV+}0nz?aNk&E{0RRA3MM6+kP&iB)0RR9m7r+G&=RuHdQ-A4ardJF`FAxr=VK?5NWHx&Lds0>EnbQd)j zA{PJvf^6Gqo0k}ZDmSQd)rQRMy!~%1U&>?$5&fS4+>>CNo%P+2eqT~ zPFYmSD^n$SJ6^r>E;OxuW1$8xDy8^29Nhg#sRx-p=B<^Ddy$Yf=SS?c8<>c2AeKQhRV7ElgC`ky(szYa5q; A`~Uy| diff --git a/android/res/drawable-xhdpi/ic_24px_route_point_a.webp b/android/res/drawable-xhdpi/ic_24px_route_point_a.webp deleted file mode 100644 index 428ac781cd5222def6fbe788d5416ac34eb9293c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 502 zcmV_~3_vLI;5QQadCZ0tUiB0LUl< z0~sMYu!K{1!40r%+fJlB+?_zX;?jn@J7oUzNmX9bYw>>)(fnJSQv>=SVs~(+i)gI8Y zsUdKn`gXols{&UkT?nkJzMMzRoxoyBDIsvLd2~)RErE?)APKZJCr(H4H!I$=e~ON? zr5K=0iY><|Dgu);nG*tKg>gony*|eUE^X$Oz}Sb^^N7Qt*RjB&&0Q8a^g=QVUYi2V zytcrGS0Rg2k0${x^KJkhJWeIoctkdNbcX}+TzVUZH+(4k#-kwq)p&?@Cl;cw{>Gpx sAq#Ke-jJ|M-B2t^aB~&{BT)-S&wd;gB>ITi>YO}&r^l1dmO=hs0Hy!sn*aa+ diff --git a/android/res/drawable-xhdpi/ic_24px_route_point_b.webp b/android/res/drawable-xhdpi/ic_24px_route_point_b.webp deleted file mode 100644 index 91f2170248da9197637f476e8df7dd859bcf7ab3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 478 zcmV<40U`cUNk&H20RRA3MM6+kP&iD=0RR9mFTe{BcVZxIoA@_Y>ye4V(Iq zGE4DnzT<+Cw{c9_3Bt%7ys9t`glyl5_pQj)%tgeNKvpAzb*0h4u(NouK?i;J3Hu0n zb)OOeMn5SQRf1Z($tRcpUS^!if=d@%r_j9*hT5cp9JZ>Ae8N(Px1Ix1e^v=NV|13h z3*~LA|40COVQRdT*mRA6IwR#hh)q@q7%(2ZlGOa30PC0~uPLy0qt}0r3D{|Hn%+oY z@p;>EN8T_3es?)TuPLzctooEbCg60&XnG}qZS^My1UxfJ-h-Il5}=F+FC}+Jz%?V~ z8L{yp0Y!%KmO8x6ch$Gd5do-$b(TEjd7-y1JWq*MZu#$&VUti1S>6Bjzu}l=T4;iz zVi8_H2Pp8M{~7uSft|&JrSPkGAZ|7mh<`PUfh&@|0XtSA)M}7V%x3`qwdM$z4Et{kmqE_lg`L{roBW31uP;D9SYnLMHD;| z=ptO9SvwicVYb6bXf6{*jpYBw@99iLs_H@X>wFc!*4Lrrq2iQ;zb{a^c3JR9m-Phy zPrx;TZpnfb7yzhWKgMSOmY;Zb!BND|HvqKBZ2WDH1!KOmmKVTqaOOm9>Q7`kZn3<(xF|%}h%S__>|6jPt?x~t-GrdOiAA;L9lB8%d z_o3~rPNnJz>Rl$cwSAW_cb=a+<^0|DR!;dsaQ>`7t`yGZgI?bo*sBne%HDvN_l7QB zNWja*kXQHOhp!~$^)T*9ZdS8?k$U`clf}HM>r*xySAv z1%3}BL;sn05{O+Ib3jt(uF>pHAoem~iaioAgJvrdvpquwC1+46fNG(dK&=wgW1a+j zQyTjcw|S*;CQy4DR2ris;7n;01ZuyOfjW-*7^-r%S43#AoZ6m_$-Z&V0GmvoP)w= zw&1hy!BfhS3d3aD4m%EM_Fvk;V87)aq?S-(5hT8I4e>4fFIokuog#oke4T5EU&J2& z^^jr^ZZH*b{Ik!;LryC8bcP3sT^}ZRG0rp8>I1i4MAamrZ_%dJ$Mt?E|HcM_YYalb}s(4{c zi~1#d`ZtUENqhQRWlz6tQU7nxdPLc?K2r9q*OWc$M`h1?R@t+@R?3?7zEXDVKWGeH Y%JxGphm?0%u|K0>$$pUrXaDM523B{50RR91 diff --git a/android/res/drawable-xxhdpi/ic_24px_route_point_b.webp b/android/res/drawable-xxhdpi/ic_24px_route_point_b.webp deleted file mode 100644 index 5bbf20c147f023496bb84749051c88da436af69a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 714 zcmV;*0yX_oNk&G(0ssJ4MM6+kP&iDs0ssInN5ByfM}wek+n7J;x7|U^|NJX#+qO+b za`#Z=wr!Jj>R`TsdIR7lSVD;T6VL#H^j;MOK#YEXT?0f%gGcH_urUyLsQD1|of`#U zow$iJDsg>z`LB~%g1CoSM7GIxpeaJav5C7=y4>2+GHZfqtbgTo&qvc@T^Gg zZA5!$kY02{YH!xpN5k}evm$j?M1d5~%=adOD3suYVXdT5ENQdX+$x}83R?!XUqjK< z_WAot32xlol>&;Vz zMk!#uYiJlTv3knq^SRXbhbe0KgJ&2~$(RsQEdGrXjgLITj8e-e0bUc0Q>NlF<&x*5 zhyGuVn2MK_N1l_O7ou^)RD7f)c}{vx6b)XI6mG+*Vem>U<{M1KG$m)mZQ?D#Pn$$y zB!SH2C{;H4Oox%1D)s70v6e-4y28MscW6je41hc4rW}~vqCBkf=ZY%&nTpCSB2R?M zZ+w;6?ki7}l%YLGJbv>OlaxmpaF2Mzd5Vt|q4og}iAR8^cu5gzuX^+UHMpPsG6gas ze5Q&imSILIh?rCVdqE8sct6~T%CQNPb8m4PJ3N~h0tohZu-)ePIrewpkz%KetazNn zR(c}LeeJOJG~)q?nKHAq{~^&rW}@I2d&W!ljNdF8PuerS1$)NZ7LEVynU8=y^CPfl wz6SQpAHkmaEZ8%@2C!zn4`9#w0|0Eq%+^C<8z30@^%;ZMvR*{PS-*Oh14O-M>Hq)$ diff --git a/android/res/drawable-xxhdpi/ic_24px_route_point_c.webp b/android/res/drawable-xxhdpi/ic_24px_route_point_c.webp deleted file mode 100644 index ce698254937aa7ab9f3719b0eadeaf84f70c61c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 808 zcmV+@1K0dgNk&E>0{{S5MM6+kP&iBz0{{RoN5Byf$Ah44+n7J;t6k4w{^ws|+cqd( zX{5+)+XgeRBKv!8V3~UBj&U|nJX}7i)bCuc})wYgLZQFJ`Hmc|U_etJ6nXJ{X5&d`I zwv8iM7hw0Qu4T#-#J7xVY;x!NF`moCAFp>N$6O*W6!fj#lOy+QeFdhE+%tXx@z1zT z9yM;fk_N9Eji!!D7v4ydw}nz8H54EN1cvmFN|wnG%O#rSz9wT_>%C@+pA6z}(WveO z870w;A8QnRK@Z)2GL9d6K*=@bf$I_^%aj+Eff}Mb;rvG^4N#s4lsaXB^2UNgHR`m4 zkI3!$&C5Hk_137)CT#b)|D%eDl@F|EP_<2Ex#2!{*`<`LTLax*l|SAYv{oFu_h=fk zn^AZb_`#YJ&WwCOdVa;b><8;o@+$OoRtt$)Ot4Q#fFF3q$DE2MBSe&3s$dr7QOIyj z&OIb0eg8#AlExGNp-(}E_fokCqm4QJRd~!Zk5)|4#WRLE-7%$th(aXHB}0(o7+0Fa zvdWZtlqL<#xV^MG$h_;Q<>b{|Bv+8LoLAF(>}4dt`=3o;c=I z$&?Ps3~`#aK55VVR@gJ&wrKuu&w51Ivpy2`tk;A+>qlYFdREx8 mz81oo^}Y~x>_12}ZtCraY&HsWSg}7NVaa}x1hRkiEdv0X7J>Ny diff --git a/android/res/drawable-xxxhdpi/ic_24px_route_point_a.webp b/android/res/drawable-xxxhdpi/ic_24px_route_point_a.webp deleted file mode 100644 index af59d45fa5531af75cd2b4fe2608000b8de4a3cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1034 zcmV+l1oit;Nk&Ej1ONb6MM6+kP&iEX0{{RoU%(d-KV%?noA@_0_~;0U`(l!(pVwP&g6{KCIq@*0O=3=cNRO)r~y_nk3SG z#EnRC@FC+yzk73QC}ax&WJu2Lo-a<$wr$%+d~wc<%~OAPrh2++I(nO`j_5xGHuz&#m}B7VoqF0TG{(509+Pf z)qhrj5Z05`s0s|G`6xE80)%4(m2gi5ieq%e0xl63!)9Iu4kK$+ECBal^~wq`PnsPn zD+sfVD}G;Df(uPEE7sr)tLQ{o!-+G?rm~1lqiRuBVKUGqyi-=;*gsuDz;RizhpICQ z$1dNBBbh?nhmwzl02k+%CZV8~R+9a)BLsZVG}q*>Lcoqs0A` z>=T7$gI6)*lJ^OkDNH}bUR?8MfKsnv z`uWLauR#Tc>j=y$f#MM`98|DJj#4z$RTzR1Q}Zj>5qSa>#tCFMVGi+zXK7x+v~!Wu zD_(~zf~I!}^BQmX5C{&4h;##qXL#G!Fdy-TjX-c)M8p9Jf{DUMm}9iymn5&>ug^tJ zK@XMk4Xt}jmnGoW@73r58aJ`Fnh<ums$Y;4opgu(Vp&!JvkJ|Ki9>qucuzl7~q zTNyzcQdrZkBFBaAshFfXoUvwHK#ps-BPed+j5XsLa$K&)r3&M#9hY(Qinmc*qL?PD zomb%IMKeGxrNoC2=uBaZ`!t1{*X5c1=>0$^2h;Qlb-~O_HPdh3w!aO1Hq4EkwlMSR zP9S#Ocdc{|MpAA!H=fiMVqNg_A`mn9&lm(k7k(Hk=jvm=uDJ`n47$c$XmrQac*m#A zms&MI%l~tc^9-O=ZED=)mpH?V-^10RQNtMqO3^oF#{TO{!*#J{1H)|O*n>{fX2xB< z^&70~?cbMR`}b9TgMA_U_qBe5eL4I071{oMQMP|ymw7=2&OEYygMD@T&jr~2a}8$e z&t;hHKUd&5YHzi2g%x+eVUP zAv3eL_UcNi<^}YhL?l_%*f+hrb#Qfcu(dqh*I1N{kRDRCBS&n((MWBIG?3k#W`J~a zHu)u5KFct(<7mkaaRTF!o$<3okH+!Tz;-C^k?3JMeToKR3JQP9G&EDw-tBDnWeX?R!0rEw& zj#&lAS=JR_U?nWXZPU(bXt%83hShKr*kzg(F>O^9tO}cjF0sq1*iD3|%3g8eO9-f#wZW7MEWcH(2FUCm<@5vMg)P- zqdA5M=_s2KKO~fQ!3fP}L!?18B$m1(`R0L9w~G?tMGsno_8Wl6ghIB7nVb5JPHXP8Cr}aWM>(EFJwkA?NAL2u>^{Hp3~g;}7!x+V%Q9wX^M7~KD;J&@Cz!F}6FL9CW==mAG98%l zw2X)Al3`KL!i@W5JX}|KMJk^m!iMXrmv!M>b{A`qagmIVb?sL6&Dj55QpUr&%|JDLHwY+!!F1nbAg|^hTcN|)S+{Ym${4zb{HXaE^|LuQZ#>@ zAuQ%f1ljviNk&E<1ONb6MM6+kP&iBx1ONapU%(d-55=Hu8$sqzdfT=C80LTe6{Kyz zqWvjs+qUW6W!?a0g1;F8;irJ0%)mmt56)7Y)4)+c_*2{reLnbUu=@ZjV}MX(-G&uQ zIDHPT5RhkuOAK~k1t@k!*TzUb0ua)!Z8IdNwl{0r-q=~&wryLnZQIHFU-MSgQ&rKo zi2g%x+eVUPA#=~H_UNuk)xJRdC*ft})lZ$f{_xe8FRvb6KQ~pMm*EL_$gEy_LmIqU ztIiZIkka;m03NiZ2)p86{Uptg=MsSGVGY7RRvD%z1@k3SnH16q+3W3dt&Fl6(#j%;4Q>}Q%+6fTD!9slpNMakEHwmih}RX8(7=s% z5Z`K9)(GJems^m^eBy_A1tPpADG&Pt=g;p~*eo)eNaWyqgxfPNHrg*Rs^8|Bi zA`6`3xem$YGPi!Rz;&L7kX#~j8z&1q&x4H%yUZdU&MbB08Ok7SO5S3 diff --git a/android/res/values/colors.xml b/android/res/values/colors.xml index c895045b56..b55ab24ad4 100644 --- a/android/res/values/colors.xml +++ b/android/res/values/colors.xml @@ -121,7 +121,6 @@ @color/bg_statusbar @color/bg_statusbar_night #80FFFFFF - #43A047 #FFF2F6F6 diff --git a/android/src/com/mapswithme/maps/routing/TransitStepType.java b/android/src/com/mapswithme/maps/routing/TransitStepType.java index bf69fac657..bbca48fa44 100644 --- a/android/src/com/mapswithme/maps/routing/TransitStepType.java +++ b/android/src/com/mapswithme/maps/routing/TransitStepType.java @@ -7,7 +7,7 @@ import com.mapswithme.maps.R; public enum TransitStepType { // A specific icon for different intermediate points is calculated dynamically in TransitStepView. - INTERMEDIATE_POINT(R.drawable.ic_24px_route_point_a), + INTERMEDIATE_POINT(R.drawable.ic_20px_route_planning_walk), PEDESTRIAN(R.drawable.ic_20px_route_planning_walk), SUBWAY(R.drawable.ic_20px_route_planning_metro), TRAIN(R.drawable.ic_20px_route_planning_train), diff --git a/android/src/com/mapswithme/maps/routing/TransitStepView.java b/android/src/com/mapswithme/maps/routing/TransitStepView.java index 3f16a825f8..a5b2e556fd 100644 --- a/android/src/com/mapswithme/maps/routing/TransitStepView.java +++ b/android/src/com/mapswithme/maps/routing/TransitStepView.java @@ -15,11 +15,10 @@ import android.view.View; import androidx.annotation.ColorInt; import androidx.annotation.Dimension; -import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.content.res.ResourcesCompat; import androidx.core.graphics.drawable.DrawableCompat; - import com.mapswithme.maps.R; import com.mapswithme.maps.widget.recycler.MultilineLayoutManager; import com.mapswithme.util.ThemeUtils; @@ -61,12 +60,6 @@ public class TransitStepView extends View implements MultilineLayoutManager.Sque init(attrs); } - public TransitStepView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) - { - super(context, attrs, defStyleAttr, defStyleRes); - init(attrs); - } - private void init(@Nullable AttributeSet attrs) { mBackgroundCornerRadius = getResources().getDimensionPixelSize(R.dimen.routing_transit_step_corner_radius); @@ -86,12 +79,17 @@ public class TransitStepView extends View implements MultilineLayoutManager.Sque public void setTransitStepInfo(@NonNull TransitStepInfo info) { mStepType = info.getType(); - mDrawable = getResources().getDrawable(mStepType == TransitStepType.INTERMEDIATE_POINT - ? getIntermediatePointDrawableId(info.getIntermediateIndex()) - : mStepType.getDrawable()); - mDrawable = DrawableCompat.wrap(mDrawable); mBackgroundPaint.setColor(getBackgroundColor(getContext(), info)); - mText = info.getNumber(); + if (mStepType == TransitStepType.INTERMEDIATE_POINT) + { + mDrawable = null; + mText = String.valueOf(info.getIntermediateIndex() + 1); + } + else + { + mDrawable = ResourcesCompat.getDrawable(getResources(), mStepType.getDrawable(), null); + mText = info.getNumber(); + } invalidate(); requestLayout(); } @@ -104,32 +102,17 @@ public class TransitStepView extends View implements MultilineLayoutManager.Sque case PEDESTRIAN: return ThemeUtils.getColor(context, R.attr.transitPedestrianBackground); case INTERMEDIATE_POINT: - return Color.TRANSPARENT; + return ThemeUtils.getColor(context, R.attr.colorPrimary); default: return info.getColor(); } } - @DrawableRes - private static int getIntermediatePointDrawableId(int index) - { - switch (index) - { - case 0: - return R.drawable.ic_24px_route_point_a; - case 1: - return R.drawable.ic_24px_route_point_b; - case 2: - return R.drawable.ic_24px_route_point_c; - } - throw new AssertionError("Unknown intermediate point index: " + index); - } - @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int height = getDefaultSize(getSuggestedMinimumHeight(), MeasureSpec.UNSPECIFIED); - int width = getPaddingLeft(); + int width = getPaddingLeft() + getPaddingRight(); if (mDrawable != null) { calculateDrawableBounds(height, mDrawable); @@ -139,12 +122,19 @@ public class TransitStepView extends View implements MultilineLayoutManager.Sque if (!TextUtils.isEmpty(mText)) { mTextPaint.getTextBounds(mText, 0, mText.length(), mTextBounds); - width += (mDrawable != null ? getPaddingLeft() : 0) + mTextPaint.measureText(mText); if (height == 0) height = getPaddingTop() + mTextBounds.height() + getPaddingBottom(); - } + final int computedTextWidth = (int) ((mDrawable != null ? getPaddingLeft() : 0) + mTextPaint.measureText(mText)); - width += getPaddingRight(); + if (mStepType == TransitStepType.INTERMEDIATE_POINT) + { + // Make the background a round/pill shape for intermediate points to mimic the map icons + width = Math.max(width + computedTextWidth, height); + mBackgroundCornerRadius = width / 2; + } + else + width += computedTextWidth; + } mBackgroundBounds.set(0, 0, width, height); setMeasuredDimension(width, height); } @@ -186,7 +176,7 @@ public class TransitStepView extends View implements MultilineLayoutManager.Sque @Override protected void onDraw(Canvas canvas) { - if (getBackground() == null && mDrawable != null) + if (getBackground() == null) { canvas.drawRoundRect(mBackgroundBounds, mBackgroundCornerRadius, mBackgroundCornerRadius, mBackgroundPaint); @@ -197,9 +187,10 @@ public class TransitStepView extends View implements MultilineLayoutManager.Sque if (!TextUtils.isEmpty(mText)) { - int yPos = (int) ((canvas.getHeight() / 2) - ((mTextPaint.descent() + mTextPaint.ascent()) / 2)) ; - int xPos = mDrawable != null ? mDrawable.getBounds().right + getPaddingLeft() - : getPaddingLeft(); + int yPos = (int) ((getHeight() / 2) - ((mTextPaint.descent() + mTextPaint.ascent()) / 2)) ; + int xPos = mDrawable != null + ? mDrawable.getBounds().right + getPaddingLeft() + : (int) ((getWidth() - mTextPaint.measureText(mText)) / 2); canvas.drawText(mText, xPos, yPos, mTextPaint); } } @@ -212,11 +203,6 @@ public class TransitStepView extends View implements MultilineLayoutManager.Sque drawable.mutate(); DrawableCompat.setTint(drawable, ThemeUtils.getColor(context, R.attr.iconTint)); } - else if (type == TransitStepType.INTERMEDIATE_POINT) - { - drawable.mutate(); - DrawableCompat.setTint(drawable, getResources().getColor(R.color.routing_intermediate_point)); - } drawable.setBounds(mDrawableBounds); drawable.draw(canvas); }