From 42919e9f14e093d08bad36678129e5b4a3c7876a Mon Sep 17 00:00:00 2001 From: frolovmo Date: Mon, 3 May 2010 14:41:07 +0000 Subject: [PATCH] add simple startup menu git-svn-id: https://osmand.googlecode.com/svn/trunk@30 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- OsmAnd/AndroidManifest.xml | 35 +++++++------ OsmAnd/res/layout/menu.xml | 15 ++++++ OsmAnd/res/values/strings.xml | 3 ++ .../osmand/activities/MainMenuActivity.java | 50 +++++++++++++++++++ 4 files changed, 87 insertions(+), 16 deletions(-) create mode 100644 OsmAnd/res/layout/menu.xml create mode 100644 OsmAnd/src/com/osmand/activities/MainMenuActivity.java diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml index 19e916df4f..463f52dfda 100644 --- a/OsmAnd/AndroidManifest.xml +++ b/OsmAnd/AndroidManifest.xml @@ -1,26 +1,29 @@ - - - - - - - + package="com.osmand" android:versionCode="1" android:versionName="1.0"> + + + + + + + + + + + - - + - - - + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/menu.xml b/OsmAnd/res/layout/menu.xml new file mode 100644 index 0000000000..ec147e2933 --- /dev/null +++ b/OsmAnd/res/layout/menu.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 9ea9a568b0..1e64dd59d9 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,4 +12,7 @@ Hello World, StartActivity! OsmAnd +Exit +Map +Settings diff --git a/OsmAnd/src/com/osmand/activities/MainMenuActivity.java b/OsmAnd/src/com/osmand/activities/MainMenuActivity.java new file mode 100644 index 0000000000..6b4c9dcfc5 --- /dev/null +++ b/OsmAnd/src/com/osmand/activities/MainMenuActivity.java @@ -0,0 +1,50 @@ +package com.osmand.activities; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.view.Window; +import android.view.View.OnClickListener; +import android.widget.Button; + +import com.osmand.R; + +public class MainMenuActivity extends Activity { + + private Button showMap; + private Button exitButton; + private Button settingsButton; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + requestWindowFeature(Window.FEATURE_NO_TITLE); + setContentView(R.layout.menu); + + showMap = (Button) findViewById(R.id.MapButton); + showMap.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + final Intent settings = new Intent(MainMenuActivity.this, MapActivity.class); + startActivity(settings); + } + }); + settingsButton = (Button) findViewById(R.id.SettingsButton); + settingsButton.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + final Intent settings = new Intent(MainMenuActivity.this, SettingsActivity.class); + startActivity(settings); + } + }); + exitButton = (Button) findViewById(R.id.ExitButton); + exitButton.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + MainMenuActivity.this.finish(); + } + }); + } +}