add back button

git-svn-id: https://osmand.googlecode.com/svn/trunk@34 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
frolovmo 2010-05-05 10:34:17 +00:00
parent 37fdb083f1
commit 15bcbac26a
5 changed files with 36 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -8,7 +8,8 @@
<com.osmand.views.POIMapLayer android:id="@+id/PoiMapLayer" android:layout_width="fill_parent" android:layout_height="fill_parent"></com.osmand.views.POIMapLayer> <com.osmand.views.POIMapLayer android:id="@+id/PoiMapLayer" android:layout_width="fill_parent" android:layout_height="fill_parent"></com.osmand.views.POIMapLayer>
<ZoomControls android:id="@+id/ZoomControls01" <ZoomControls android:id="@+id/ZoomControls01"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right"></ZoomControls> android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right"></ZoomControls>
<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|left" android:id="@+id/BackToMenu" android:background="@drawable/back"></ImageButton>
<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|right" android:id="@+id/BackToLocation" android:background="@drawable/icon"></ImageButton> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|right" android:id="@+id/BackToLocation" android:background="@drawable/icon"></ImageButton>
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/settings_activity" android:layout_gravity="top|left" android:id="@+id/GoToSettingsButton" ></Button>
</FrameLayout> </FrameLayout>

View file

@ -1,15 +1,30 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
android:orientation="vertical" android:layout_height="fill_parent"> <ProgressBar android:id="@+id/ProgressBar01"
<ProgressBar android:id="@+id/ProgressBar01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|right"></ProgressBar><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:id="@+id/MapButton" android:text="@string/map_Button"></Button> android:layout_width="wrap_content" android:layout_height="wrap_content"
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:id="@+id/SettingsButton" android:text="@string/settings_Button"></Button> android:layout_gravity="top|right"></ProgressBar>
<TextView android:id="@+id/EmptyLable01" android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:id="@+id/MapButton"
android:text="@string/map_Button" android:layout_width="fill_parent"></Button>
<TextView android:id="@+id/EmptyLable02" android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<Button android:layout_height="wrap_content"
android:layout_gravity="center" android:id="@+id/SettingsButton"
android:text="@string/settings_Button" android:layout_width="fill_parent"></Button>
<FrameLayout android:id="@+id/FrameLayout01" android:layout_height="fill_parent" android:layout_width="fill_parent"><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|left" android:text="@string/exit_Button" android:id="@+id/ExitButton"></Button> <FrameLayout android:id="@+id/FrameLayout01"
android:layout_height="fill_parent" android:layout_width="fill_parent">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="bottom|left"
android:text="@string/exit_Button" android:id="@+id/ExitButton"></Button>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>

View file

@ -27,8 +27,9 @@ public class MainMenuActivity extends Activity {
showMap.setOnClickListener(new OnClickListener() { showMap.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
final Intent settings = new Intent(MainMenuActivity.this, MapActivity.class); final Intent mapIndent = new Intent(MainMenuActivity.this, MapActivity.class);
startActivity(settings); startActivityForResult(mapIndent, 0);
} }
}); });
settingsButton = (Button) findViewById(R.id.SettingsButton); settingsButton = (Button) findViewById(R.id.SettingsButton);

View file

@ -49,6 +49,8 @@ public class MapActivity extends Activity implements LocationListener, IMapLocat
private ImageButton backToLocation; private ImageButton backToLocation;
private ImageButton backToMenu;
private PointOfView pointOfView; private PointOfView pointOfView;
private static final String TILES_PATH = "osmand/tiles/"; 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); backToMenu = (ImageButton)findViewById(R.id.BackToMenu);
goToSettings.setOnClickListener(new OnClickListener(){ backToMenu.setOnClickListener(new OnClickListener(){
@Override @Override
public void onClick(View v) { public void onClick(View v) {
final Intent settings = new Intent(MapActivity.this, SettingsActivity.class); Intent intent = new Intent();
startActivity(settings); setResult(RESULT_OK, intent);
finish();
} }
}); });
LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE); LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
service.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, this); service.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, this);
indexPOI = indexPOI(); indexPOI = indexPOI();