Improve code / xml formatting, closes #54
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.oscim.android.start"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
package="org.oscim.android.start"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="10"
|
||||
android:targetSdkVersion="22" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
android:label="VTM Start"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:allowBackup="true"
|
||||
android:theme="@style/AppTheme" >
|
||||
<activity
|
||||
android:name="org.oscim.android.start.TestActivity"
|
||||
android:label="VTM Start" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<uses-sdk
|
||||
android:minSdkVersion="10"
|
||||
android:targetSdkVersion="22" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="VTM Start"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name="org.oscim.android.start.TestActivity"
|
||||
android:label="VTM Start">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -11,6 +11,4 @@
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-21
|
||||
android.library.reference.1=../appcompat
|
||||
android.library.reference.2=../vtm-android
|
||||
target=android-23
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<org.oscim.android.MapView
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
</org.oscim.android.MapView>
|
||||
android:layout_height="fill_parent"></org.oscim.android.MapView>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,5 +1,8 @@
|
||||
package org.oscim.android.start;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
|
||||
import org.oscim.android.MapPreferences;
|
||||
import org.oscim.android.MapView;
|
||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||
@@ -11,42 +14,39 @@ import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
|
||||
public class TestActivity extends ActionBarActivity {
|
||||
public static final Logger log = LoggerFactory.getLogger(TestActivity.class);
|
||||
MapView mMapView;
|
||||
MapPreferences mPrefs;
|
||||
public static final Logger log = LoggerFactory.getLogger(TestActivity.class);
|
||||
MapView mMapView;
|
||||
MapPreferences mPrefs;
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_map);
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_map);
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
Map map = mMapView.map();
|
||||
mPrefs = new MapPreferences(TestActivity.class.getName(), this);
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
Map map = mMapView.map();
|
||||
mPrefs = new MapPreferences(TestActivity.class.getName(), this);
|
||||
|
||||
VectorTileLayer baseLayer = map.setBaseMap(new OSciMap4TileSource());
|
||||
map.layers().add(new BuildingLayer(map, baseLayer));
|
||||
map.layers().add(new LabelLayer(map, baseLayer));
|
||||
map.setTheme(VtmThemes.DEFAULT);
|
||||
}
|
||||
VectorTileLayer baseLayer = map.setBaseMap(new OSciMap4TileSource());
|
||||
map.layers().add(new BuildingLayer(map, baseLayer));
|
||||
map.layers().add(new LabelLayer(map, baseLayer));
|
||||
map.setTheme(VtmThemes.DEFAULT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
mPrefs.load(mMapView.map());
|
||||
mMapView.onResume();
|
||||
}
|
||||
mPrefs.load(mMapView.map());
|
||||
mMapView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
mMapView.onPause();
|
||||
mPrefs.save(mMapView.map());
|
||||
}
|
||||
mMapView.onPause();
|
||||
mPrefs.save(mMapView.map());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user