forked from organicmaps/organicmaps
[android] Added basic menu support
This commit is contained in:
parent
67e72bc2d4
commit
3041d7336e
8 changed files with 34 additions and 0 deletions
BIN
android/res/drawable-hdpi/download_maps.png
Normal file
BIN
android/res/drawable-hdpi/download_maps.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4 KiB |
BIN
android/res/drawable-hdpi/my_position.png
Normal file
BIN
android/res/drawable-hdpi/my_position.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4 KiB |
BIN
android/res/drawable-ldpi/download_maps.png
Normal file
BIN
android/res/drawable-ldpi/download_maps.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
android/res/drawable-ldpi/my_position.png
Normal file
BIN
android/res/drawable-ldpi/my_position.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
android/res/drawable-mdpi/download_maps.png
Normal file
BIN
android/res/drawable-mdpi/download_maps.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
BIN
android/res/drawable-mdpi/my_position.png
Normal file
BIN
android/res/drawable-mdpi/my_position.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
10
android/res/menu/main.xml
Normal file
10
android/res/menu/main.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/my_position"
|
||||
android:icon="@drawable/my_position"
|
||||
android:title="@string/my_position" />
|
||||
|
||||
<item android:id="@+id/download_maps"
|
||||
android:icon="@drawable/download_maps"
|
||||
android:title="@string/download_maps" />
|
||||
</menu>
|
|
@ -1,9 +1,13 @@
|
|||
package com.mapswithme.maps;
|
||||
|
||||
import com.mapswithme.maps.MainGLView;
|
||||
import com.mapswithme.maps.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
||||
public class MWMActivity extends Activity
|
||||
{
|
||||
|
@ -40,6 +44,26 @@ public class MWMActivity extends Activity
|
|||
m_view.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.my_position:
|
||||
return true;
|
||||
case R.id.download_maps:
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
System.loadLibrary("mapswithme");
|
||||
|
|
Loading…
Add table
Reference in a new issue