applied suggestions from reviewers:

reorder puFloat and getFload, and removing additional constructor
This commit is contained in:
Everton Hermann 2020-07-19 17:40:45 +02:00
parent 743eaf19d0
commit e87ed289c7
2 changed files with 4 additions and 7 deletions

View file

@ -302,7 +302,7 @@ public class OsmandAidlApi {
zoom = zoom > mapView.getMaxZoom() ? mapView.getMaxZoom() : zoom; zoom = zoom > mapView.getMaxZoom() ? mapView.getMaxZoom() : zoom;
zoom = zoom < mapView.getMinZoom() ? mapView.getMinZoom() : zoom; zoom = zoom < mapView.getMinZoom() ? mapView.getMinZoom() : zoom;
} }
if(rotation != Float.NaN) { if(!Float.isNaN(rotation)) {
mapView.setRotate(rotation, false); mapView.setRotate(rotation, false);
} }
if (animated) { if (animated) {

View file

@ -11,10 +11,7 @@ public class SetMapLocationParams implements Parcelable {
private float rotation; private float rotation;
private boolean animated; 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) { public SetMapLocationParams(double latitude, double longitude, int zoom, float rotation, boolean animated) {
this.latitude = latitude; this.latitude = latitude;
this.longitude = longitude; this.longitude = longitude;
@ -62,16 +59,16 @@ public class SetMapLocationParams implements Parcelable {
out.writeDouble(latitude); out.writeDouble(latitude);
out.writeDouble(longitude); out.writeDouble(longitude);
out.writeInt(zoom); out.writeInt(zoom);
out.writeFloat(rotation);
out.writeByte((byte) (animated ? 1 : 0)); out.writeByte((byte) (animated ? 1 : 0));
out.writeFloat(rotation);
} }
private void readFromParcel(Parcel in) { private void readFromParcel(Parcel in) {
latitude = in.readDouble(); latitude = in.readDouble();
longitude = in.readDouble(); longitude = in.readDouble();
zoom = in.readInt(); zoom = in.readInt();
rotation = in.readFloat();
animated = in.readByte() != 0; animated = in.readByte() != 0;
rotation = in.readFloat();
} }
public int describeContents() { public int describeContents() {