From e87ed289c7aef40f6646eec65d76d6a46d51decc Mon Sep 17 00:00:00 2001 From: Everton Hermann Date: Sun, 19 Jul 2020 17:40:45 +0200 Subject: [PATCH] applied suggestions from reviewers: reorder puFloat and getFload, and removing additional constructor --- OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 2 +- OsmAnd/src/net/osmand/aidl/map/SetMapLocationParams.java | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index cd0ac98783..583915f081 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -302,7 +302,7 @@ public class OsmandAidlApi { zoom = zoom > mapView.getMaxZoom() ? mapView.getMaxZoom() : zoom; zoom = zoom < mapView.getMinZoom() ? mapView.getMinZoom() : zoom; } - if(rotation != Float.NaN) { + if(!Float.isNaN(rotation)) { mapView.setRotate(rotation, false); } if (animated) { diff --git a/OsmAnd/src/net/osmand/aidl/map/SetMapLocationParams.java b/OsmAnd/src/net/osmand/aidl/map/SetMapLocationParams.java index e736fa71b4..788ac784c7 100644 --- a/OsmAnd/src/net/osmand/aidl/map/SetMapLocationParams.java +++ b/OsmAnd/src/net/osmand/aidl/map/SetMapLocationParams.java @@ -11,10 +11,7 @@ public class SetMapLocationParams implements Parcelable { private float rotation; private boolean animated; - public SetMapLocationParams(double latitude, double longitude, int zoom, boolean animated) { - this(latitude, longitude, zoom, Float.NaN, animated); - } - + public SetMapLocationParams(double latitude, double longitude, int zoom, float rotation, boolean animated) { this.latitude = latitude; this.longitude = longitude; @@ -62,16 +59,16 @@ public class SetMapLocationParams implements Parcelable { out.writeDouble(latitude); out.writeDouble(longitude); out.writeInt(zoom); - out.writeFloat(rotation); out.writeByte((byte) (animated ? 1 : 0)); + out.writeFloat(rotation); } private void readFromParcel(Parcel in) { latitude = in.readDouble(); longitude = in.readDouble(); zoom = in.readInt(); - rotation = in.readFloat(); animated = in.readByte() != 0; + rotation = in.readFloat(); } public int describeContents() {