Skip to content

Commit

Permalink
Fix build error, and upgrade dependencies. (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnoodoe authored and amuramoto committed Aug 6, 2019
1 parent 91c0c23 commit 432007d
Show file tree
Hide file tree
Showing 16 changed files with 85 additions and 68 deletions.
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
buildscript {
ext.kotlin_version = '1.3.41'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand All @@ -25,9 +27,9 @@ project.ext.preDexLibs = !project.hasProperty('disablePreDex')
subprojects {
project.plugins.whenPluginAdded { plugin ->
if (rootProject.ext.has('preDexLibs')) {
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
if ("com.android.build.gradle.AppPlugin" == plugin.class.name) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
} else if ("com.android.build.gradle.LibraryPlugin" == plugin.class.name) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
Expand Down
79 changes: 40 additions & 39 deletions demo/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.maps.android.utils.demo"
android:versionCode="1"
android:versionName="1.0">
package="com.google.maps.android.utils.demo"
android:versionCode="1"
android:versionName="1.0">

<permission
android:name="com.google.maps.android.utils.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.google.maps.android.utils.permission.MAPS_RECEIVE"/>
android:name="com.google.maps.android.utils.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="com.google.maps.android.utils.permission.MAPS_RECEIVE" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
android:glEsVersion="0x00020000"
android:required="true" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/LightThemeSelector"
android:allowBackup="false">
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/LightThemeSelector">

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDCa5WRSMk3CrNSf3y5xbyQTvp1_zwuTtE"/>
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDCa5WRSMk3CrNSf3y5xbyQTvp1_zwuTtE" />

<activity
android:name=".MainActivity"
android:label="@string/app_name">
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".PolyDecodeDemoActivity"/>
<activity android:name=".PolySimplifyDemoActivity"/>
<activity android:name=".IconGeneratorDemoActivity"/>
<activity android:name=".DistanceDemoActivity"/>
<activity android:name=".ClusteringDemoActivity"/>
<activity android:name=".BigClusteringDemoActivity"/>
<activity android:name=".VisibleClusteringDemoActivity"/>
<activity android:name=".CustomMarkerClusteringDemoActivity"/>
<activity android:name=".TileProviderAndProjectionDemo"/>
<activity android:name=".HeatmapsDemoActivity"/>
<activity android:name=".HeatmapsPlacesDemoActivity"/>
<activity android:name=".GeoJsonDemoActivity"/>
<activity android:name=".KmlDemoActivity"/>
<activity android:name=".PolyDecodeDemoActivity" />
<activity android:name=".PolySimplifyDemoActivity" />
<activity android:name=".IconGeneratorDemoActivity" />
<activity android:name=".DistanceDemoActivity" />
<activity android:name=".ClusteringDemoActivity" />
<activity android:name=".BigClusteringDemoActivity" />
<activity android:name=".VisibleClusteringDemoActivity" />
<activity android:name=".CustomMarkerClusteringDemoActivity" />
<activity android:name=".TileProviderAndProjectionDemo" />
<activity android:name=".HeatmapsDemoActivity" />
<activity android:name=".HeatmapsPlacesDemoActivity" />
<activity android:name=".GeoJsonDemoActivity" />
<activity android:name=".KmlDemoActivity" />

</application>

Expand Down
14 changes: 10 additions & 4 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
apply plugin: 'com.android.application'

dependencies {
// implementation project(':library')
implementation project(':library')

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// Or, fetch from Maven:
implementation 'com.google.maps.android:android-maps-utils:0.3+'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
// implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.google.android.gms:play-services-maps:17.0.0'

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
}

buildscript {
Expand All @@ -13,7 +19,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.4.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.google.maps.android.utils.demo;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import androidx.fragment.app.FragmentActivity;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@

package com.google.maps.android.utils.demo;

import java.io.InputStream;
import java.util.List;

import org.json.JSONException;

import android.widget.Toast;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.maps.android.clustering.ClusterManager;
import com.google.maps.android.utils.demo.model.MyItem;

import org.json.JSONException;

import java.io.InputStream;
import java.util.List;

public class BigClusteringDemoActivity extends BaseDemoActivity {
private ClusterManager<MyItem> mClusterManager;

@Override
protected void startDemo() {
getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(51.503186, -0.126446), 10));

mClusterManager = new ClusterManager<MyItem>(this, getMap());
mClusterManager = new ClusterManager<>(this, getMap());

getMap().setOnCameraIdleListener(mClusterManager);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ClusteringDemoActivity extends BaseDemoActivity {
protected void startDemo() {
getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(51.503186, -0.126446), 10));

mClusterManager = new ClusterManager<MyItem>(this, getMap());
mClusterManager = new ClusterManager<>(this, getMap());
getMap().setOnCameraIdleListener(mClusterManager);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected int getLayoutId() {

@Override
protected void startDemo() {
mTextView = (TextView) findViewById(R.id.textView);
mTextView = findViewById(R.id.textView);

getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(-33.8256, 151.2395), 10));
getMap().setOnMarkerDragListener(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class HeatmapsDemoActivity extends BaseDemoActivity {
* Maps name of data set to data (list of LatLngs)
* Also maps to the URL of the data set for attribution
*/
private HashMap<String, DataSet> mLists = new HashMap<String, DataSet>();
private HashMap<String, DataSet> mLists = new HashMap<>();

@Override
protected int getLayoutId() {
Expand All @@ -101,7 +101,7 @@ protected void startDemo() {
getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(-25, 143), 4));

// Set up the spinner/dropdown list
Spinner spinner = (Spinner) findViewById(R.id.spinner);
Spinner spinner = findViewById(R.id.spinner);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.heatmaps_datasets_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
Expand Down Expand Up @@ -159,7 +159,7 @@ public void onItemSelected(AdapterView<?> parent, View view,
int pos, long id) {
String dataset = parent.getItemAtPosition(pos).toString();

TextView attribution = ((TextView) findViewById(R.id.attribution));
TextView attribution = findViewById(R.id.attribution);

// Check if need to instantiate (avoid setData etc twice)
if (mProvider == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public void onFeatureClick(Feature feature) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (NullPointerException e) {
e.printStackTrace();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected void startDemo() {

getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(51.503186, -0.126446), 10));

mClusterManager = new ClusterManager<MyItem>(this, getMap());
mClusterManager = new ClusterManager<>(this, getMap());
mClusterManager.setAlgorithm(new NonHierarchicalViewBasedAlgorithm<MyItem>(
metrics.widthPixels, metrics.heightPixels));

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
12 changes: 9 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
apply plugin: 'com.android.library'

dependencies {
androidTestImplementation 'junit:junit:4.12'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

package com.google.maps.android.clustering.algo;

import androidx.collection.LongSparseArray;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import android.support.v4.util.LongSparseArray;

import com.google.maps.android.clustering.Cluster;
import com.google.maps.android.clustering.ClusterItem;
import com.google.maps.android.geometry.Point;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.google.maps.android.clustering.algo;

import android.support.v4.util.LruCache;
import androidx.collection.LruCache;

import com.google.maps.android.clustering.Cluster;
import com.google.maps.android.clustering.ClusterItem;
Expand Down
3 changes: 2 additions & 1 deletion library/src/com/google/maps/android/data/Renderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@

import android.content.Context;
import android.graphics.Bitmap;
import android.support.v4.util.LruCache;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import androidx.collection.LruCache;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.GroundOverlay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import android.graphics.Bitmap;
import android.graphics.Color;
import android.support.v4.util.LongSparseArray;
import androidx.collection.LongSparseArray;

import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Tile;
Expand Down

0 comments on commit 432007d

Please sign in to comment.