Permalink
Browse files

Remove mapsforge-map-android-extras, fix #1021

  • Loading branch information...
devemux86 committed Dec 10, 2017
1 parent 9451819 commit 612333571cd7ea2b5a654b5d09217daf7052e2a3
View
@@ -19,7 +19,6 @@ allprojects {
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
ext.androidBuildVersionTools = "27.0.2"
ext.jUnitVersion = "4.12"
ext.supportVersion = "27.0.2"
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
@@ -30,17 +29,12 @@ allprojects {
}
}
// no injection of functions, so via inheritance
static def androidCompileSdk() { return 27 }
// Minimum API Level by Support Library
static def androidMinSdk() { return 14 }
// this is the last SDK with the old permissions system, so this should not change in the future
static def androidTargetSdkOldPermissions() { return 22 }
// moving forward we will target the latest SDK (that will all have the new permissions system)
static def androidTargetSdkRuntimePermissions() { return androidCompileSdk() }
static def androidTargetSdk() { return 22 }
static def versionCode() { return 1 }
@@ -94,29 +88,14 @@ configure(filterProjects(project.javaprojects)) {
}
// Configuration for Android projects
project.ext.androidlibraryprojects = ["mapsforge-map-android", "mapsforge-map-android-extras", "mapsforge-poi-android"]
project.ext.androidlibraryprojects = ["mapsforge-map-android", "mapsforge-poi-android"]
project.ext.androidapkprojects = ["mapsforge-samples-android"]
project.ext.androidprojects = project.androidlibraryprojects + project.androidapkprojects
// TODO get checkstyle and pmd working for android (right now it does not work out of the box, so better wait for official fix)
configure(filterProjects(project.androidapkprojects)) {
apply plugin: 'com.android.application'
android {
flavorDimensions "permission"
productFlavors {
oldpermissions {
dimension "permission"
targetSdkVersion androidTargetSdkOldPermissions()
}
runtimepermissions {
dimension "permission"
targetSdkVersion androidTargetSdkRuntimePermissions()
}
}
}
}
configure(filterProjects(project.androidlibraryprojects)) {
@@ -155,6 +134,7 @@ configure(filterProjects(project.androidprojects)) {
versionCode versionCode()
versionName versionName()
minSdkVersion androidMinSdk()
targetSdkVersion androidTargetSdk()
}
sourceSets {
View
@@ -1,5 +1,11 @@
# Changelog
## New since 0.9.0
- Deprecate mapsforge-map-android-extras [#1021](https://github.com/mapsforge/mapsforge/issues/1021)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/mapsforge/issues?q=is%3Aclosed+milestone%3A0.10.0)
## Version 0.9.0 (2017-12-03)
- Mapsforge maps **v5 beta**: variable tag values [#1006](https://github.com/mapsforge/mapsforge/pull/1006)
@@ -24,7 +24,6 @@ Mapsforge consists of the following core components:
Extra Android components:
- mapsforge-map-android: android specific map elements.
- mapsforge-map-android-extras: android extra map elements.
- mapsforge-poi-android: android specific poi elements.
- [androidsvg](http://bigbadaboom.github.io/androidsvg/): SVG library for displaying SVG files as icons.
- [spatialite-android](https://www.gaia-gis.it/fossil/libspatialite/wiki?name=splite-android): SQLite spatial library.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -261,9 +261,7 @@ protected MapViewPosition initializePosition(MapViewPosition mvp) {
}
/**
* Hook to check for Android Runtime Permissions. There is no check here, as
* see the @MapViewerTemplateRuntimePermissions for an implementation that works with
* Runtime Permissions.
* Hook to check for Android Runtime Permissions.
*/
protected void checkPermissionsAndCreateLayersAndControls() {
createLayers();
@@ -1,11 +1,10 @@
apply plugin: 'com.android.application'
dependencies {
implementation project(":mapsforge-map-android-extras")
implementation project(":mapsforge-map-android")
implementation project(":mapsforge-themes")
implementation project(":mapsforge-poi-android")
implementation "com.android.support:support-compat:$supportVersion"
implementation "com.android.support:support-fragment:$supportVersion"
implementation "com.android.support:support-fragment:27.0.2"
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.3'
}
@@ -16,16 +16,13 @@
*/
package org.mapsforge.samples.android;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import org.mapsforge.map.android.util.AndroidSupportUtil;
import org.mapsforge.map.android.util.AndroidUtil;
import org.mapsforge.map.android.view.MapView;
import org.mapsforge.map.layer.cache.TileCache;
@@ -104,37 +101,15 @@ public void onDestroy() {
private final byte PERMISSIONS_REQUEST_READ_STORAGE = 122;
/**
* Note that this is the Fragment method, not one from the compatibility lib
*/
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
switch (requestCode) {
case PERMISSIONS_REQUEST_READ_STORAGE: {
if (grantResults.length == 0 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
// permission is not granted, the app should do something meaningful here.
return;
}
createLayers();
}
}
}
protected void createLayers() {
if (AndroidSupportUtil.runtimePermissionRequiredForReadExternalStorage(this.getActivity(), getMapFileDirectory())) {
// note that this the Fragment method, not compat lib
requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSIONS_REQUEST_READ_STORAGE);
} else {
TileCache tileCache = AndroidUtil.createTileCache(this.getActivity(), "fragments",
this.mapView.getModel().displayModel.getTileSize(), 1.0f, 1.5);
this.mapView.getLayerManager().getLayers().add(AndroidUtil.createTileRendererLayer(
tileCache, this.mapView.getModel().mapViewPosition, getMapFile(),
InternalRenderTheme.DEFAULT));
this.mapView.setCenter(this.dummyItem.location);
this.mapView.setZoomLevel((byte) 16);
}
TileCache tileCache = AndroidUtil.createTileCache(this.getActivity(), "fragments",
this.mapView.getModel().displayModel.getTileSize(), 1.0f, 1.5);
this.mapView.getLayerManager().getLayers().add(AndroidUtil.createTileRendererLayer(
tileCache, this.mapView.getModel().mapViewPosition, getMapFile(),
InternalRenderTheme.DEFAULT));
this.mapView.setCenter(this.dummyItem.location);
this.mapView.setZoomLevel((byte) 16);
}
protected MapFile getMapFile() {
@@ -1,7 +1,7 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2013-2014 Ludwig M Brinckmann
* Copyright 2015 devemux86
* Copyright 2015-2017 devemux86
*
* 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
@@ -49,11 +49,6 @@ protected void createLayers() {
mapView.getLayerManager().getLayers().add(this.myLocationOverlay);
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
myLocationOverlay.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
@Override
protected void onStart() {
super.onStart();
Oops, something went wrong.

0 comments on commit 6123335

Please sign in to comment.