diff options
author | Tobrun <tobrun@mapbox.com> | 2017-06-20 15:48:24 +0200 |
---|---|---|
committer | Antonio Zugaldia <antonio@mapbox.com> | 2017-06-20 09:48:24 -0400 |
commit | a9f52e24e63af6d322b3f4744a38aab395344b1d (patch) | |
tree | 015072cdd1d3fe07894be73c3761f4ed5685e48f /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style | |
parent | 899d2b0de931ca1a7295cce35dc7cfb177a5d14b (diff) | |
download | qtlocation-mapboxgl-a9f52e24e63af6d322b3f4744a38aab395344b1d.tar.gz |
Revisit Javadoc for 5.1.0 (#9266)
* [android] - revisit public API javadoc
* [android] fix javadoc minor mistakes and typos
* grammar tweak
* add missing public javadoc
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style')
4 files changed, 51 insertions, 7 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java index 68727c8a4f..a57c440df4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java @@ -30,14 +30,29 @@ public class PropertyValue<T> { this.value = value; } + /** + * Returns if this is null + * + * @return true if this is null, false if not + */ public boolean isNull() { return value == null; } + /** + * Returns if this is a function. + * + * @return true if is a function, false if not + */ public boolean isFunction() { return !isNull() && value instanceof Function; } + /** + * Returns if this is a value. + * + * @return true if is a value, false if not + */ public boolean isValue() { return !isNull() && !isFunction(); } @@ -53,6 +68,11 @@ public class PropertyValue<T> { } } + /** + * Get the value of the property. + * + * @return the property value + */ @Nullable public T getValue() { if (isValue()) { @@ -64,6 +84,11 @@ public class PropertyValue<T> { } } + /** + * Get the color int value of the property if the value is a color. + * + * @return the color int value of the property, null if not a color value + */ @ColorInt @Nullable public Integer getColorInt() { @@ -80,6 +105,11 @@ public class PropertyValue<T> { } } + /** + * Get the string representation of a property value. + * + * @return the string representation + */ @Override public String toString() { return String.format("%s: %s", name, value); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java index b66a50b8a4..cb6465a6b1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java @@ -13,7 +13,7 @@ import com.mapbox.mapboxsdk.style.layers.TransitionOptions; /** * The global light source. * - * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#light>">The online documentation</a> + * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#light">The online documentation</a> */ @UiThread public class Light { @@ -43,7 +43,8 @@ public class Light { * * @return anchor as String */ - @Property.ANCHOR public String getAnchor() { + @Property.ANCHOR + public String getAnchor() { return nativeGetAnchor(); } @@ -106,7 +107,7 @@ public class Light { * * @return color as String */ - public String getColor() { + public String getColor() { return nativeGetColor(); } @@ -142,7 +143,7 @@ public class Light { * * @return intensity as Float */ - public float getIntensity() { + public float getIntensity() { return nativeGetIntensity(); } @@ -165,17 +166,30 @@ public class Light { } private native void nativeSetAnchor(String anchor); + private native String nativeGetAnchor(); + private native void nativeSetPosition(Position position); + private native Position nativeGetPosition(); + private native TransitionOptions nativeGetPositionTransition(); + private native void nativeSetPositionTransition(long duration, long delay); + private native void nativeSetColor(String color); + private native String nativeGetColor(); + private native TransitionOptions nativeGetColorTransition(); + private native void nativeSetColorTransition(long duration, long delay); + private native void nativeSetIntensity(float intensity); + private native float nativeGetIntensity(); + private native TransitionOptions nativeGetIntensityTransition(); + private native void nativeSetIntensityTransition(long duration, long delay); }
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java index 215db03ad2..cd6218d3e2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java @@ -18,7 +18,7 @@ public class Position { private float polarAngle; /** - * Creates a Position from a radial coordinate, an azimuthal angle & a polar angle. + * Creates a Position from a radial coordinate, an azimuthal angle and a polar angle. * * @param radialCoordinate the distance from the center of the base of an object to its light * @param azimuthalAngle the position of the light relative to 0° @@ -31,7 +31,7 @@ public class Position { } /** - * Returns a Position from a radial coordinate, an azimuthal angle & a polar angle + * Returns a Position from a radial coordinate, an azimuthal angle and a polar angle * * @param radialCoordinate the radial coordinate * @param azimuthalAngle the azimuthal angle diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs index 067efe1092..80d927128d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs @@ -17,7 +17,7 @@ import com.mapbox.mapboxsdk.style.layers.TransitionOptions; /** * The global light source. * - * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#light>">The online documentation</a> + * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#light">The online documentation</a> */ @UiThread public class Light { |