Android samples: improve implementation, #32
This commit is contained in:
parent
11caa2a2d3
commit
0061b3ae7e
@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.oscim.android.test"
|
||||
android:installLocation="auto"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
android:versionName="1.0">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
@ -17,68 +18,49 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name="org.oscim.android.test.Samples"
|
||||
android:label="@string/app_name" >
|
||||
android:name=".Samples"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="org.oscim.android.test.MapsforgeMapActivity$MapFilePicker" />
|
||||
|
||||
<activity
|
||||
android:name="org.oscim.android.test.SimpleMapActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".MapsforgeMapActivity$MapFilePicker"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.S3DBMapActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".SimpleMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.PathOverlayActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".S3DBMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.MarkerOverlayActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".PathOverlayActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.BitmapTileMapActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".MarkerOverlayActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.MapsforgeMapActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".BitmapTileMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.ThemeStylerActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".MapsforgeMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.JeoIndoorMapActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".ThemeStylerActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.OsmJsonMapActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
android:name=".JeoIndoorMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name="org.oscim.android.test.VectorLayerMapActivity"
|
||||
android:label="@string/title_activity_map" >
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
android:name=".OsmJsonMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name=".VectorLayerMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -2,7 +2,6 @@
|
||||
|
||||
<string name="app_name">VTM Samples</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
<string name="title_activity_map">MapActivity</string>
|
||||
<string name="theme_default">Default</string>
|
||||
<string name="theme_tubes">Tubes</string>
|
||||
<string name="theme_osmarender">Osmarender</string>
|
||||
|
@ -1,16 +1,29 @@
|
||||
/*
|
||||
* Copyright 2016 devemux86
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.test;
|
||||
|
||||
import org.oscim.android.MapPreferences;
|
||||
import org.oscim.android.MapView;
|
||||
import org.oscim.map.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
public abstract class MapActivity extends ActionBarActivity {
|
||||
public static final Logger log = LoggerFactory.getLogger(MapActivity.class);
|
||||
public abstract class MapActivity extends AppCompatActivity {
|
||||
MapView mMapView;
|
||||
Map mMap;
|
||||
MapPreferences mPrefs;
|
||||
@ -29,6 +42,8 @@ public abstract class MapActivity extends ActionBarActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(mContentView);
|
||||
|
||||
setTitle(getClass().getSimpleName());
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMap = mMapView.map();
|
||||
mPrefs = new MapPreferences(MapActivity.class.getName(), this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user