add back button
git-svn-id: https://osmand.googlecode.com/svn/trunk@34 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
37fdb083f1
commit
15bcbac26a
5 changed files with 36 additions and 17 deletions
BIN
OsmAnd/res/drawable/back.png
Normal file
BIN
OsmAnd/res/drawable/back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -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>
|
||||
<ZoomControls android:id="@+id/ZoomControls01"
|
||||
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>
|
||||
<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>
|
||||
|
|
|
@ -1,15 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical" android:layout_height="fill_parent">
|
||||
<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>
|
||||
<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>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent" android:orientation="vertical"
|
||||
android:layout_height="fill_parent">
|
||||
<ProgressBar android:id="@+id/ProgressBar01"
|
||||
android:layout_width="wrap_content" android:layout_height="wrap_content"
|
||||
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>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue