From 52435c80b6fbcebbe8eaaf2a70005d34ba038624 Mon Sep 17 00:00:00 2001 From: Milton Barrera Date: Tue, 17 Dec 2024 01:14:38 -0600 Subject: [PATCH] NFix #351: new map button layout --- .../osmtracker/activity/DisplayTrackMap.java | 16 ++++ app/src/main/res/drawable-mdpi/gps_center.png | Bin 0 -> 970 bytes app/src/main/res/drawable-mdpi/zoom_in.png | Bin 1490 -> 114 bytes app/src/main/res/drawable-mdpi/zoom_out.png | Bin 1293 -> 141 bytes ...utton_background.xml => map_btn_style.xml} | 0 app/src/main/res/layout/displaytrackmap.xml | 74 +++++++++++++----- app/src/main/res/values/accessibility.xml | 1 + 7 files changed, 71 insertions(+), 20 deletions(-) create mode 100644 app/src/main/res/drawable-mdpi/gps_center.png rename app/src/main/res/drawable/{button_background.xml => map_btn_style.xml} (100%) diff --git a/app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java b/app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java index c0e0bc52..707fefbc 100644 --- a/app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java +++ b/app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java @@ -86,6 +86,16 @@ public class DisplayTrackMap extends Activity { */ private static final int DEFAULT_ZOOM = 16; + /** + * Default zoom level for center with zoom + */ + private static final double CENTER_DEFAULT_ZOOM_LEVEL = 18; + + /** + * Animation duration in milliseconds for center with zoom + */ + private static final long ANIMATION_DURATION_MS = 1000; + /** * Main OSM view */ @@ -207,6 +217,12 @@ public void onChange(boolean selfChange) { // Register listeners for zoom buttons findViewById(R.id.displaytrackmap_imgZoomIn).setOnClickListener(v -> osmViewController.zoomIn()); findViewById(R.id.displaytrackmap_imgZoomOut).setOnClickListener(v -> osmViewController.zoomOut()); + findViewById(R.id.displaytrackmap_imgZoomCenter).setOnClickListener(view -> { + centerToGpsPos = true; + if (currentPosition != null) { + osmViewController.animateTo(currentPosition,CENTER_DEFAULT_ZOOM_LEVEL, ANIMATION_DURATION_MS); + } + }); } /** diff --git a/app/src/main/res/drawable-mdpi/gps_center.png b/app/src/main/res/drawable-mdpi/gps_center.png new file mode 100644 index 0000000000000000000000000000000000000000..38f81f17eb0a97ff78abe35592ff30648dfafb8e GIT binary patch literal 970 zcmeAS@N?(olHy`uVBq!ia0vp^DIm5@cyR4_y6^|F?^Dp97^#y zZat4aziL-54ZW+kJxTJ$H;22k(+>oEXES^y-MVCg$RwvA53ZB>Qz8y#=Ux)*-2QUk z_0WGVe>b)n-`ZL*ceT<5)0hME))ocx9N*EltiLF5O}53w8G21xNvrD48}2iSHQv4W zl4H~L?sL0W|Ev1-Nib!agh0vnAZ~sej%_o)ZV>qVByRTP#>N?YPjxW+tbKhr-Eh&1J_xNjPPG#_k zJRT&parVC*+d2w8J%cx$^3vZZHHkYVN%7fpaqo~~t&mOgiO`o#30cWTbbOQ$nKBRhGP_^Nb$(U+gVb~V11flvP?!;9t9&M@rx zJV~yhGOLqM;ejeM!`Um7)K^;TuRI;JSWj?UVfv|kS`Xhz{C5+wYi_k)=UrhGTJvyq zP{pfbRv#uU++twbV;lF0FTw5TskZ4BA!|;A*nSq;8PE~$DScqlRFAvfUV#s{rmE&M z#Bq3Pyglos@=>hi$P}3m`4K8nZ@f&NsR-|U`QvHc2@k$MMaxUde09|ypL?j3HaqST z>w>i+Crwr+N1gQYepfzi+MOATw@h06WzWitK2?)o`RQL-s+Z?2Fb#5fSbp*GzohvQ zZuZ_hI|4wB@wn{c6W?R@WV zw)~t=cb)3FdG$l*!!Li%KR=jYnERk*b6BOpCDWK>qmastvu;kmA5^a8e=TwC-?Ikq z+_maob-z32JuBhSp10?sUTutj$K|Q0sRB++`~S?J)c2?6zVv;A8rM(kx3;j`INsKk P0Od$eS3j3^P6j12$w=|?`4eB}+&>gnp|vd$@? F2>^f69k>7h literal 1490 zcmV;@1ugoCP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01Jr#01Jr$H_6Mb00007bV*G`2ipb- z5Hl`v{x|6W00mM>L_t(o!|j>NZ(Km3F+oHKX^>_Ri%7Fz z5s3}3W5bRm8^m__Ct!gD3;qW7z+x5ziLo?DBM?J)4Fho!{Al-m)%mfw-Hz>yMdF9- z1+}T}y0>nB_q(YxC4;!es%sG7V~0=oH=l`wc+7-Y70GRtdg44-BmO*%%)9ZMfIe6TiS`42nXyLXSb-@Xs* z5@Iptlb`ttmv8(62m~x}d53eE=>Yx@c7b=mzf7q4Cu1>;ZJ^jQ{ldy2`y$p>+PZa+q2BQ zFTYyKDK$5Nc@fzU0t zhTL%sm-A?=rJnzm1UFU({hoOPw~(;rwkU}d`xiYKpkrG*Rr$*Yf1Zh6O_)h8TmnpU zN3pw~ePx_tplbgk`b3cIK(MxXCDYdfd(*#> zYNKwTZHCmk_bsD5-0h#u~a!D!a~T`OXPaoi{Jwy_uYS>sJr{SRYen?@1kt;O;Iw z1C*z?!4OJ_U=)}Y#1!e=vE)cjQb5_Le*f@(+X<+lX=p7I0)z}*ilj6lCU6odm4paE z17b0zuq*g*{p2bRp`=V#fe8u~Vno&uW2py*p%7R_)C{XC(2TluLUe34qmG$WBto6Z z<0ZhB&Qs?ktyDl~)qkDO s>0rq19v?n@=Muu*r>{CM`QH%#1^>K~PDh@r3IG5A07*qoM6N<$f}-)r=l}o! diff --git a/app/src/main/res/drawable-mdpi/zoom_out.png b/app/src/main/res/drawable-mdpi/zoom_out.png index f3079fd64e1c34f4a2ad698c0cb15942489da66d..2a56507cf3ab3e9bdf795a26829e801412d8700c 100644 GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDB3?!H8JlO)IgaUj*T!Azic%Uu02q?r_666=m z@YvJaLnwjK1t_5E>Eak-aXMLob#a46fmdKI;Vst00PV&?f?J) literal 1293 zcmV+o1@iidP)Px#32;bRa{vGfi2wi#i2*ms%dG$a00(qQO+^RW1_=-}7h<|8CIA2c24YJ`L;(K) z{{a7>y{D4^00fOmL_t(o!|j<%iycK2fWK2!-S?H7$HeG}f(n9)_(a8(jtUB*=t2-N zYkz?H0|fEEs6Rm$;?j&nBM1_~ogjup%)K++)m3$li|#v*_{eBb2ASHNs#CA8&!f8N z7I=>Fc!sZQKmd?Iq6$Dkd+pGMm0T606!!G>{VK9Mwp=quZ5aLgHA`8oQ6b~;%iQzO ztE}Jq6hSMTH&Qm7GhBw`4CjrY70DZ}Gkh?jH+*M!uOuDegAt<92JP#u(oLs?MyYCL zxz)>RRJgh*%uk(S{7d1|EHjyBj{Vf}!>NY(#RVH18@%`4^FTyq^VivU^#iiALk0-& z3^F_Z1{<%ue@FqJJ_0-fJOVrdJOVrdJOVt7fS0NZZ$r5o(c!iS&IA)1T7nq@7@`7V z7$$vZF)>5TFsFbCh8g_~%yur3Lqo(2gN$96U%d6h>jGYxZk~Jgi8~%Yb8@98Dz-w~v(dGi4y^myX1nu-OEumJSAJdc(I*!U26$z9?)*DvpL`@{Xj0+NO23!v zI_+BD?NRLW>pm94Y{qj<4OuDZQQLO{f1kpf*d|vP5->b&;rBXtRacHmx>D z*P*se&W2foq(YK{bKr_mstT7NRGypzp$=4|niyd^Kglc~r(L_5oA12u?*l@F*!?9S zu|aj4lrv^6bcrk(ao~$kstR8mA$U^pgep+g6)D#@4!Cl0Qx>Q$aY<=)IRI`Et;5>w zeJ-Z!_E->d@c3l-04WEmy2e+K@`%}q)6DZ4@yzXGWJF98CbMJz$AkK?e*!-AAJGr{Z;0OjLaD%CopJDI00000NkvXXu0mjf Do2*w8 diff --git a/app/src/main/res/drawable/button_background.xml b/app/src/main/res/drawable/map_btn_style.xml similarity index 100% rename from app/src/main/res/drawable/button_background.xml rename to app/src/main/res/drawable/map_btn_style.xml diff --git a/app/src/main/res/layout/displaytrackmap.xml b/app/src/main/res/layout/displaytrackmap.xml index fc516381..a996a383 100644 --- a/app/src/main/res/layout/displaytrackmap.xml +++ b/app/src/main/res/layout/displaytrackmap.xml @@ -1,28 +1,62 @@ + android:layout_height="wrap_content" + xmlns:app="http://schemas.android.com/apk/res-auto"> - + - - + - - + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/accessibility.xml b/app/src/main/res/values/accessibility.xml index 43048970..8b6f1e6c 100644 --- a/app/src/main/res/values/accessibility.xml +++ b/app/src/main/res/values/accessibility.xml @@ -7,6 +7,7 @@ Zoom in Zoom out + Zoom center Satellite signal strength indicator