Commit 3d273774 authored by Michael's avatar Michael
Browse files

Add: Android 10 Support

Fix: Endloser Ladebildschirm bei App-Start
parent 41d7e4c3
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
compileSdkVersion 29
buildToolsVersion '29.0.2'
defaultConfig {
applicationId "de.freifunk_karte.freifunk_karte"
minSdkVersion 15
targetSdkVersion 26
versionCode 7
versionName '1.4'
targetSdkVersion 29
versionCode 9
versionName '1.5'
}
buildTypes {
release {
......@@ -21,8 +21,8 @@ android {
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
......@@ -57,25 +57,25 @@
</div>
<div class="modal fade" id="waitModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="myModalLabel">Daten werden geladen</h2>
</div>
<div class="modal-body">
<div style="text-align:center"><img src="https://www.freifunk-karte.de/img/ajax-loader.gif" alt="spinner" /></div>
<p>
Bitte haben Sie einen Moment Geduld. Die Daten werden geladen.
</p>
<p>
Nach spätestens einer Minute werden Sie die Freifunk-Knoten angezeigt bekommen.
</p>
<p>
Vielen Dank für Ihre Geduld.
</p>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="myModalLabel">Daten werden geladen</h2>
</div>
<div class="modal-body">
<div style="text-align:center"><img src="https://www.freifunk-karte.de/img/ajax-loader.gif" alt="spinner" /></div>
<p>
Bitte haben Sie einen Moment Geduld. Die Daten werden geladen.
</p>
<p>
Nach spätestens einer Minute werden Sie die Freifunk-Knoten angezeigt bekommen.
</p>
<p>
Vielen Dank für Ihre Geduld.
</p>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
......
......@@ -232,6 +232,11 @@ function addPoints2Map(data)
// add all entries to clustergroup and heatmap
$.each(data, function(i, router)
{
if (isNaN(router.lat) || isNaN(router.long)) {
return;
}
heatMapData.push({
lat: router.lat,
lng: router.long,
......@@ -588,50 +593,71 @@ function preparePruneCluster()
// +--- Init the prune Cluste Plugin for Leaflet: https://github.com/SINTEF-9012/PruneCluster---------------
var pruneCluster = new PruneClusterForLeaflet();
pruneCluster.BuildLeafletCluster = function(cluster, position) {
var m = new L.Marker(position, {
icon: pruneCluster.BuildLeafletClusterIcon(cluster)
});
m.on('click', function() {
// Compute the cluster bounds (it's slow : O(n))
var markersArea = pruneCluster.Cluster.FindMarkersInArea(cluster.bounds);
var b = pruneCluster.Cluster.ComputeBounds(markersArea);
if (b) {
var bounds = new L.LatLngBounds(
new L.LatLng(b.minLat, b.maxLng),
new L.LatLng(b.maxLat, b.minLng));
var zoomLevelBefore = pruneCluster._map.getZoom();
var zoomLevelAfter = pruneCluster._map.getBoundsZoom(bounds, false, new L.Point(20, 20, null));
// If the zoom level doesn't change
if (zoomLevelAfter === zoomLevelBefore) {
// Send an event for the LeafletSpiderfier
pruneCluster._map.fire('overlappingmarkers', {
cluster: pruneCluster,
markers: markersArea,
center: m.getLatLng(),
marker: m
});
pruneCluster._map.setView(position, zoomLevelAfter);
}
else {
pruneCluster._map.fitBounds(bounds);
}
}
});
m.on('mouseover', function() {
//do mouseover stuff here
});
m.on('mouseout', function() {
//do mouseout stuff here
});
return m;
};
pruneCluster.BuildLeafletCluster = function(cluster, position)
{
var m = new L.Marker(position,
{
icon: pruneCluster.BuildLeafletClusterIcon(cluster)
});
m.on('click', function()
{
// Compute the cluster bounds (it's slow : O(n))
var markersArea = pruneCluster.Cluster.FindMarkersInArea(cluster.bounds);
var b = pruneCluster.Cluster.ComputeBounds(markersArea);
if (b)
{
var bounds = new L.LatLngBounds(
new L.LatLng(b.minLat, b.maxLng),
new L.LatLng(b.maxLat, b.minLng));
var zoomLevelBefore = pruneCluster._map.getZoom();
var zoomLevelAfter = pruneCluster._map.getBoundsZoom(bounds, false, new L.Point(20, 20, null));
// If the zoom level doesn't change
if (zoomLevelAfter === zoomLevelBefore)
{
// Send an event for the LeafletSpiderfier
pruneCluster._map.fire('overlappingmarkers', {
cluster: pruneCluster,
markers: markersArea,
center: m.getLatLng(),
marker: m
});
pruneCluster._map.setView(position, zoomLevelAfter);
}
else
{
pruneCluster._map.fitBounds(bounds);
}
}
})
.on('mouseover', function()
{
})
.on('mouseout', function()
{
});
return m;
};
// + Make a custom Icon for the Cluster. Also Taken from: https://github.com/SINTEF-9012/PruneCluster
pruneCluster.BuildLeafletClusterIcon = function (cluster)
......@@ -645,4 +671,4 @@ function preparePruneCluster()
pruneCluster.Cluster.Size = 100;
return pruneCluster;
}
\ No newline at end of file
}
......@@ -8,7 +8,7 @@ import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import androidx.core.app.ActivityCompat;
import android.util.Log;
import android.webkit.PermissionRequest;
import android.webkit.WebView;
......
......@@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.5.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
......@@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
\ No newline at end of file
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
\ No newline at end of file
#Thu Feb 22 21:46:04 CET 2018
#Sun Dec 15 12:42:23 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment