From 15bcbac26ad8c6682318574c39cab77e2d38c4a5 Mon Sep 17 00:00:00 2001 From: frolovmo Date: Wed, 5 May 2010 10:34:17 +0000 Subject: [PATCH] add back button git-svn-id: https://osmand.googlecode.com/svn/trunk@34 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- OsmAnd/res/drawable/back.png | Bin 0 -> 1505 bytes OsmAnd/res/layout/main.xml | 3 +- OsmAnd/res/layout/menu.xml | 31 +++++++++++++----- .../osmand/activities/MainMenuActivity.java | 5 +-- .../com/osmand/activities/MapActivity.java | 14 ++++---- 5 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 OsmAnd/res/drawable/back.png diff --git a/OsmAnd/res/drawable/back.png b/OsmAnd/res/drawable/back.png new file mode 100644 index 0000000000000000000000000000000000000000..da51117a58dd88af98a885140bff2bfa79c3b851 GIT binary patch literal 1505 zcmV<71s?i|P)CkemrPV6`%(WS7v({YM zmZ@tD7!)%gW<*W1a!oX+Qkj2dnhF*mAaLFt-g|xC@jE)sJGeU_j*ai`?R|c~-~03Z zeE+=ne!rt+j0+uY1;z=CwgTe>Mq7c1Cb0h7zl=7=t$lhOHSc^Pb>WyIQ1I1-#}eX< zUs_`ov)#cvH_uIq9Ww-0Rh=)Iof5y|aX>;vN$a+q6w_3JoEm{sn!iwTDr)U=5AupGcJ|qLNJTT(Ee%8 z^vLwUn(8xYF(zYOa)No%9zH#Q%iSIPF zc9B1?bxNzdL&jT#5X59)cEzCE${5uTWj^i_OsAvOyK-in8WMqm%F{_^lk)YQiI$A| z(@nzVg4Nl7R)_RqK`<$!B4c_Yz2)NJOxGvyENSVmk?Wlf%ibmF-C+?}@%gFMv!*5N zZffl&=dQL9qd~_ttNSG&F}%QUA)y1b3E0mU3yhI$wXhp@XLji`vk!zsU`^F;(TZMQ zlbRf#b-3XQk=E4f*pMt5stC6YI6PrcEAr(avwmx;Z{MGXJ5)%^;kYW4FE3``)u?D+f{ zQxj{N+q+_az3?|;U5{7?dqVp%Q6{M8I$Ru9Kc-V_RzDb+z}l*YkJBbkeDSA~7s<^Y zCs%aXm9U~S!rZl|o%eOPIGlb+1$BSHyxR#ZFFBH)o;vB9){d?zC(bp&>asa=^X_db ze7bmFhl@k+Cx}k1T|2)&f!w0{r1UA)YbVb)lA8`E$EF0$=|Blb$S5SS#DX%l?u7;Y z2`nu+rnFvfYr+jHf{X_-+2|2qO#N=%LjO6Seppw8WL*)-FKbvy)dMeO2TtOw9d(a@ za20k~vyYV`!UOoJ2VZ`4;AJ#xN3Fs+{{k>aJ1RsF0jeH)O4} z`nQ&vBAS3lW^FCri5Oj{4a_A0vr%!>Z(KGu2)IdXDVhiK*C62IWd0iAf#X}2j~xOY zxp&iNCCI-#xeEPJxN1b+MMwN_Fk|E1MX1t1V8@swFw!zkV6w5Yjvb$emu^5*qFSwrNmY=qZ%GHlvB1f>^b z*l3~G1#E-$9e#5l7?FA6bBlSEP(&*2BK^N|xWzlh2a|sRT;B&?|9nOD00000NkvXX Hu0mjf;eF6( literal 0 HcmV?d00001 diff --git a/OsmAnd/res/layout/main.xml b/OsmAnd/res/layout/main.xml index dc3932d3f9..d0f223ebb8 100644 --- a/OsmAnd/res/layout/main.xml +++ b/OsmAnd/res/layout/main.xml @@ -8,7 +8,8 @@ + - + diff --git a/OsmAnd/res/layout/menu.xml b/OsmAnd/res/layout/menu.xml index ec147e2933..ad2286ea74 100644 --- a/OsmAnd/res/layout/menu.xml +++ b/OsmAnd/res/layout/menu.xml @@ -1,15 +1,30 @@ - - - + + + + + + - - + + + + diff --git a/OsmAnd/src/com/osmand/activities/MainMenuActivity.java b/OsmAnd/src/com/osmand/activities/MainMenuActivity.java index 6b4c9dcfc5..da3175b13d 100644 --- a/OsmAnd/src/com/osmand/activities/MainMenuActivity.java +++ b/OsmAnd/src/com/osmand/activities/MainMenuActivity.java @@ -27,8 +27,9 @@ public class MainMenuActivity extends Activity { showMap.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - final Intent settings = new Intent(MainMenuActivity.this, MapActivity.class); - startActivity(settings); + final Intent mapIndent = new Intent(MainMenuActivity.this, MapActivity.class); + startActivityForResult(mapIndent, 0); + } }); settingsButton = (Button) findViewById(R.id.SettingsButton); diff --git a/OsmAnd/src/com/osmand/activities/MapActivity.java b/OsmAnd/src/com/osmand/activities/MapActivity.java index 05a9b520e3..d5bf908deb 100644 --- a/OsmAnd/src/com/osmand/activities/MapActivity.java +++ b/OsmAnd/src/com/osmand/activities/MapActivity.java @@ -49,6 +49,8 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat private ImageButton backToLocation; + private ImageButton backToMenu; + private PointOfView pointOfView; private static final String TILES_PATH = "osmand/tiles/"; @@ -107,17 +109,17 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat }); - Button goToSettings = (Button)findViewById(R.id.GoToSettingsButton); - goToSettings.setOnClickListener(new OnClickListener(){ + backToMenu = (ImageButton)findViewById(R.id.BackToMenu); + backToMenu.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { - final Intent settings = new Intent(MapActivity.this, SettingsActivity.class); - startActivity(settings); + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); } }); - - + LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE); service.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, this); indexPOI = indexPOI();