From 244dc9ad0c4b41e679364daa5b2dd3cd1a3c5fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B0=D1=86=D0=B5=D0=BF=D0=B8=D0=BD?= Date: Tue, 14 Nov 2017 21:45:36 +0300 Subject: [PATCH] [android] Implemented TransitStepView to display a transit step in bottom routing panel --- .../ic_20px_route_planning_metro.png | Bin 0 -> 425 bytes .../ic_20px_route_planning_train.png | Bin 0 -> 381 bytes .../ic_20px_route_planning_walk.png | Bin 0 -> 353 bytes .../ic_24px_route_planning_walk.png | Bin 0 -> 526 bytes .../ic_20px_route_planning_metro.png | Bin 0 -> 275 bytes .../ic_20px_route_planning_train.png | Bin 0 -> 265 bytes .../ic_20px_route_planning_walk.png | Bin 0 -> 242 bytes .../ic_24px_route_planning_walk.png | Bin 0 -> 367 bytes .../ic_20px_route_planning_metro.png | Bin 0 -> 539 bytes .../ic_20px_route_planning_train.png | Bin 0 -> 451 bytes .../ic_20px_route_planning_walk.png | Bin 0 -> 452 bytes .../ic_24px_route_planning_walk.png | Bin 0 -> 659 bytes .../ic_20px_route_planning_metro.png | Bin 0 -> 802 bytes .../ic_20px_route_planning_train.png | Bin 0 -> 674 bytes .../ic_20px_route_planning_walk.png | Bin 0 -> 648 bytes .../ic_24px_route_planning_walk.png | Bin 0 -> 984 bytes .../ic_20px_route_planning_metro.png | Bin 0 -> 1067 bytes .../ic_20px_route_planning_train.png | Bin 0 -> 861 bytes .../ic_20px_route_planning_walk.png | Bin 0 -> 892 bytes .../ic_24px_route_planning_walk.png | Bin 0 -> 1261 bytes android/res/values/attrs.xml | 7 + android/res/values/dimens.xml | 1 + .../maps/routing/TransitStepInfo.java | 71 +++++--- .../maps/routing/TransitStepType.java | 25 +++ .../maps/routing/TransitStepView.java | 164 ++++++++++++++++++ 25 files changed, 246 insertions(+), 22 deletions(-) create mode 100644 android/res/drawable-hdpi/ic_20px_route_planning_metro.png create mode 100644 android/res/drawable-hdpi/ic_20px_route_planning_train.png create mode 100644 android/res/drawable-hdpi/ic_20px_route_planning_walk.png create mode 100644 android/res/drawable-hdpi/ic_24px_route_planning_walk.png create mode 100644 android/res/drawable-mdpi/ic_20px_route_planning_metro.png create mode 100644 android/res/drawable-mdpi/ic_20px_route_planning_train.png create mode 100644 android/res/drawable-mdpi/ic_20px_route_planning_walk.png create mode 100644 android/res/drawable-mdpi/ic_24px_route_planning_walk.png create mode 100644 android/res/drawable-xhdpi/ic_20px_route_planning_metro.png create mode 100644 android/res/drawable-xhdpi/ic_20px_route_planning_train.png create mode 100644 android/res/drawable-xhdpi/ic_20px_route_planning_walk.png create mode 100644 android/res/drawable-xhdpi/ic_24px_route_planning_walk.png create mode 100644 android/res/drawable-xxhdpi/ic_20px_route_planning_metro.png create mode 100644 android/res/drawable-xxhdpi/ic_20px_route_planning_train.png create mode 100644 android/res/drawable-xxhdpi/ic_20px_route_planning_walk.png create mode 100644 android/res/drawable-xxhdpi/ic_24px_route_planning_walk.png create mode 100644 android/res/drawable-xxxhdpi/ic_20px_route_planning_metro.png create mode 100644 android/res/drawable-xxxhdpi/ic_20px_route_planning_train.png create mode 100644 android/res/drawable-xxxhdpi/ic_20px_route_planning_walk.png create mode 100644 android/res/drawable-xxxhdpi/ic_24px_route_planning_walk.png create mode 100644 android/src/com/mapswithme/maps/routing/TransitStepType.java create mode 100644 android/src/com/mapswithme/maps/routing/TransitStepView.java diff --git a/android/res/drawable-hdpi/ic_20px_route_planning_metro.png b/android/res/drawable-hdpi/ic_20px_route_planning_metro.png new file mode 100644 index 0000000000000000000000000000000000000000..9bbc4a8b34af400922a5290a73fcdd12513ac681 GIT binary patch literal 425 zcmV;a0apHrP)k6IU<+&n0TF{}H>j=ea0u8K1Gce!hCWN_3xs`#1Ns0BW%cfV{Eio^ z{`bBE+`~f;&vU=`F6TGs7@s-)DJ66RwsWpk z)qo$kNJO5P{F<C@lE1`b@y!8`>7-h+4aoxy_?2=%UXgo>ZIAAX9FT`< zu$9-0n~H6d?z)7Wz?^u`xUSgN#fDAb1FnfPl@;5v)vx)08w`Jx;4|@#O~VI#DbDmL zt{mA_vNr-<_<-BSU2Pw5*8|-30rx$?eIM|MVIppc<0GJ$PC_2JfH(XeGhC2cN5CyQ z3-UdAqXoZ+KP=EbgP-_9B^GpN9pqDd=ki^BH~IC(+)upEx8mUmM`<_R6e{!!m59Lr T@^{}<00000NkvXXu0mjf6RpB( literal 0 HcmV?d00001 diff --git a/android/res/drawable-hdpi/ic_20px_route_planning_train.png b/android/res/drawable-hdpi/ic_20px_route_planning_train.png new file mode 100644 index 0000000000000000000000000000000000000000..998da76a258b5acac6eb6273c8e56001f9dc2f88 GIT binary patch literal 381 zcmV-@0fPRCP)CB(fcVKw1C-B4FEq1egd01H%AzzrBCn zV|I3{_aBBH9+BVU)dg2L;W%Mt0la`Mc=?Mh-UP=OJclt%Y=06qXFkIt%M!uxhmmC& z`8?jlMA!z(a2uxF!zK*>u*ut$wldsf{0>V8bR{;9o-*8LycXIu+rBb9V7wICCEI~A zJY+l-+9}(iG8{7=3+W-wN#=+lewfXZ!&>Fx=A)8^>H3UYI`%Wq4)&td!wr zm~suv{LGMZ^P~)KU`mIP0bPxaBT|MN{NE} zS9A~oDju;utm6T{NEV`jl4bY`X*;rtE=%AA8+eD_n^pKmV#64MUJDUMEyB-OljkKB z{Xh*Nnpn&_TvN}xDts+xTM|!pZ}qnysPMiz53q+>tMC+lB-}*F>qeTuDk6y=dW09y zMg^M^4l!dLK9ShAydTT^6N*;RGF~MV$XQX{Qu9{fa|yIN&UfVe%pzJxvM*FSzKtQm zC(2oeFA!oS<@+s?)h+Jd$u8gfF^B0wzI?Jj03ZXtO{wDF00000NkvXXu0mjfUjC6# literal 0 HcmV?d00001 diff --git a/android/res/drawable-hdpi/ic_24px_route_planning_walk.png b/android/res/drawable-hdpi/ic_24px_route_planning_walk.png new file mode 100644 index 0000000000000000000000000000000000000000..26dc72dc2dce99484e29a88d7ee5c3dfe4bcc71e GIT binary patch literal 526 zcmV+p0`dKcP)DuMw(TvLZF{j7%(iVK)@&n~yv%n}cpc?=e!@7*iO5Dr;jndQZLQmO^@n0mu^1L8Z`NJJuF@+q~zp;|kQ?Vu;DFx)IPDrTrGL z0DmCuG&yJh^jiD5t`cTqH42&>ln0-nw%GO$);>`Ci~2T(_&=hT=q_yDPv_jpcR(|&}cb7D{vNN8 zF=!^FkEjyj`m#p<#^-_4;p#V9hI!9HNHgL+C=+_1V+8l)#b8WEuM|nO1hH(25x2Ry QIsgCw07*qoM6N<$f+6?x3jhEB literal 0 HcmV?d00001 diff --git a/android/res/drawable-mdpi/ic_20px_route_planning_metro.png b/android/res/drawable-mdpi/ic_20px_route_planning_metro.png new file mode 100644 index 0000000000000000000000000000000000000000..5c09ae250a70516846ffaf9627c5aff560fddaee GIT binary patch literal 275 zcmV+u0qp*XP) zF$%&k7=_IVI_X~U2wi)k-k@DPMK?Q_jwKY_I@^L{!BHWj7w8ZlE@Eu^Y#SXzzW=~>=L@Y zG-&vwiiaC;acJ0;bd4~$MS&}r1#hOKfE5S%*@8jv2GH_*(4YpL;B`R9436LlPCuL@ zyD?^P0=`T!gA4Fwi5Yx@8f3st#_km|sCQ3(@SvNT-JR}tTZzffmOy+Pk9Y5Y)PNO_ Z0sw=x2)3Uyvj6}9002ovPDHLkV1nS6c0m9D literal 0 HcmV?d00001 diff --git a/android/res/drawable-mdpi/ic_20px_route_planning_train.png b/android/res/drawable-mdpi/ic_20px_route_planning_train.png new file mode 100644 index 0000000000000000000000000000000000000000..1c28b3b3804e3fb217c2850d63eccfe2c7600847 GIT binary patch literal 265 zcmV+k0rvihP)| zI>GCls|5F;7QEWIO7IMhf_HMR61;)|tUZ50T=jcS`6!#XWxSuu;W>g+)L^fk8tcU@`-v0~3>@N`oUyhX_-PfE0sE%ev>OlQ{2GH~jrMQ&ukd zyZHO(J%+q7hGn92oW*uczFyd3yls}gtfN^$VQkQfL&upbb2oHKU$RJ8zPH)V>|r(Irmox#{pznK p+S_mC)w|F+XRDyXN6Vh?Y)O~C2A>x)Dg=6h!PC{xWt~$(69E4ORp9^t literal 0 HcmV?d00001 diff --git a/android/res/drawable-mdpi/ic_24px_route_planning_walk.png b/android/res/drawable-mdpi/ic_24px_route_planning_walk.png new file mode 100644 index 0000000000000000000000000000000000000000..49f82f81c35dd8498b3446c55ce7a7114beb7a1f GIT binary patch literal 367 zcmV-#0g(QQP)f76m(~HSg&22_IBY0dv?x<;?gLY@>vX&X-Q`g+8}@ z3eK>q=OoJR1;Z)6kwXxtUx>ND*I*a_v03<;R&f4`(8Yvj3Dt>^8?(wF=NReKFEWl>u+6pchvq%&pjkhA4b;aZ}1 zWP~2AJcC7|D=1&0zNjIpi=vd-I(z$^1-asEHs-=5qFM&8nkca$vtO%nn&YjULTULw z5V~_ofSpdvPL@3eZL@PVQ(qT7h`zBn-<(;u*KKyP?Fl&KaNpFnL_cuC*)8MOXMN}i zIO1@_)ZUPtH{;h}ZR80!<#3(nRVXvAKxF}+3VUZzR{2_;=cy+kNW}97l!3!<0A+)< z2*e%GoSRU34!<6hrq=TdxC5o@@asa^2@!A)%8|qG2+CfFfQL|Ghu=PwgAf5bP<9=D zyHGkI0-ixRcK97bISUc+0?MaoQxq-Wv&7y{DCZ#p-XK42LIg~ZA4!OSx5$s%5CQLy zA9o=FKC$#GibYk?CDOTMZ_HT;k0AoSurxNcD$=Q%{xNIMc?F!9^S$}0wZ>YEbYk|d zad!TSC$4}T+@62XF(JpivNV3#JA-m!e7E^V_@U9V=oJ~E$8sqI+_`J#KMWuIvR^3` d6cqd;{s1opXnTN}zq|kd002ovPDHLkV1n4S_YwdA literal 0 HcmV?d00001 diff --git a/android/res/drawable-xhdpi/ic_20px_route_planning_train.png b/android/res/drawable-xhdpi/ic_20px_route_planning_train.png new file mode 100644 index 0000000000000000000000000000000000000000..82cebf7976ecbcb06f419542784a67e0c116a98d GIT binary patch literal 451 zcmV;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FbQHKLUE3s5c`f; tk@?WM3+`AJhVK!U<1hT;TC`!#d;v3VX&Z9}%h><`002ovPDHLkV1nO5E^hz; literal 0 HcmV?d00001 diff --git a/android/res/drawable-xxhdpi/ic_20px_route_planning_metro.png b/android/res/drawable-xxhdpi/ic_20px_route_planning_metro.png new file mode 100644 index 0000000000000000000000000000000000000000..b27588aabaefc53cfe816ff5181e370bc46204b6 GIT binary patch literal 802 zcmV+-1Ks?IP)EfiT+kJY0uBXWL%|LZ)M&d&R>Ua4C@7jL&=w#9fDITb z9gq^OQkiU3?Rww-c=&v-;_SWmQr?dr+>7s@zx3Wqa~Y4v*Z4dhL$*)ilatdvgpWY1w>AvaK2oT`m`mh%G^EZ#~5mB|TB z?#3PQ$yzHbN}r33Y|KPZMclK2!_y%U_jE;fKu(;qyAQl>5$?mE;ti!GRx|eDn+LLX z#W|hRS-32Yp6P_+*jD1~(JdKaqJpCge8RdR=GX78@LiwIcjW zhEW->MRvs2TRIE3+2B&rW+u3SdvFtOq;wPRsTq=r$S$$9w$8$RHaIWV4k70kENaLs zs#%;v@tQna>+3Ack(BZU*zP9SGVW9|~PQ1aAe;YlbN*O)sFC6g`- z7a%8wS&g|_HIq|tS$Gz5ejE5#@DJq7x-2{gIrs3H=0E8ea^_qXUVxHSjk&8(vf#4t zGL&4y_i*Yz@}9#;&5|s;EWASYS#eqT9ogrt%fb=aCvsVMjqJ1LvT&8`Q*~K*o9wgg zvhWV%^k4`lU;s}kJ*O~GGeR|!v*WUGW59+IP3DkMy+>T2u={37{G|HGNnl7nfExEQ=Gy>S2=J$fL$vCSSk z0e^`jOnZVkcwOAH&K%qnozF0ZjXs&0Gc}sb!Kct>4-S;j8h~$<-YIkNxfSog!4i9e zrtvrD%)u8{`~#u+(P~~W2e+;GA)$F_HQUU=T`RszXzp6gE^BNB+H4ZKn@YFB7(A?m zR|(x!r8~?R94q0+gzl2kjTwXQDd8HSTT{As8H1;k@GPM_t8}LrgXfg+B%wR0bmtg@ z=aujnp?gQ^&NButIQkxbq;wY;gBO+X85}FIISxN5-9^UWr=oKS-@-=cJ6mJED^)|2L5w3ZApW z7`!h!an5g63Wd+v=RTr!Ke)*l-16v3w-|#@Jo=$^!vBQn@IT>~;twwvgCD@IxaTLl z&w5n*Ox*LF`5?XmU&G(xhF9>mi?;wC!Xx;dF!IW@YCgQlQ-?P1Ve}toMdoX5>TcHQ zk6$j8Kc7|$z8%z2o~VrbFgSxYD}6Y31=?ipuQH#y`>V`_f3@|iOeOQ-Dz{)%LMwtt z+SPV>mEXak5}QM&!MobZRlb79a0y0)Ze&`=rcJoo-V+G?0XC{k!A)v782|tP07*qo IM6N<$g0d_`H~;_u literal 0 HcmV?d00001 diff --git a/android/res/drawable-xxhdpi/ic_20px_route_planning_walk.png b/android/res/drawable-xxhdpi/ic_20px_route_planning_walk.png new file mode 100644 index 0000000000000000000000000000000000000000..21e67435a1e24bb9d488a7252d69f16daabb3118 GIT binary patch literal 648 zcmV;30(bq1P)wMRydX4E0LYnEwaqvIFcb>FnXDd4FOCcaBQhr9Nh zIJgtsRocYCe`6TF!_|AVF#T(BVpK(0#Qw{s|6BB5N%MlJjktb=o6otv}UaB7seW+a@thGxM!`hSO)#eusj zDL*z2!cV9j*6Fi%7Pu>(!}WQvMtoMkjx0J2j*8Dvd*{P1{LZ<%i^$W5$NM^#|r3mRKs)?6(gW6`@ z$NrBuaP<+f#Q7wswbFTT3COM~=YL}{WH0c)u7jsQHs0Zyh`0e+MP2{G{}!@*Zmt~y z*<#(sM!`AA9^!8|*QbT-6JqEzcrMh&`uSf0t#ldN25MXJpO^bOLbhLrv8nL|va^Wp z<9B4=AWI+YgS$ZX07?D0e?4Slf_-p#xO#^ie%@aUzm!jO{|5W$k$8bJ0p4F1SHDnL1`_#>I;Hmfk0000YN+qP}nwr$(idFT0NY1i)l*mYm>MJtjs7k33%ML+<6yJboTa_#3(oR32lW7bkA6TO3K9tjn*ads(u6c8%}W2KPuu={iA!6%ytOXT zi8Qe-p*%~o(1G*>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jzg+Z;+Ec@tU((0slX{ne=I&J{ed*)Q-L#(b}bgT3u(ru0&|eo zEf%;ADd$sxuOWT0Sl|~(uY4--J)~ue1ujE+?^A(GkV+N{EJ0fGslXLT3l8no#Za{isvB0O0Hhe1Z7o@iq3w#IZmrn&&A#GERS(q z%pO{p?*Yu3eJC)EgB2+kDai)T)J(Y~Zs4V~4+WlvyH5L1;90oqtPcfVfV(dEP+$+- z)#F2fm*K9 z8TX;UNk~=0M=PdLziGoqORA72eJF4S(g(v@ov2@@VeJo)W_&2{Ii#Xttu*SFHmqHQ z^vtya%gXDI4d=gD6t^i$TxJbN>pSmti*h0s l1VIo4K@bE%5ClO({R5HHmxr(|Gv@#R002ovPDHLkV1jI~@B9D& literal 0 HcmV?d00001 diff --git a/android/res/drawable-xxxhdpi/ic_20px_route_planning_train.png b/android/res/drawable-xxxhdpi/ic_20px_route_planning_train.png new file mode 100644 index 0000000000000000000000000000000000000000..5785ecea842baa1342da19df517a1773dc2c4fc0 GIT binary patch literal 861 zcmV-j1ETziP){`gMY=W~OPWfSNKQ+hO8y}H{Bg@Z?bg*)lFquku9B;W9akk? zEsD!7Sql=R0>`r z>UUk~_mN59Z|yjksNYeg-*2WXaT-^N1m1v7Muu{^q4QT#n4n(?$xrCyW)N5u-fWSi zi($9)l1=cYD1*TANS;HIrjndd?36{)O0plxQ;tDk4cMgygTPv_ODzV0O<|^BEa@vL>eAPJEi^)3emsM~VX64z@+rTUFJy_KFMk+= zzzIm6zRCPv5&;Bvzok>v~m zHyYlJ*}(lD$j>tFtuQ|`83Zdml4_yH@nQ9@McUH*E0s*^h{$B00kwlpmS1^ zKFoUpC!ydv6tpOCJ#>CZsz&I6#~;vH?~g9SC=-lsEYU}qa&&oF&p*2S^fWcP{wRk& zx*sJ~V)T5-NB&Vxesq6JTE+Mz$8YHLWFOr-k~#$a>bNfYC=-qDAISsBcF6!q7NQBs n;yP`29sh(r%050mK0f~eyOpMSpfFDV00000NkvXXu0mjfHW`2J literal 0 HcmV?d00001 diff --git a/android/res/drawable-xxxhdpi/ic_20px_route_planning_walk.png b/android/res/drawable-xxxhdpi/ic_20px_route_planning_walk.png new file mode 100644 index 0000000000000000000000000000000000000000..8aa67032553adce3ae8170b1f2f9784b6efcaa53 GIT binary patch literal 892 zcmV-?1B3jDP)H*+R)`_iU$!rVj#~xO~4#2zY2+S_9ACxcya4XvfyBPM6GLiusAUFe*kqkHk z!P%~iWWYlRPByzv>104GLU0Z$BN?z0f-^=L$$$^DSlDH<*OV{=@DEFeSuU%h>;!;U z*}@`2X0x^I6BRrG;70ZmyG02hu0{ZEV}G$hY%M#%wy-&@J$p*&WHda^Dzcd@9do1oEoCRVtKG@sR%$_ zrb}a0*o}T1upNjJ+2bC^e22h(F7l-NahP3T?b#!K8t_3D!zx;iX$ZS~cCYpoI}P44 zSbz4EUq<|xU1$0INwC{vIOlhk0=pB+1ps!zZj|LYlkM@L{6vJK!;o+^eO6U(^;Q)I; zdqL4$%aiOMxIW(VOt*^NqP@{(6U=t9n_V8TCe!7zhYa^F4#TXY%L6W8y5%0nzQkgf zE|uNp;&^wlET*evIp=$rm6CtHg`Np;-X5l#=Gu54uuP`g9K^XznJ$Yx;L3RSv7<0+ z9>n?2vV5ki?!tK2vDq-oW3L8zos~?t(S-qV!A`@!3aMR;0)7E^XpgN zEhrSrUW&qXOR_w}qco5B_5C1ISPc6-ir4*-tzc;=)KFbALI@#*5JCtcgt!RHS)(9Q S<(f;Z#ZQOpgz4d<(O6rK=8x9~0LCh+nox`DUKcLg36ohW1eMVi?o+9~iw z?K~rj=CGf3ei218xE5x#vu6~|;C9+OA&O>jQ|%odMRT}BJ6lE39M;#)r=n;MFVoxv z?i@us*i$n&mut`|j76h%=qhil?V_zM1u18^*k#IE=a-in(=HwxSsuf*SRo-`BqAMO`LKHM4a z$CjAT+zftRmZ9mJsZZko-8&F>jo}Ks8<&_{C*m$qEDztY>Kug|MKRAj_>@)e&rw9+ zQJA!PJT>|Z*TE51pBygPkpPS!zOscgS~2tN`DW?gD%pw~29q`{63{%=58Ggx|`yZp8`g zj`CcApW_ZO4)9s*i)+qtIqD~C?v5TM-&ObpZZQt!rT5G{JDQa5Nl^j!Xpu!cEcyfw zly4e0h#I&N{v*!-H;z8R^W{4r65*XVO`3h9Z}4jQeiIpRJ$w+Ssy66lZwWj^zPGlx zcltE^8fRJRWV|5e>1%*d7d5JDe#EQY~bXELs5Y{)$ER^rTcy4DR38@fZNm@A*34MSy80J z2h20iUR9k<@O9}<&NxUbu(_qy#Wi9G{7t&wMKKy~FeJbIehh(YV;gA(3Bh}T7aHz8 zF$8XcgQPjB3`NZ|;AuRkrsm)jX?`0;HJqZ_C3tX6dUjD6idw*fjrPu(?|&L58xBPU zKCj*^ZWA@|1`Le$ohX)v-PGG9Zib13 zI%ZtQ%pc_oG460f945^sU9Qn_lzKJ6syA3 X=r&Aw0NCE400000NkvXXu0mjf+)ZvN literal 0 HcmV?d00001 diff --git a/android/res/values/attrs.xml b/android/res/values/attrs.xml index 4b07eed27c..c8bad67802 100644 --- a/android/res/values/attrs.xml +++ b/android/res/values/attrs.xml @@ -41,6 +41,13 @@ + + + + + + + diff --git a/android/res/values/dimens.xml b/android/res/values/dimens.xml index 52a75df587..3ad2f8abd4 100644 --- a/android/res/values/dimens.xml +++ b/android/res/values/dimens.xml @@ -80,6 +80,7 @@ 2dp 4dp 8dp + 2dp 48dp diff --git a/android/src/com/mapswithme/maps/routing/TransitStepInfo.java b/android/src/com/mapswithme/maps/routing/TransitStepInfo.java index 5409d988ba..0284effe61 100644 --- a/android/src/com/mapswithme/maps/routing/TransitStepInfo.java +++ b/android/src/com/mapswithme/maps/routing/TransitStepInfo.java @@ -1,8 +1,8 @@ package com.mapswithme.maps.routing; import android.support.annotation.IntDef; +import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.annotation.StringDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -12,28 +12,55 @@ import java.lang.annotation.RetentionPolicy; */ public class TransitStepInfo { - public static final int TRANSIT_TYPE_PEDESTRIAN = 0; - public static final int TRANSIT_TYPE_SUBWAY = 1; + private static final int TRANSIT_TYPE_PEDESTRIAN = 0; + private static final int TRANSIT_TYPE_SUBWAY = 1; - @Retention(RetentionPolicy.SOURCE) - @IntDef({ TRANSIT_TYPE_PEDESTRIAN, TRANSIT_TYPE_SUBWAY }) - public @interface TransitType {} + @Retention(RetentionPolicy.SOURCE) + @IntDef({ TRANSIT_TYPE_PEDESTRIAN, TRANSIT_TYPE_SUBWAY }) + @interface TransitType {} - @TransitType - public final int mType; - public final double mDistance; - public final double mTime; - @Nullable - public final String mNumber; - public final int mColor; + @NonNull + private final TransitStepType mType; + private final double mDistance; + private final double mTime; + @Nullable + private final String mNumber; + private final int mColor; - public TransitStepInfo(@TransitType int type, double distance, double time, - @Nullable String number, int color) - { - mType = type; - mDistance = distance; - mTime = time; - mNumber = number; - mColor = color; - } + TransitStepInfo(@TransitType int type, double distance, double time, + @Nullable String number, int color) + { + mType = TransitStepType.values()[type]; + mDistance = distance; + mTime = time; + mNumber = number; + mColor = color; + } + + @NonNull + public TransitStepType getType() + { + return mType; + } + + public double getDistance() + { + return mDistance; + } + + public double getTime() + { + return mTime; + } + + @Nullable + public String getNumber() + { + return mNumber; + } + + public int getColor() + { + return mColor; + } } diff --git a/android/src/com/mapswithme/maps/routing/TransitStepType.java b/android/src/com/mapswithme/maps/routing/TransitStepType.java new file mode 100644 index 0000000000..321e255c1a --- /dev/null +++ b/android/src/com/mapswithme/maps/routing/TransitStepType.java @@ -0,0 +1,25 @@ +package com.mapswithme.maps.routing; + +import android.support.annotation.DrawableRes; + +import com.mapswithme.maps.R; + +public enum TransitStepType +{ + PEDESTRIAN(R.drawable.ic_20px_route_planning_walk), + SUBWAY(R.drawable.ic_20px_route_planning_metro); + + @DrawableRes + private final int mDrawable; + + TransitStepType(@DrawableRes int drawable) + { + mDrawable = drawable; + } + + @DrawableRes + public int getDrawable() + { + return mDrawable; + } +} diff --git a/android/src/com/mapswithme/maps/routing/TransitStepView.java b/android/src/com/mapswithme/maps/routing/TransitStepView.java new file mode 100644 index 0000000000..e54e9fdd9b --- /dev/null +++ b/android/src/com/mapswithme/maps/routing/TransitStepView.java @@ -0,0 +1,164 @@ +package com.mapswithme.maps.routing; + +import android.content.Context; +import android.content.res.Resources; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.Rect; +import android.graphics.RectF; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.support.annotation.ColorInt; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.annotation.RequiresApi; +import android.support.v4.graphics.drawable.DrawableCompat; +import android.text.TextUtils; +import android.util.AttributeSet; +import android.util.TypedValue; +import android.view.View; + +import com.mapswithme.maps.R; + +/** + * Represents a specific transit step. It displays a transit info, such as a number, color, etc., for + * the specific transit type: pedestrian, rail, metro, etc. + */ +public class TransitStepView extends View +{ + @Nullable + private Drawable mDrawable; + @NonNull + private final RectF mBackgroundBounds = new RectF(); + @NonNull + private final Rect mDrawableBounds = new Rect(); + @NonNull + private final Rect mTextBounds = new Rect(); + @NonNull + private final Paint mBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + @NonNull + private final Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private int mBackgroundCornerRadius; + @Nullable + private TransitStepInfo mStepInfo; + + public TransitStepView(Context context, @Nullable AttributeSet attrs) + { + super(context, attrs); + init(attrs); + } + + public TransitStepView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) + { + super(context, attrs, defStyleAttr); + init(attrs); + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + 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); + TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.TransitStepView); + float textSize = a.getDimensionPixelSize(R.styleable.TransitStepView_android_textSize, 0); + @ColorInt + int textColor = a.getColor(R.styleable.TransitStepView_android_textColor, Color.BLACK); + mTextPaint.setTextSize(textSize); + mTextPaint.setColor(textColor); + mDrawable = a.getDrawable(R.styleable.TransitStepView_android_drawable); + a.recycle(); + } + + public void setTransitStepInfo(@NonNull TransitStepInfo info) + { + mStepInfo = info; + mDrawable = getResources().getDrawable(mStepInfo.getType().getDrawable()); + mBackgroundPaint.setColor(mStepInfo.getColor()); + invalidate(); + requestLayout(); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) + { + int height = getDefaultSize(getSuggestedMinimumHeight(), MeasureSpec.UNSPECIFIED); + int width = getPaddingLeft(); + if (mDrawable != null) + { + calculateDrawableBounds(height, mDrawable); + width += mDrawable.getIntrinsicWidth(); + } + + if (mStepInfo != null && !TextUtils.isEmpty(mStepInfo.getNumber())) + { + String text = mStepInfo.getNumber(); + mTextPaint.getTextBounds(text, 0, text.length(), mTextBounds); + width += (mDrawable != null ? getPaddingLeft(): 0) + mTextPaint.measureText(text); + if (height == 0) + height = getPaddingTop() + mTextBounds.height() + getPaddingBottom(); + } + + width += getPaddingRight(); + mBackgroundBounds.set(0, 0, width, height); + setMeasuredDimension(width, height); + } + + private void calculateDrawableBounds(int height, @NonNull Drawable drawable) + { + // If the clear view height, i.e. without top/bottom padding, is greater than the drawable height + // the drawable should be centered vertically by adding additional vertical top/bottom padding. + int clearHeight = height - getPaddingTop() - getPaddingBottom(); + int vPad = 0; + if (clearHeight > drawable.getIntrinsicHeight()) + vPad = (clearHeight - drawable.getIntrinsicHeight()) / 2; + mDrawableBounds.set(getPaddingLeft(), getPaddingTop() + vPad, + drawable.getIntrinsicWidth() + getPaddingLeft(), + getTop() + vPad + drawable.getIntrinsicHeight()); + } + + @Override + protected void onDraw(Canvas canvas) + { + if (getBackground() == null && mDrawable != null) + { + canvas.drawRoundRect(mBackgroundBounds, mBackgroundCornerRadius, mBackgroundCornerRadius, + mBackgroundPaint); + } + + if (mDrawable != null && mStepInfo != null) + drawDrawable(mStepInfo.getType(), mDrawable, canvas); + + if (mStepInfo != null && !TextUtils.isEmpty(mStepInfo.getNumber())) + { + String text = mStepInfo.getNumber(); + int yPos = (int) ((canvas.getHeight() / 2) - ((mTextPaint.descent() + mTextPaint.ascent()) / 2)) ; + int xPos = mDrawable != null ? mDrawable.getBounds().right + getPaddingLeft() + : getPaddingLeft(); + canvas.drawText(text, xPos, yPos, mTextPaint); + } + } + + private void drawDrawable(@NonNull TransitStepType type, + @NonNull Drawable drawable, @NonNull Canvas canvas) + { + if (type == TransitStepType.PEDESTRIAN) + { + TypedValue typedValue = new TypedValue(); + Resources.Theme theme = getContext().getTheme(); + if (theme.resolveAttribute(R.attr.iconTint, typedValue, true)) + { + drawable.mutate(); + DrawableCompat.setTint(drawable, typedValue.data); + } + } + drawable.setBounds(mDrawableBounds); + drawable.draw(canvas); + } +}