add simple startup menu

git-svn-id: https://osmand.googlecode.com/svn/trunk@30 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
frolovmo 2010-05-03 14:41:07 +00:00
parent e5f031b383
commit 42919e9f14
4 changed files with 87 additions and 16 deletions

View file

@ -1,26 +1,29 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.osmand" package="com.osmand" android:versionCode="1" android:versionName="1.0">
android:versionCode="1" <application android:icon="@drawable/icon" android:label="@string/app_name"
android:versionName="1.0"> android:debuggable="true">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true"> <activity android:name=".activities.MainMenuActivity"
<activity android:name=".activities.MapActivity" android:label="@string/app_name">
android:label="@string/app_name" android:launchMode="standard"> <intent-filter>
<intent-filter> <action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
</intent-filter> </activity>
</activity> <activity android:name=".activities.MapActivity">
</activity>
<activity android:name=".activities.SettingsActivity"
android:label="@string/settings_activity"></activity>
<activity android:name=".activities.SettingsActivity" android:label="@string/settings_activity"></activity>
</application> </application>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission> <uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
</manifest> </manifest>

View file

@ -0,0 +1,15 @@
<?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>
<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>

View file

@ -12,4 +12,7 @@
<string name="hello">Hello World, StartActivity!</string> <string name="hello">Hello World, StartActivity!</string>
<string name="app_name">OsmAnd</string> <string name="app_name">OsmAnd</string>
<string name="exit_Button">Exit</string>
<string name="map_Button">Map</string>
<string name="settings_Button">Settings</string>
</resources> </resources>

View file

@ -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();
}
});
}
}