diff --git a/demo/res/layout/heatmaps_demo.xml b/demo/res/layout/heatmaps_demo.xml
index 65144bd6c..3c032c23b 100644
--- a/demo/res/layout/heatmaps_demo.xml
+++ b/demo/res/layout/heatmaps_demo.xml
@@ -14,14 +14,14 @@
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
- android:text="Radius"
+ android:text="@string/button_radius"
android:onClick="changeRadius" />
@@ -29,7 +29,7 @@
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
- android:text="Opacity"
+ android:text="@string/button_opacity"
android:onClick="changeOpacity" />
diff --git a/demo/res/values/strings.xml b/demo/res/values/strings.xml
index d1136f592..e62545b59 100644
--- a/demo/res/values/strings.xml
+++ b/demo/res/values/strings.xml
@@ -1,7 +1,7 @@
Maps Utils Demo
- Looking for...
+ Looking for…
Go!
Police Stations in Victoria
Medicare Offices
@@ -10,11 +10,11 @@
http://data.gov.au/dataset/location-of-medicare-offices/resource/5d38e1be-4011-49c4-8b8b-75405eeb1088
http://googlemaps.github.io/kml-samples/morekml/Polygons/Polygons.Google_Campus.kml
https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson
- Remove
- Add
- Toggle Vis
- @string/police_stations
- @string/medicare
+ Radius
+ Gradient
+ Opacity
diff --git a/demo/src/com/google/maps/android/utils/demo/CustomMarkerClusteringDemoActivity.java b/demo/src/com/google/maps/android/utils/demo/CustomMarkerClusteringDemoActivity.java
index 8e1865f97..1a27245f2 100644
--- a/demo/src/com/google/maps/android/utils/demo/CustomMarkerClusteringDemoActivity.java
+++ b/demo/src/com/google/maps/android/utils/demo/CustomMarkerClusteringDemoActivity.java
@@ -18,7 +18,6 @@
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
-import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
diff --git a/demo/src/com/google/maps/android/utils/demo/DistanceDemoActivity.java b/demo/src/com/google/maps/android/utils/demo/DistanceDemoActivity.java
index af913a1e0..5e5935db3 100644
--- a/demo/src/com/google/maps/android/utils/demo/DistanceDemoActivity.java
+++ b/demo/src/com/google/maps/android/utils/demo/DistanceDemoActivity.java
@@ -16,13 +16,11 @@
package com.google.maps.android.utils.demo;
-import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
-import com.google.android.gms.maps.LocationSource;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
diff --git a/demo/src/com/google/maps/android/utils/demo/MultiDrawable.java b/demo/src/com/google/maps/android/utils/demo/MultiDrawable.java
index b3ed731af..7ab222faf 100644
--- a/demo/src/com/google/maps/android/utils/demo/MultiDrawable.java
+++ b/demo/src/com/google/maps/android/utils/demo/MultiDrawable.java
@@ -18,6 +18,7 @@
import android.graphics.Canvas;
import android.graphics.ColorFilter;
+import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
import java.util.List;
@@ -100,6 +101,6 @@ public void setColorFilter(ColorFilter colorFilter) {
@Override
public int getOpacity() {
- return 0;
+ return PixelFormat.UNKNOWN;
}
}
diff --git a/demo/src/com/google/maps/android/utils/demo/PolySimplifyDemoActivity.java b/demo/src/com/google/maps/android/utils/demo/PolySimplifyDemoActivity.java
index 58ca5aca3..9b8ae1a83 100644
--- a/demo/src/com/google/maps/android/utils/demo/PolySimplifyDemoActivity.java
+++ b/demo/src/com/google/maps/android/utils/demo/PolySimplifyDemoActivity.java
@@ -48,7 +48,7 @@ protected void startDemo() {
List simplifiedLine;
- /**
+ /*
* Simplified lines - increasing the tolerance will result in fewer points in the simplified
* line
*/
diff --git a/library/src/com/google/maps/android/PolyUtil.java b/library/src/com/google/maps/android/PolyUtil.java
index 28d096f21..e745c4095 100644
--- a/library/src/com/google/maps/android/PolyUtil.java
+++ b/library/src/com/google/maps/android/PolyUtil.java
@@ -446,11 +446,7 @@ public static List simplify(List poly, double tolerance) {
public static boolean isClosedPolygon(List poly) {
LatLng firstPoint = poly.get(0);
LatLng lastPoint = poly.get(poly.size()-1);
- if (firstPoint.equals(lastPoint)) {
- return true;
- } else {
- return false;
- }
+ return firstPoint.equals(lastPoint);
}
/**
diff --git a/library/src/com/google/maps/android/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java b/library/src/com/google/maps/android/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java
index b7a243667..a85bba66c 100644
--- a/library/src/com/google/maps/android/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java
+++ b/library/src/com/google/maps/android/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java
@@ -208,7 +208,7 @@ public int getSize() {
@Override
public int hashCode() {
return mClusterItem.hashCode();
- };
+ }
@Override
public boolean equals(Object other) {
diff --git a/library/src/com/google/maps/android/clustering/algo/StaticCluster.java b/library/src/com/google/maps/android/clustering/algo/StaticCluster.java
index 10532a4a2..661e5feb8 100644
--- a/library/src/com/google/maps/android/clustering/algo/StaticCluster.java
+++ b/library/src/com/google/maps/android/clustering/algo/StaticCluster.java
@@ -69,7 +69,7 @@ public String toString() {
@Override
public int hashCode() {
return mCenter.hashCode() + mItems.hashCode();
- };
+ }
@Override
public boolean equals(Object other) {
diff --git a/library/src/com/google/maps/android/data/MultiGeometry.java b/library/src/com/google/maps/android/data/MultiGeometry.java
index 49a6847e3..fb370d532 100644
--- a/library/src/com/google/maps/android/data/MultiGeometry.java
+++ b/library/src/com/google/maps/android/data/MultiGeometry.java
@@ -44,9 +44,7 @@ public MultiGeometry(List extends Geometry> geometries) {
//convert unknown geometry type (due to GeoJSON types) to Geometry type
ArrayList geometriesList = new ArrayList();
- Iterator extends Geometry> geometriesIterator = geometries.iterator();
- while (geometriesIterator.hasNext()) {
- Geometry geometry = geometriesIterator.next();
+ for (Geometry geometry : geometries) {
geometriesList.add(geometry);
}
diff --git a/library/src/com/google/maps/android/data/geojson/GeoJsonParser.java b/library/src/com/google/maps/android/data/geojson/GeoJsonParser.java
index bf014ad7a..ac3d240df 100644
--- a/library/src/com/google/maps/android/data/geojson/GeoJsonParser.java
+++ b/library/src/com/google/maps/android/data/geojson/GeoJsonParser.java
@@ -209,20 +209,21 @@ private static HashMap parseProperties(JSONObject properties)
*/
private static Geometry createGeometry(String geometryType, JSONArray geometryArray)
throws JSONException {
- if (geometryType.equals(POINT)) {
- return createPoint(geometryArray);
- } else if (geometryType.equals(MULTIPOINT)) {
- return createMultiPoint(geometryArray);
- } else if (geometryType.equals(LINESTRING)) {
- return createLineString(geometryArray);
- } else if (geometryType.equals(MULTILINESTRING)) {
- return createMultiLineString(geometryArray);
- } else if (geometryType.equals(POLYGON)) {
- return createPolygon(geometryArray);
- } else if (geometryType.equals(MULTIPOLYGON)) {
- return createMultiPolygon(geometryArray);
- } else if (geometryType.equals(GEOMETRY_COLLECTION)) {
- return createGeometryCollection(geometryArray);
+ switch (geometryType) {
+ case POINT:
+ return createPoint(geometryArray);
+ case MULTIPOINT:
+ return createMultiPoint(geometryArray);
+ case LINESTRING:
+ return createLineString(geometryArray);
+ case MULTILINESTRING:
+ return createMultiLineString(geometryArray);
+ case POLYGON:
+ return createPolygon(geometryArray);
+ case MULTIPOLYGON:
+ return createMultiPolygon(geometryArray);
+ case GEOMETRY_COLLECTION:
+ return createGeometryCollection(geometryArray);
}
return null;
}
diff --git a/library/src/com/google/maps/android/data/kml/KmlBoolean.java b/library/src/com/google/maps/android/data/kml/KmlBoolean.java
index 72d251511..0b834810f 100644
--- a/library/src/com/google/maps/android/data/kml/KmlBoolean.java
+++ b/library/src/com/google/maps/android/data/kml/KmlBoolean.java
@@ -20,9 +20,6 @@
*/
public class KmlBoolean {
public static boolean parseBoolean(String text) {
- if ("1".equals(text) || "true".equals(text)) {
- return true;
- }
- return false;
+ return "1".equals(text) || "true".equals(text);
}
}
diff --git a/library/src/com/google/maps/android/ui/IconGenerator.java b/library/src/com/google/maps/android/ui/IconGenerator.java
index 61c4e8182..cba44a383 100644
--- a/library/src/com/google/maps/android/ui/IconGenerator.java
+++ b/library/src/com/google/maps/android/ui/IconGenerator.java
@@ -102,16 +102,21 @@ public Bitmap makeIcon() {
Canvas canvas = new Canvas(r);
- if (mRotation == 0) {
- // do nothing
- } else if (mRotation == 1) {
- canvas.translate(measuredWidth, 0);
- canvas.rotate(90);
- } else if (mRotation == 2) {
- canvas.rotate(180, measuredWidth / 2, measuredHeight / 2);
- } else {
- canvas.translate(0, measuredHeight);
- canvas.rotate(270);
+ switch (mRotation) {
+ case 0:
+ // do nothing
+ break;
+ case 1:
+ canvas.translate(measuredWidth, 0);
+ canvas.rotate(90);
+ break;
+ case 2:
+ canvas.rotate(180, measuredWidth / 2, measuredHeight / 2);
+ break;
+ case 3:
+ canvas.translate(0, measuredHeight);
+ canvas.rotate(270);
+ break;
}
mContainer.draw(canvas);
return r;
@@ -121,7 +126,7 @@ public Bitmap makeIcon() {
* Sets the child view for the icon.
*
* If the view contains a {@link TextView} with the id "text", operations such as {@link
- * #setTextAppearance} and {@link #makeIcon(String)} will operate upon that {@link TextView}.
+ * #setTextAppearance} and {@link #makeIcon(CharSequence)} will operate upon that {@link TextView}.
*/
public void setContentView(View contentView) {
mRotationLayout.removeAllViews();
diff --git a/library/tests/src/com/google/maps/android/PolyUtilTest.java b/library/tests/src/com/google/maps/android/PolyUtilTest.java
index 6823be63a..d3dfa3d26 100644
--- a/library/tests/src/com/google/maps/android/PolyUtilTest.java
+++ b/library/tests/src/com/google/maps/android/PolyUtilTest.java
@@ -22,7 +22,6 @@
import junit.framework.TestCase;
import java.lang.String;
-import java.lang.reflect.Array;
import java.util.List;
import java.util.ArrayList;
@@ -219,7 +218,7 @@ public void testContainsLocation() {
}
public void testSimplify() {
- /**
+ /*
* Polyline
*/
final String LINE = "elfjD~a}uNOnFN~Em@fJv@tEMhGDjDe@hG^nF??@lA?n@IvAC`Ay@A{@DwCA{CF_EC{CEi@PBTFDJBJ?V?n@?D@?A@?@?F?F?LAf@?n@@`@@T@~@FpA?fA?p@?r@?vAH`@OR@^ETFJCLD?JA^?J?P?fAC`B@d@?b@A\\@`@Ad@@\\?`@?f@?V?H?DD@DDBBDBD?D?B?B@B@@@B@B@B@D?D?JAF@H@FCLADBDBDCFAN?b@Af@@x@@";
@@ -292,7 +291,7 @@ public void testSimplify() {
assertLineLength(line, simplifiedLine);
assertInputUnchanged(line, copy);
- /**
+ /*
* Polygons
*/
// Open triangle
@@ -307,7 +306,7 @@ public void testSimplify() {
copy = copyList(triangle);
tolerance = 88; // meters
- List simplifiedTriangle = PolyUtil.simplify(triangle, tolerance);
+ List simplifiedTriangle = PolyUtil.simplify(triangle, tolerance);
assertEquals(4, simplifiedTriangle.size());
assertEndPoints(triangle, simplifiedTriangle);
assertSimplifiedPointsFromLine(triangle, simplifiedTriangle);
diff --git a/library/tests/src/com/google/maps/android/data/geojson/BiMultiMapTest.java b/library/tests/src/com/google/maps/android/data/geojson/BiMultiMapTest.java
index 77228ac1a..dc7aea39c 100644
--- a/library/tests/src/com/google/maps/android/data/geojson/BiMultiMapTest.java
+++ b/library/tests/src/com/google/maps/android/data/geojson/BiMultiMapTest.java
@@ -42,16 +42,16 @@ public void testMulti() {
public void testCollection() {
BiMultiMap map = new BiMultiMap<>();
String key = "foo";
- Object values = Arrays.asList("bar", "baz");
+ List values = Arrays.asList("bar", "baz");
map.put(key, values);
assertEquals(1, map.size());
assertEquals(values, map.get(key));
- for (String value : (List) values) {
+ for (String value : values) {
assertEquals(key, map.getKey(value));
}
map.remove(key);
assertEquals(0, map.size());
- for (String value : (List) values) {
+ for (String value : values) {
assertEquals(null, map.getKey(value));
}
}
diff --git a/library/tests/src/com/google/maps/android/data/geojson/GeoJsonFeatureTest.java b/library/tests/src/com/google/maps/android/data/geojson/GeoJsonFeatureTest.java
index 82d3cdbb4..6208227b9 100644
--- a/library/tests/src/com/google/maps/android/data/geojson/GeoJsonFeatureTest.java
+++ b/library/tests/src/com/google/maps/android/data/geojson/GeoJsonFeatureTest.java
@@ -41,7 +41,7 @@ public void testProperty() throws Exception {
public void testNullProperty() throws Exception {
GeoJsonLayer layer = new GeoJsonLayer(null, createFeatureCollection());
- GeoJsonFeature feature = (GeoJsonFeature) layer.getFeatures().iterator().next();
+ GeoJsonFeature feature = layer.getFeatures().iterator().next();
assertTrue(feature.hasProperty("prop0"));
assertNull(feature.getProperty("prop0"));
assertFalse(feature.hasProperty("prop1"));