diff options
author | Cameron Mace <cameron@mapbox.com> | 2016-12-16 16:19:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-16 16:19:15 -0500 |
commit | 20b958301eb208fe9ed0ae8edfb14b6f3741d8f2 (patch) | |
tree | 94ae0ce250cda159be13f9a21cc70c92d4908974 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java | |
parent | f95b4838ea816b9da0c151a953a1f98f97c79a39 (diff) | |
download | qtlocation-mapboxgl-20b958301eb208fe9ed0ae8edfb14b6f3741d8f2.tar.gz |
Adds checkstyle to CI (#7442)
* adds checkstyle to CI
* fixed gradlew path
* resolved testapp checkstyle violations
* added back mapboxMap variable for test
* checkstyle annotations
* checkstyle SDK round 1
* maps package checkstyle
* rest of SDK checkstyle
* checkstyle gesture library
* checkstyle test
* finished rest of test checkstyle
* resolved all checkstyle errors
* fixed class name
* removed old test file
* fixed camera postion test
* fixed native crash
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java | 258 |
1 files changed, 131 insertions, 127 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java index 1a763a72a1..2d829537fc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java @@ -15,146 +15,150 @@ import com.mapbox.mapboxsdk.geometry.LatLng; */ public class MarkerViewOptions extends BaseMarkerViewOptions<MarkerView, MarkerViewOptions> { - private MarkerView marker; + private MarkerView marker; - /** - * Defines default options for a MarkerView. Extend {@link BaseMarkerViewOptions} if you need - * more customization. - */ - public MarkerViewOptions() { - marker = new MarkerView(); - } + /** + * Defines default options for a MarkerView. Extend {@link BaseMarkerViewOptions} if you need + * more customization. + */ + public MarkerViewOptions() { + marker = new MarkerView(); + } - protected MarkerViewOptions(Parcel in) { - marker = new MarkerView(); - position((LatLng) in.readParcelable(LatLng.class.getClassLoader())); - snippet(in.readString()); - title(in.readString()); - flat(in.readByte() != 0); - anchor(in.readFloat(), in.readFloat()); - infoWindowAnchor(in.readFloat(), in.readFloat()); - rotation(in.readFloat()); - visible(in.readByte() != 0); - alpha(in.readFloat()); - if (in.readByte() != 0) { - // this means we have an icon - String iconId = in.readString(); - Bitmap iconBitmap = in.readParcelable(Bitmap.class.getClassLoader()); - Icon icon = new Icon(iconId, iconBitmap); - icon(icon); - } + protected MarkerViewOptions(Parcel in) { + marker = new MarkerView(); + position((LatLng) in.readParcelable(LatLng.class.getClassLoader())); + snippet(in.readString()); + title(in.readString()); + flat(in.readByte() != 0); + anchor(in.readFloat(), in.readFloat()); + infoWindowAnchor(in.readFloat(), in.readFloat()); + rotation(in.readFloat()); + visible(in.readByte() != 0); + alpha(in.readFloat()); + if (in.readByte() != 0) { + // this means we have an icon + String iconId = in.readString(); + Bitmap iconBitmap = in.readParcelable(Bitmap.class.getClassLoader()); + Icon icon = new Icon(iconId, iconBitmap); + icon(icon); } + } - /** - * Get the instance of the object for which this method was called. - * - * @return the object for which this method was called. - */ - @Override - public MarkerViewOptions getThis() { - return this; - } + /** + * Get the instance of the object for which this method was called. + * + * @return the object for which this method was called. + */ + @Override + public MarkerViewOptions getThis() { + return this; + } - /** - * Describe the kinds of special objects contained in this Parcelable's - * marshalled representation. - * - * @return integer 0. - */ - @Override - public int describeContents() { - return 0; - } + /** + * Describe the kinds of special objects contained in this Parcelable's + * marshalled representation. + * + * @return integer 0. + */ + @Override + public int describeContents() { + return 0; + } - /** - * Flatten this object in to a Parcel. - * - * @param out The Parcel in which the object should be written. - * @param flags Additional flags about how the object should be written. May be 0 or - * {@link #PARCELABLE_WRITE_RETURN_VALUE}. - */ - @Override - public void writeToParcel(Parcel out, int flags) { - out.writeParcelable(getPosition(), flags); - out.writeString(getSnippet()); - out.writeString(getTitle()); - out.writeByte((byte) (isFlat() ? 1 : 0)); - out.writeFloat(getAnchorU()); - out.writeFloat(getAnchorV()); - out.writeFloat(getInfoWindowAnchorU()); - out.writeFloat(getInfoWindowAnchorV()); - out.writeFloat(getRotation()); - out.writeByte((byte) (isVisible() ? 1 : 0)); - out.writeFloat(alpha); - Icon icon = getIcon(); - out.writeByte((byte) (icon != null ? 1 : 0)); - if (icon != null) { - out.writeString(getIcon().getId()); - out.writeParcelable(getIcon().getBitmap(), flags); - } + /** + * Flatten this object in to a Parcel. + * + * @param out The Parcel in which the object should be written. + * @param flags Additional flags about how the object should be written. May be 0 or + * {@link #PARCELABLE_WRITE_RETURN_VALUE}. + */ + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(getPosition(), flags); + out.writeString(getSnippet()); + out.writeString(getTitle()); + out.writeByte((byte) (isFlat() ? 1 : 0)); + out.writeFloat(getAnchorU()); + out.writeFloat(getAnchorV()); + out.writeFloat(getInfoWindowAnchorU()); + out.writeFloat(getInfoWindowAnchorV()); + out.writeFloat(getRotation()); + out.writeByte((byte) (isVisible() ? 1 : 0)); + out.writeFloat(alpha); + Icon icon = getIcon(); + out.writeByte((byte) (icon != null ? 1 : 0)); + if (icon != null) { + out.writeString(getIcon().getId()); + out.writeParcelable(getIcon().getBitmap(), flags); } + } - /** - * Get the {@link MarkerView}. - * - * @return {@link MarkerView}. - */ - @Override - public MarkerView getMarker() { - if (position == null) { - throw new InvalidMarkerPositionException(); - } - - marker.setPosition(position); - marker.setSnippet(snippet); - marker.setTitle(title); - marker.setIcon(icon); - marker.setFlat(flat); - marker.setAnchor(anchorU, anchorV); - marker.setInfoWindowAnchor(infoWindowAnchorU, infoWindowAnchorV); - marker.setRotation(rotation); - marker.setVisible(visible); - marker.setAlpha(alpha); - return marker; + /** + * Get the {@link MarkerView}. + * + * @return {@link MarkerView}. + */ + @Override + public MarkerView getMarker() { + if (position == null) { + throw new InvalidMarkerPositionException(); } - public static final Parcelable.Creator<MarkerViewOptions> CREATOR - = new Parcelable.Creator<MarkerViewOptions>() { - public MarkerViewOptions createFromParcel(Parcel in) { - return new MarkerViewOptions(in); - } + marker.setPosition(position); + marker.setSnippet(snippet); + marker.setTitle(title); + marker.setIcon(icon); + marker.setFlat(flat); + marker.setAnchor(anchorU, anchorV); + marker.setInfoWindowAnchor(infoWindowAnchorU, infoWindowAnchorV); + marker.setRotation(rotation); + marker.setVisible(visible); + marker.setAlpha(alpha); + return marker; + } - public MarkerViewOptions[] newArray(int size) { - return new MarkerViewOptions[size]; - } + public static final Parcelable.Creator<MarkerViewOptions> CREATOR = + new Parcelable.Creator<MarkerViewOptions>() { + public MarkerViewOptions createFromParcel(Parcel in) { + return new MarkerViewOptions(in); + } + + public MarkerViewOptions[] newArray(int size) { + return new MarkerViewOptions[size]; + } }; - /** - * Compares this {@link MarkerViewOptions} object with another {@link MarkerViewOptions} and - * determines if they match. - * - * @param o Another {@link MarkerViewOptions} to compare with this object. - * @return True if the {@link MarkerViewOptions} being passed in matches this - * {@link PolylineOptions} object. Else, false. - */ - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - MarkerViewOptions that = (MarkerViewOptions) o; - return marker != null ? marker.equals(that.marker) : that.marker == null; + /** + * Compares this {@link MarkerViewOptions} object with another {@link MarkerViewOptions} and + * determines if they match. + * + * @param object Another {@link MarkerViewOptions} to compare with this object. + * @return True if the {@link MarkerViewOptions} being passed in matches this + * {@link PolylineOptions} object. Else, false. + */ + @Override + public boolean equals(Object object) { + if (this == object) { + return true; } - - /** - * Gives an integer which can be used as the bucket number for storing elements of the set/map. - * This bucket number is the address of the element inside the set/map. There's no guarantee - * that this hash value will be consistent between different Java implementations, or even - * between different execution runs of the same program. - * - * @return integer value you can use for storing element. - */ - @Override - public int hashCode() { - return marker != null ? marker.hashCode() : 0; + if (object == null || getClass() != object.getClass()) { + return false; } + MarkerViewOptions that = (MarkerViewOptions) object; + return marker != null ? marker.equals(that.marker) : that.marker == null; + } + + /** + * Gives an integer which can be used as the bucket number for storing elements of the set/map. + * This bucket number is the address of the element inside the set/map. There's no guarantee + * that this hash value will be consistent between different Java implementations, or even + * between different execution runs of the same program. + * + * @return integer value you can use for storing element. + */ + @Override + public int hashCode() { + return marker != null ? marker.hashCode() : 0; + } } |