From 75646d55b80da53ad3c3bc0d03d3e1f817f99762 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 27 Nov 2011 11:57:06 +0100 Subject: [PATCH] Implement new Graphics. Introduce base class for layer instead of interface --- .../res/drawable-hdpi/box_free_pressed.9.png | Bin 0 -> 2331 bytes .../res/drawable-hdpi/box_free_simple.9.png | Bin 0 -> 2212 bytes .../res/drawable-large/box_free_pressed.9.png | Bin 0 -> 2331 bytes .../res/drawable-large/box_free_simple.9.png | Bin 0 -> 2212 bytes OsmAnd/res/drawable/box_free.xml | 6 ++ OsmAnd/res/drawable/box_free_pressed.9.png | Bin 0 -> 1711 bytes OsmAnd/res/drawable/box_free_simple.9.png | Bin 0 -> 1675 bytes .../osmand/plus/render/MapVectorLayer.java | 2 +- .../net/osmand/plus/views/BaseMapLayer.java | 2 +- .../osmand/plus/views/ContextMenuLayer.java | 82 ++++++++++++------ .../net/osmand/plus/views/FavoritesLayer.java | 4 +- .../src/net/osmand/plus/views/GPXLayer.java | 4 +- .../osmand/plus/views/MapControlsLayer.java | 8 +- .../net/osmand/plus/views/MapInfoLayer.java | 8 +- .../net/osmand/plus/views/MapTileLayer.java | 12 --- .../net/osmand/plus/views/OsmBugsLayer.java | 4 +- .../net/osmand/plus/views/OsmandMapLayer.java | 22 +++-- .../osmand/plus/views/OsmandMapTileView.java | 13 ++- .../net/osmand/plus/views/POIMapLayer.java | 8 +- .../osmand/plus/views/PointLocationLayer.java | 12 +-- .../plus/views/PointNavigationLayer.java | 4 +- .../net/osmand/plus/views/RouteInfoLayer.java | 4 +- .../src/net/osmand/plus/views/RouteLayer.java | 4 +- .../osmand/plus/views/TransportInfoLayer.java | 8 +- .../plus/views/TransportStopsLayer.java | 4 +- 25 files changed, 108 insertions(+), 103 deletions(-) create mode 100644 OsmAnd/res/drawable-hdpi/box_free_pressed.9.png create mode 100644 OsmAnd/res/drawable-hdpi/box_free_simple.9.png create mode 100644 OsmAnd/res/drawable-large/box_free_pressed.9.png create mode 100644 OsmAnd/res/drawable-large/box_free_simple.9.png create mode 100644 OsmAnd/res/drawable/box_free.xml create mode 100644 OsmAnd/res/drawable/box_free_pressed.9.png create mode 100644 OsmAnd/res/drawable/box_free_simple.9.png diff --git a/OsmAnd/res/drawable-hdpi/box_free_pressed.9.png b/OsmAnd/res/drawable-hdpi/box_free_pressed.9.png new file mode 100644 index 0000000000000000000000000000000000000000..442dd75ebbb886d00e0b01efacb491146d35550f GIT binary patch literal 2331 zcmV+$3FP*PP){^4&vQBFJr|Q{>XiwT zD58iWiYTIpB8n)Yh$4z8|5Rou2moG~0t66z+opt2yg+8a0?Y(v5y3!+fe7a6j_nAd zb_H@m8csl^SY~P*Hr5J+0ybbC-~hsaa3I0}gj0RPsP1-ZkCg{%~2*d)5fhE9FAkF|RrTQX^fS0H}ktC#z+B=IZP}kzgmEtXHHZ>xG8n$T3 zk|nF$ZuiGmuU;+e?d`1^9v*HP9UW~S85!v?3RvH}ckgL!IPuJS6pk0nLKO`qR}zh*v$(i;M}L2R{rLF!H_-6g@LTHY>KbloX}MQdSNB70 zZS4ai0rh_1^?HXuxRIfup*zs7ZwChlTbr7i_S)_Cl_cJaG-yLOs|(PBaJ*naR6#qr zi^aQk?b_7W*LP-MVBi)sa;&1F;&Dz+4m)`8;FO}Iq=bQBhYlTLxw*O1isQ$RGZ?IW!09z>)~thm ziQ$9`;$oa%vP3hb^5_zyEEda37;QyuZEbxgPMlyU*mMQGOLKGcEsw`j>vTGkDAROM zf@blDaI%%jNe9NTPz<_p9VrHj)3)E6H*~%JYe$C6vV}d_{57KYpId4O3f(d1YrTiH^p)w*ThzI|RCRr&e(0tH1yMXai- z>L!TxDfAc4;}%d@`9Ib+@n5ZMCQTgCM<)QEL#8-VP*A`Gz5y@v2&Mqp&{s*6O*+V1 zX(n1QrLeemm|`}Yv)pd?Z#Yj8_y#B7si~<=&|h0Aw#_GRW!6G8*)`&yE(g*!Zrs?2 znG(7I!9N3u+D-IIKs+r%$SyMAd5acAe-=f5{@Ko*J1?SWg2^c@EggmaLKnG)=52P) zMLsvt0=RgFSz{uwKO-ZfAI)DdIhB=_KSO^N1IZLx99oDbr~30Kb$tcM$;`~WEkseL zyuAD|^j8_?0kohTPN}~pqB&@!;E2i3%E}rB(`SOo!KE$euPR_2B_l6tC7PT$;zz&N zfP($|_e)qIfjT7G8cf@_zg{k`3bLW^q9e-^%;5YW*Zmc4-wAR*ECYYSFXV0Q&)&3HV-$GY- zOXGe`%SIG!O+kBp4$#gBYlU0nhN7&;OX627CeX}BN}M<-@9 zJH9I)l%LC;27Md&a>IrV!&u4g?rs4`Mn=X%=$}qt3%SM^O6D{L>F`H6WoUgqK z>;|r9W@bJVLj48q3yF=59l|4F6iQY+qYGf3`tlbWSsVK3^*~8fRMcJE-*@ri#c2;N zTP<6*Y!Le89L2Ik?mCKK)Bn3_=|79cTU!{#HZ=Qpfu`u_=n=f4;?ku{Y`TJr!!DO= z82aN1kV@VtjuJS{uUS&Ywos}_9L+yA1C0?85o1|dSwCU}E?>Spt-ypVCMHILe!vv} zBU%AjNnXij^23E@N^6tdq?4uqxE}dFPyyUYN=o{^v9Xa|xpHO7gIQu)TG~CU)jCEl zF_q$&ixwmJJF)zB=c9blG=Hn=aLhDztzG z@@$iiZw!}XTqwDND5|`Rz6h)%0pBALKLEA?+kp=a!Zxy|Efl-oq3>fjI1|XrETlQ? zT$2v3c=sh-pvm`R3bFJJ$wglWUM3gv8hxrrF#v0+zR5HQSJR5na{9g)P0Leulg=Mg z@Re2aRyUh0&p{1ZKqE1RT&VmEh~A$r;h!v7OoMPC4aoVXC!Z~`m<;q_kgo@Vf;a)^ zn0!AFWQ0e8-U64U?y002ovPDHLkV1j1z BT}l7| literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-hdpi/box_free_simple.9.png b/OsmAnd/res/drawable-hdpi/box_free_simple.9.png new file mode 100644 index 0000000000000000000000000000000000000000..85256e532a0c84df64ea79da19d0b961cc334c6e GIT binary patch literal 2212 zcmV;V2wV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d00001 diff --git a/OsmAnd/res/drawable-large/box_free_simple.9.png b/OsmAnd/res/drawable-large/box_free_simple.9.png new file mode 100644 index 0000000000000000000000000000000000000000..85256e532a0c84df64ea79da19d0b961cc334c6e GIT binary patch literal 2212 zcmV;V2wV4wP) z%{K6?%O)l!CMG5(CMG5(CMMRCMHz@D-WmWz1AX5Hgiv~cVhKAjgcu6q35SJ<*R`Gd z5r=-o=!CSKfJU)m(K+sHBH<)l#4y55q!6jZa0`%%_NJii$>>ia1RaV&sSQ#~h-VaQ zC_0pcPNowhh%90>kxPsr@`$k(AP?f^p}#}nfumo8mW z7cN||3>Pn6R9CKCQQVKSXV0pmM~|xg`}eE*`ugUTD_1Uaxm@ERUK$3iL+5qTW)My< zSR5LdjBt@#Mpji-b%Z;0?%X-`=+Ptf`0?Wb$Fpb80)iesd{}MXyt#eJk|pH`r5;QR ziDnYcDA+KB!gr|QtJkbqbNk4VBkJkXrvbqRI!~TFQRmN}SG#uYQY%)hXh=y(nFy~- zfp9}2Eu20iYJ!b)I2;8O4!7^zxl?s?bf||99}YTLJnsL}rAu49UT+b-mu#JIak@D! zB3WWAQh5%EBkXqj__=fE?%BS5d!XSD9y}Pdu;;PIEm*LiEh8gi8Zu2c5;S{12-nqD zFVm6^p2PC}e*d4883y9~U=~b+y^aTPQBhG74d@9-%#!imV!|n!=4E!cJE!!y9*^hy zl9H0!Wa|F?`vPF$Hg4Rg#*7)WhUa<=@VEOROm_9v%aSqC7G!5D6j#Hqaq)HAnk-BOfUU#Isq1=*w<(JE}B#Uq8~wZo$5 z=;+(rFtMJE-%nXtnWFc#1an(DqE&1-MAJeeKQy2CW!9`&>du`zLJ-!iTgRepBPL)G zLJN`6Z(6iCJZuCWUP&L3inB(ccX*kL-q#6Y629A#bs_SNi59J!&p2y*k7(qSwzIQS z2m&vT)BCzc_%XG(!y%fM>JLNe`T=pcuC6XH(F(o8%X;*_I*F-RP)d~1ES^WMZ0n1h7bZ~5RE6)mTlX%sq5FT3n8Er%^OkCID6zp zQ6V^y6m7U(wA$KQb@l31Ap{JfWr%1ZTIix}-MUo-v6^VS#o+Sg%R&g4N;F|dNm8i$9Ibf9|nEc4i#z{q#G{&A@OrsTAJFi zV~09+?3iGH4-@))J{GM83ld{-VkT_IceR7^NxIXZTuP{^sHiAVosBEA3C}4nFK5C2 zC1xQsW+Ryk%Rza4Ns0udto*(95wVcxHf|sbC;Sg@4a9Pugqxb01{J)e zFe@vI1#2a~!wQHOQORZNpMqw#zKEuIn-(TL_ypkf$P!{b9}1r|X;L7rvv>m?4u`xt zl$e;vg6)Hc6=M3xvb|UnD`GVtwL;VSs;c?$I1ZIR5zP*VL;3xFwRY`Vb>P5(0Vfu( zDRKdvq@*MktDRU*e1Y^{6D;CII*r2VtE+ktDtV6kgeWC`^2Ks7}VVbL2)_(-?nvsL68+L3DPbI za-;n&+w%*8;t^pq&$7$~LEVWLWqbK5E=@%3DlRKs$7Q^V%We?Ll2>tsBH}>0^v-yp mpO~1Kn3$NDNvunFbM_x5Y3e+YY{k9+0000 + + + + + diff --git a/OsmAnd/res/drawable/box_free_pressed.9.png b/OsmAnd/res/drawable/box_free_pressed.9.png new file mode 100644 index 0000000000000000000000000000000000000000..1c42224316fee429f697cdbc194ef858aad85892 GIT binary patch literal 1711 zcmV;g22lBlP)1y8o2E8C618S#XSDwb{T_3+nfi-FXUCm{n|u=a#dGfW+;h&obMJ

g5zrCJ7(mz?#=!V}3Mz4ozzi%P94ye7aJEgD6oQ4kDY5+G7}>c< zU<1)02D}a40d@`X+l*mftRR8|7pA39N^vagNKABe^y2L7>{U%oO(h*29d##8oM<_I z{CKODz-Ak0Y;SL`C@(MHl$4Z|2HzYkSOl*wgBD_ivN19mW4GIv?Af!Y$nAEIxLmH^ z$H&L-I-Sl3r%s)E+}+)+DP3J%fA{wGJ{%q%zBe^B_1DbI%#VG2ea)E|@HLKCd3d0O z@(V<(CpIlD?el?wfzFAEi95~B&Emd&`y@orS6Nx>+5|z zJw1;-9?$o?ckkW>pF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&wFW!BcoImBuZ0 z1ut=}Nayaml!ZxRabmQ7eXA79pm?er$=xrOztK3@!FUaEa2fEw>9%pR(OjID31(9K zB0x)&zX&iZjv8=qlSsn3O<6k)be1fz{1pWX3002ovPDHLk FV1g99KT`kz literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable/box_free_simple.9.png b/OsmAnd/res/drawable/box_free_simple.9.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b3aacbc08e65eb3f685ec0bb69c6d9aad84457 GIT binary patch literal 1675 zcmV;626Xv}P)Z9+9xK}1l4%0uKSmB*b~_Jz;Cf_{%V(`@`j)Y)Mt*_(Vq_+{^%&%Ni| zGc$K$Vj`<8#6(-PMO(B*Ti9DHV*th_#=t0JiYPfIUZugH34Gl-Z zF)cZ8;J~r{`}a53*47>@FE9Vn>2z+y*j{B>@w~bWTF8p!&ZyHB4u@k+X=!QAsZ*yq z`}_Ol$;nCY)YO#Ev2cW+5h`hWQFA^k7U&dvtg+uJ9L zi;EjD=5!84Yq-Ks2{96soSvRu($dm0h?xt{&(BN2U{F9*#NhM!p8Tb8Ve))EJw5)i zva+LAt2L8zrX?h)tJaL11nuak5b@uK0R$lE$$%mml7-bJVMPUzHyd#cPF_)Q&#{^o z7PE@XymMsb=jXQ$3=GU;hQ!?5oG$Qsz2foX$8$%H9GNwn&7bpb7|)ZhiX;R7paUIz z(bUu=)65`Q3Ozw9YHVyQuxZn#HeAb_9CmSwEIJn!lZ)sFS0^MS{5~==5~SIorYA|% z9zA*_RaI39TuU)X;S{2ZBnuaY1!%q4YJJopb`IS^IqLN3(_Tcx54fJ!xac%4B8fj! z(lV|yK6ANT6Iex_nVA`(M`%T%o(tG)wm)z^uXBW$7Ll74p0%q{RlN#)T~}8(14%Lp zMxjThr>Dil#6&PTIr%KECz}&^oEnl6dE0c=*VhY#n~bVf=n)ci=gys=-ERMflXr?* zl9sciO57VsXmtA_^azQ<4yQ<3$CAt(axW#x#!0Rc;U>|hhS?B$ghYi%%289&az)a< zefuQDwTzC09>I;T7#4hXMEJo7q-Mb|uKN%efJu)~r zC~n@o`NEQ77At9VbX2#Jh#NOgp$wFdIUT zkf`3?-tbD=wQHAzxR%k8&?8ty;@Y)qVUhHI#Z8h11_pF1iFitq`uA>%By=S7$WxNm zseSK8PXWF~laT!6t5>fIJwl=`U%ni)*=(vyQl2M$vvcRpX~eaB<;oS&)6=6nNYa@z zX99_diGTC+B!^nhljzB0Dkv)~EF8g%%u$Ek-QBu_!mYWv*>5x&f5Y{xQR~U1@{F4f z9=w~9lG1bT+_?Zr>gwv!9aI9iTrMxJ54gM?^v^h?4b*6DPb`Sy@vUdlgvE6CSVj$r1xE%@p1`iwp+CU)#5D z_qMjSdZ-4W0kyZcM+78@b~9S(jg5_gw6wG_jJXcvgA6W^pXXG`bDd98$^k0rKLkHx z0OJ)E6~2=vPx>xgxG;x7dLT>&lGZ?uO#LH4dz+e?{9CqckxeF32gX?e=y>289A;rT zpY-%WE-DGuf_FeU_!R|Ox6|ny&dbaDx2UK{l$MstT2fL{A{P`COk-o2K&jFXIaDy# zgO5Nizt*;EbtKTl@w}3k?s}HB6?_G1xDGj}G2a6>-9CX&!FwEDYeNohS+qD@s_X48?H zavE^(Q6U>|Hk!+Mmaw>xF9NhA^osy<$gRebei0Dq-? V6_jhZLY4pk002ovPDHLkV1oWbDvkgE literal 0 HcmV?d00001 diff --git a/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java b/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java index 7d5bf1596a..36a5247a3d 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java +++ b/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java @@ -161,7 +161,7 @@ public class MapVectorLayer extends BaseMapLayer { } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { return false; } } diff --git a/OsmAnd/src/net/osmand/plus/views/BaseMapLayer.java b/OsmAnd/src/net/osmand/plus/views/BaseMapLayer.java index 2cb23f74f5..2d2dd57d33 100644 --- a/OsmAnd/src/net/osmand/plus/views/BaseMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/BaseMapLayer.java @@ -1,6 +1,6 @@ package net.osmand.plus.views; -public abstract class BaseMapLayer implements OsmandMapLayer { +public abstract class BaseMapLayer extends OsmandMapLayer { private int alpha = 255; protected int warningToSwitchMapShown = 0; diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index df075cc698..18c4bb52d3 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -14,16 +14,20 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PointF; +import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Paint.Style; import android.util.DisplayMetrics; import android.view.Gravity; +import android.view.MotionEvent; import android.view.WindowManager; import android.widget.TextView; import android.widget.FrameLayout.LayoutParams; -public class ContextMenuLayer implements OsmandMapLayer { +public class ContextMenuLayer extends OsmandMapLayer { + + public interface IContextMenuProvider { public Object getPointObject(PointF point); @@ -44,14 +48,14 @@ public class ContextMenuLayer implements OsmandMapLayer { private DisplayMetrics dm; private OsmandMapTileView view; private static final int BASE_TEXT_SIZE = 170; + private static final int MARGIN_Y_TO_BOX = 12; private int textSize = BASE_TEXT_SIZE; private Paint paintLightBorder; private Paint paintBlack; - private RectF textBorder; private Paint paintBorder; private final MapActivity activity; - + private Rect padding = new Rect(); public ContextMenuLayer(MapActivity activity){ this.activity = activity; @@ -88,38 +92,43 @@ public class ContextMenuLayer implements OsmandMapLayer { textView.setMinLines(1); // textView.setMaxLines(15); textView.setGravity(Gravity.CENTER_HORIZONTAL); - textBorder = new RectF(-2, -1, textSize + 2, 0); + textView.setClickable(true); + textView.setBackgroundDrawable(view.getResources().getDrawable(R.drawable.box_free)); } @Override public void onDraw(Canvas canvas, RectF latLonBounds, RectF tilesRect, boolean nightMode) { if(latLon != null){ - int x = view.getMapXForPoint(latLon.getLongitude()); - int y = view.getMapYForPoint(latLon.getLatitude()); + int x = view.getRotatedMapXForPoint(latLon.getLatitude(), latLon.getLongitude()); + int y = view.getRotatedMapYForPoint(latLon.getLatitude(), latLon.getLongitude()); canvas.drawCircle(x, y, 5 * dm.density, paintBorder); canvas.drawCircle(x, y, 5 * dm.density, paintBlack); - if (textView.getText().length() > 0) { - x = view.getRotatedMapXForPoint(latLon.getLatitude(), latLon.getLongitude()); - y = view.getRotatedMapYForPoint(latLon.getLatitude(), latLon.getLongitude()); - canvas.rotate(-view.getRotate(), view.getCenterPointX(), view.getCenterPointY()); - canvas.translate(x - textView.getWidth() / 2, y - textView.getHeight() - 12); + canvas.translate(x - textView.getWidth() / 2, y - textView.getHeight() - MARGIN_Y_TO_BOX); int c = textView.getLineCount(); - textBorder.bottom = textView.getHeight() + 2; - canvas.drawRect(textBorder, paintLightBorder); - canvas.drawRect(textBorder, paintBlack); + textView.draw(canvas); if (c == 0) { // special case relayout after on draw method - textView.layout(0, 0, textSize, (int) ((textView.getPaint().getTextSize() + 4) * textView.getLineCount())); + layoutText(); view.refreshMap(); } } } } + private void layoutText() { + if(textView.getLineCount() > 0) { + textView.getBackground().getPadding(padding); + } + int w = textSize; + int h = (int) ((textView.getPaint().getTextSize() +4) * textView.getLineCount()) + + padding.bottom + padding.top; + textView.layout(0, 0, w, h); + } + public void setLocation(LatLon loc, String description){ latLon = loc; if(latLon != null){ @@ -131,12 +140,13 @@ public class ContextMenuLayer implements OsmandMapLayer { } else { textView.setText(""); //$NON-NLS-1$ } - textView.layout(0, 0, textSize, (int) ((textView.getPaint().getTextSize()+4) * textView.getLineCount())); + layoutText(); } + @Override public boolean onLongPressEvent(PointF point) { - if(pressedInTextView(point)){ + if(pressedInTextView(point.x, point.y)){ setLocation(null, ""); //$NON-NLS-1$ view.refreshMap(); return true; @@ -171,14 +181,17 @@ public class ContextMenuLayer implements OsmandMapLayer { @Override public boolean drawInScreenPixels() { - return false; + return true; } - public boolean pressedInTextView(PointF point){ - if(latLon != null){ - int x = view.getRotatedMapXForPoint(latLon.getLatitude(), latLon.getLongitude()); - int y = view.getRotatedMapYForPoint(latLon.getLatitude(), latLon.getLongitude()); - if (textBorder.contains(point.x - x + textView.getWidth() / 2, point.y - y + textView.getHeight() + 8)) { + public boolean pressedInTextView(float px, float py) { + if (latLon != null) { + Rect bs = textView.getBackground().getBounds(); + int x = (int) (px - view.getRotatedMapXForPoint(latLon.getLatitude(), latLon.getLongitude())); + int y = (int) (py - view.getRotatedMapYForPoint(latLon.getLatitude(), latLon.getLongitude())); + x += bs.width() / 2; + y += bs.height() + MARGIN_Y_TO_BOX; + if (bs.contains(x, y)) { return true; } } @@ -186,8 +199,8 @@ public class ContextMenuLayer implements OsmandMapLayer { } @Override - public boolean onTouchEvent(PointF point) { - if (pressedInTextView(point)) { + public boolean onSingleTap(PointF point) { + if (pressedInTextView(point.x, point.y)) { if (selectedObject != null) { ArrayList l = new ArrayList(); OnClickListener listener = selectedContextProvider.getActionListener(l, selectedObject); @@ -200,4 +213,23 @@ public class ContextMenuLayer implements OsmandMapLayer { return false; } + + @Override + public void onTouchEvent(MotionEvent event) { + if (latLon != null) { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + if(pressedInTextView(event.getX(), event.getY())){ + textView.setPressed(true); + view.refreshMap(); + } + } + } + if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) { + if(textView.isPressed()) { + textView.setPressed(false); + view.refreshMap(); + } + } + } + } diff --git a/OsmAnd/src/net/osmand/plus/views/FavoritesLayer.java b/OsmAnd/src/net/osmand/plus/views/FavoritesLayer.java index ea14ca9b93..db48d77a6c 100644 --- a/OsmAnd/src/net/osmand/plus/views/FavoritesLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/FavoritesLayer.java @@ -20,7 +20,7 @@ import android.util.FloatMath; import android.view.WindowManager; import android.widget.Toast; -public class FavoritesLayer implements OsmandMapLayer, ContextMenuLayer.IContextMenuProvider { +public class FavoritesLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider { private static final int startZoom = 6; private static final int radius = 15; @@ -127,7 +127,7 @@ public class FavoritesLayer implements OsmandMapLayer, ContextMenuLayer.IContext } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { FavouritePoint fav = getFavoriteFromPoint(point); if(fav != null){ String format = view.getContext().getString(R.string.favorite) + " : " + fav.getName(); //$NON-NLS-1$ diff --git a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java index ae96e415da..7e87c86bb2 100644 --- a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java @@ -17,7 +17,7 @@ import android.graphics.Paint.Cap; import android.graphics.Paint.Join; import android.graphics.Paint.Style; -public class GPXLayer implements OsmandMapLayer { +public class GPXLayer extends OsmandMapLayer { private OsmandMapTileView view; @@ -143,7 +143,7 @@ public class GPXLayer implements OsmandMapLayer { } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { return false; } diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index f8a084985c..704adf84d3 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -28,7 +28,7 @@ import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.SeekBar; -public class MapControlsLayer implements OsmandMapLayer { +public class MapControlsLayer extends OsmandMapLayer { private static final int SHOW_SEEKBAR_MSG_ID = 2; private static final int SHOW_SEEKBAR_DELAY = 7000; @@ -215,13 +215,9 @@ public class MapControlsLayer implements OsmandMapLayer { } } - @Override - public boolean onLongPressEvent(PointF point) { - return false; - } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { if (modeShadow.getBounds().contains((int) point.x, (int) point.y)) { onApplicationModePress(); return true; diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index c6c5b6cc0e..e67fc1010d 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -26,7 +26,7 @@ import android.util.DisplayMetrics; import android.util.FloatMath; import android.view.WindowManager; -public class MapInfoLayer implements OsmandMapLayer { +public class MapInfoLayer extends OsmandMapLayer { private OsmandMapTileView view; @@ -349,13 +349,9 @@ public class MapInfoLayer implements OsmandMapLayer { return true; } - @Override - public boolean onLongPressEvent(PointF point) { - return false; - } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { if (routeLayer != null && routeLayer.getHelper().isRouterEnabled()) { if (boundsForMiniRoute.contains(point.x, point.y) && routeLayer.getHelper().isFollowingMode()) { showMiniMap = !showMiniMap; diff --git a/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java b/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java index 2997606553..c2fae75962 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java @@ -9,7 +9,6 @@ import net.osmand.plus.ResourceManager; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; -import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; import android.util.FloatMath; @@ -257,15 +256,4 @@ public class MapTileLayer extends BaseMapLayer { } - - @Override - public boolean onLongPressEvent(PointF point) { - return false; - } - - @Override - public boolean onTouchEvent(PointF point) { - return false; - } - } diff --git a/OsmAnd/src/net/osmand/plus/views/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/views/OsmBugsLayer.java index 40af23e31e..5c4fa7544b 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmBugsLayer.java @@ -42,7 +42,7 @@ import android.view.WindowManager; import android.widget.EditText; import android.widget.Toast; -public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMenuProvider, DialogProvider { +public class OsmBugsLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider, DialogProvider { private static final Log log = LogUtil.getLog(OsmBugsLayer.class); private final static int startZoom = 8; @@ -222,7 +222,7 @@ public class OsmBugsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMe } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { OpenStreetBug bug = getBugFromPoint(point); if(bug != null){ String format = activity.getString(R.string.osb_bug_name)+ " : " + bug.getName(); //$NON-NLS-1$ diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java index 094cffa53a..a2965a2f91 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java @@ -3,19 +3,26 @@ package net.osmand.plus.views; import android.graphics.Canvas; import android.graphics.PointF; import android.graphics.RectF; +import android.view.MotionEvent; -public interface OsmandMapLayer { +public abstract class OsmandMapLayer { - public void initLayer(OsmandMapTileView view); + public abstract void initLayer(OsmandMapTileView view); - public void onDraw(Canvas canvas, RectF latlonRect, RectF tilesRect, boolean nightMode); + public abstract void onDraw(Canvas canvas, RectF latlonRect, RectF tilesRect, boolean nightMode); - public void destroyLayer(); + public abstract void destroyLayer(); - public boolean onTouchEvent(PointF point); + public boolean onSingleTap(PointF point) { + return false; + } - public boolean onLongPressEvent(PointF point); + public boolean onLongPressEvent(PointF point) { + return false; + } + + public void onTouchEvent(MotionEvent event) {} /** * This method returns whether canvas should be rotated as @@ -23,6 +30,7 @@ public interface OsmandMapLayer { * If the layer draws simply layer over screen (not over map) * it should return true. */ - public boolean drawInScreenPixels(); + public abstract boolean drawInScreenPixels(); + } diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index 33d93beb0c..eb363f19b5 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -672,6 +672,9 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall if (event.getAction() == MotionEvent.ACTION_DOWN) { animatedDraggingThread.stopAnimating(); } + for(int i=layers.size() - 1; i >= 0; i--) { + layers.get(i).onTouchEvent(event); + } if (!multiTouchSupport.onTouchEvent(event)) { /* return */gestureDetector.onTouchEvent(event); } @@ -765,19 +768,13 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall private class MapTileViewOnGestureListener implements OnGestureListener { @Override public boolean onDown(MotionEvent e) { - // enable double tap animation - // animatedDraggingThread.stopAnimating(); return false; } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { -// if (Math.abs(e1.getX() - e2.getX()) + Math.abs(e1.getY() - e2.getY()) > 50 * dm.density) { - animatedDraggingThread.startDragging(velocityX, velocityY, + animatedDraggingThread.startDragging(velocityX, velocityY, e1.getX(), e1.getY(), e2.getX(), e2.getY(), true); -// } else { -// onScroll(e1, e2, e1.getX() - e2.getX(), e1.getY() - e2.getY()); -// } return true; } @@ -817,7 +814,7 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall log.debug("On click event " + point.x + " " + point.y); //$NON-NLS-1$ //$NON-NLS-2$ } for (int i = layers.size() - 1; i >= 0; i--) { - if (layers.get(i).onTouchEvent(point)) { + if (layers.get(i).onSingleTap(point)) { return true; } } diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index a9edc8ee09..f0acc68ae8 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -32,7 +32,7 @@ import android.util.DisplayMetrics; import android.view.WindowManager; import android.widget.Toast; -public class POIMapLayer implements OsmandMapLayer, ContextMenuLayer.IContextMenuProvider { +public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider { private static final int startZoom = 10; public static final int TEXT_WRAP = 15; public static final int TEXT_LINES = 3; @@ -55,10 +55,6 @@ public class POIMapLayer implements OsmandMapLayer, ContextMenuLayer.IContextMen this.activity = activity; } - @Override - public boolean onLongPressEvent(PointF point) { - return false; - } public PoiFilter getFilter() { return filter; @@ -93,7 +89,7 @@ public class POIMapLayer implements OsmandMapLayer, ContextMenuLayer.IContextMen @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { Amenity n = getAmenityFromPoint(point); if(n != null){ String format = OsmAndFormatter.getPoiSimpleFormat(n, view.getContext(), diff --git a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java index e7abcb7e3e..ecc770d35c 100644 --- a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java @@ -16,7 +16,7 @@ import android.location.Location; import android.util.DisplayMetrics; import android.view.WindowManager; -public class PointLocationLayer implements OsmandMapLayer { +public class PointLocationLayer extends OsmandMapLayer { protected final static int RADIUS = 7; protected final static float HEADING_ANGLE = 60; @@ -172,15 +172,5 @@ public class PointLocationLayer implements OsmandMapLayer { return false; } - @Override - public boolean onLongPressEvent(PointF point) { - return false; - } - - @Override - public boolean onTouchEvent(PointF point) { - return false; - } - } diff --git a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java index 066ee157c8..45ed7e4d41 100644 --- a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java @@ -15,7 +15,7 @@ import android.location.Location; import android.util.DisplayMetrics; import android.view.WindowManager; -public class PointNavigationLayer implements OsmandMapLayer { +public class PointNavigationLayer extends OsmandMapLayer { protected final static int DIST_TO_SHOW = 80; private Paint point; @@ -116,7 +116,7 @@ public class PointNavigationLayer implements OsmandMapLayer { } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { return false; } diff --git a/OsmAnd/src/net/osmand/plus/views/RouteInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/RouteInfoLayer.java index 004a6257b2..0ff70034ef 100644 --- a/OsmAnd/src/net/osmand/plus/views/RouteInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/RouteInfoLayer.java @@ -26,7 +26,7 @@ import android.widget.TextView; import android.widget.FrameLayout.LayoutParams; -public class RouteInfoLayer implements OsmandMapLayer, IRouteInformationListener { +public class RouteInfoLayer extends OsmandMapLayer implements IRouteInformationListener { private static final int BASE_TEXT_SIZE = 150; private int textSize = BASE_TEXT_SIZE; @@ -208,7 +208,7 @@ public class RouteInfoLayer implements OsmandMapLayer, IRouteInformationListener } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { return false; } diff --git a/OsmAnd/src/net/osmand/plus/views/RouteLayer.java b/OsmAnd/src/net/osmand/plus/views/RouteLayer.java index f5ec7d4fb1..c934a1b021 100644 --- a/OsmAnd/src/net/osmand/plus/views/RouteLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/RouteLayer.java @@ -19,7 +19,7 @@ import android.graphics.Paint.Style; import android.location.Location; import android.util.Log; -public class RouteLayer implements OsmandMapLayer { +public class RouteLayer extends OsmandMapLayer { private OsmandMapTileView view; @@ -128,7 +128,7 @@ public class RouteLayer implements OsmandMapLayer { } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { return false; } diff --git a/OsmAnd/src/net/osmand/plus/views/TransportInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/TransportInfoLayer.java index 8174ddab75..5550996902 100644 --- a/OsmAnd/src/net/osmand/plus/views/TransportInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/TransportInfoLayer.java @@ -17,7 +17,7 @@ import android.util.DisplayMetrics; import android.view.WindowManager; import android.widget.Toast; -public class TransportInfoLayer implements OsmandMapLayer { +public class TransportInfoLayer extends OsmandMapLayer { private final TransportRouteHelper routeHelper; private OsmandMapTileView view; @@ -109,13 +109,9 @@ public class TransportInfoLayer implements OsmandMapLayer { return false; } - @Override - public boolean onLongPressEvent(PointF point) { - return false; - } @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { int ex = (int) point.x; int ey = (int) point.y; if (visible && !routeHelper.getRoute().isEmpty()) { diff --git a/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java b/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java index bfea4ed992..6423056594 100644 --- a/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java @@ -18,7 +18,7 @@ import android.util.DisplayMetrics; import android.view.WindowManager; import android.widget.Toast; -public class TransportStopsLayer implements OsmandMapLayer, ContextMenuLayer.IContextMenuProvider { +public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider { private static final int startZoom = 12; private Paint pointAltUI; @@ -68,7 +68,7 @@ public class TransportStopsLayer implements OsmandMapLayer, ContextMenuLayer.ICo @Override - public boolean onTouchEvent(PointF point) { + public boolean onSingleTap(PointF point) { TransportStop n = getFromPoint(point); if(n != null){ Toast.makeText(view.getContext(), getStopDescription(n, true), Toast.LENGTH_LONG).show();