summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2016-07-05 09:24:45 +0200
committerTobrun <tobrun.van.nuland@gmail.com>2016-07-05 10:07:08 +0200
commit87209bd04f9f3e73268d2898568d6b852da97a88 (patch)
tree75620319aecdfc2f06996ad0450dfd922c826db0
parentced4ad63f79a27851bd551c4550a61fefc68edc7 (diff)
downloadqtlocation-mapboxgl-87209bd04f9f3e73268d2898568d6b852da97a88.tar.gz
[android] - add javadoc to mapboxmapoptions
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java92
1 files changed, 69 insertions, 23 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
index 17b73a29c2..0fd6b1390d 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
@@ -13,10 +13,12 @@ import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.Gravity;
+
import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.utils.ColorUtils;
+
import java.util.Arrays;
/**
@@ -176,17 +178,17 @@ public class MapboxMapOptions implements Parcelable {
mapboxMapOptions.myLocationBackgroundTintColor(typedArray.getColor(R.styleable.MapView_my_location_background_tint, Color.TRANSPARENT));
Drawable foregroundDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_foreground);
- if(foregroundDrawable==null){
- foregroundDrawable = ContextCompat.getDrawable(context,R.drawable.ic_mylocationview_normal);
+ if (foregroundDrawable == null) {
+ foregroundDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_normal);
}
Drawable foregroundBearingDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_foreground_bearing);
- if(foregroundBearingDrawable==null){
- foregroundBearingDrawable = ContextCompat.getDrawable(context,R.drawable.ic_mylocationview_bearing);
+ if (foregroundBearingDrawable == null) {
+ foregroundBearingDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_bearing);
}
Drawable backgroundDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_background);
- if(backgroundDrawable==null){
+ if (backgroundDrawable == null) {
backgroundDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_background);
}
@@ -452,20 +454,25 @@ public class MapboxMapOptions implements Parcelable {
}
/**
+ * Set the foreground drawables of the MyLocationView.
*
- * @param myLocationForegroundDrawable
- * @param myLocationBearingDrawable
+ * @param myLocationForegroundDrawable the drawable to show as foreground without bearing
+ * @param myLocationBearingDrawable the drawable to show as foreground when bearing is disabled
* @return This
*/
- public MapboxMapOptions myLocationForegroundDrawables(Drawable myLocationForegroundDrawable, Drawable myLocationBearingDrawable ) {
+ public MapboxMapOptions myLocationForegroundDrawables(Drawable myLocationForegroundDrawable, Drawable myLocationBearingDrawable) {
this.myLocationForegroundDrawable = myLocationForegroundDrawable;
this.myLocationForegroundBearingDrawable = myLocationBearingDrawable;
return this;
}
/**
+ * Set the foreground drawable of the MyLocationView.
+ * <p>
+ * The same drawable will be used for both bearing as non bearing modes.
+ * </p>
*
- * @param myLocationForegroundDrawable
+ * @param myLocationForegroundDrawable the drawable to show as foreground
* @return This
*/
public MapboxMapOptions myLocationForegroundDrawable(Drawable myLocationForegroundDrawable) {
@@ -474,7 +481,12 @@ public class MapboxMapOptions implements Parcelable {
}
/**
- * @param myLocationBackgroundDrawable
+ * Set the background drawable of MyLocationView.
+ * <p>
+ * Padding can be added to provide an offset to the background.
+ * </p>
+ *
+ * @param myLocationBackgroundDrawable the drawable to show as background
* @return This
*/
public MapboxMapOptions myLocationBackgroundDrawable(Drawable myLocationBackgroundDrawable) {
@@ -483,7 +495,12 @@ public class MapboxMapOptions implements Parcelable {
}
/**
- * @param myLocationForegroundTintColor
+ * Set the foreground tint color of MyLocationView.
+ * <p>
+ * The color will tint both the foreground and the bearing foreground drawable.
+ * </p>
+ *
+ * @param myLocationForegroundTintColor the color to tint the foreground drawable
* @return This
*/
public MapboxMapOptions myLocationForegroundTintColor(@ColorInt int myLocationForegroundTintColor) {
@@ -492,7 +509,9 @@ public class MapboxMapOptions implements Parcelable {
}
/**
- * @param myLocationBackgroundTintColor
+ * Set the background tint color of MyLocationView.
+ *
+ * @param myLocationBackgroundTintColor the color to tint the background
* @return This
*/
public MapboxMapOptions myLocationBackgroundTintColor(@ColorInt int myLocationBackgroundTintColor) {
@@ -501,7 +520,9 @@ public class MapboxMapOptions implements Parcelable {
}
/**
- * @param myLocationBackgroundPadding
+ * Set the MyLocationView padding.
+ *
+ * @param myLocationBackgroundPadding the color to tint the background
* @return This
*/
public MapboxMapOptions myLocationBackgroundPadding(int[] myLocationBackgroundPadding) {
@@ -510,7 +531,9 @@ public class MapboxMapOptions implements Parcelable {
}
/**
- * @param myLocationAccuracyTintColor
+ * Set the MyLocationView accuracy circle tint color.
+ *
+ * @param myLocationAccuracyTintColor the color to tint the accuracy circle
* @return This
*/
public MapboxMapOptions myLocationAccuracyTint(@ColorInt int myLocationAccuracyTintColor) {
@@ -519,7 +542,9 @@ public class MapboxMapOptions implements Parcelable {
}
/**
- * @param alpha
+ * Set the MyLocationView accuracy alpha value.
+ *
+ * @param alpha the alpha value
* @return This
*/
public MapboxMapOptions myLocationAccuracyAlpha(@IntRange(from = 0, to = 255) int alpha) {
@@ -702,6 +727,11 @@ public class MapboxMapOptions implements Parcelable {
return attributionMargins;
}
+ /**
+ * Get the current configured tint color for attribution for a map view.
+ *
+ * @return the tint color
+ */
@ColorInt
public int getAttributionTintColor() {
return attributionTintColor;
@@ -717,56 +747,72 @@ public class MapboxMapOptions implements Parcelable {
}
/**
- * @return
+ * Get the current configured MyLocationView foreground drawable.
+ *
+ * @return the drawable used as foreground
*/
public Drawable getMyLocationForegroundDrawable() {
return myLocationForegroundDrawable;
}
/**
- * @return
+ * Get the current configured MyLocationView foreground bearing drawable.
+ *
+ * @return the drawable used as foreground when bearing is enabled
*/
public Drawable getMyLocationForegroundBearingDrawable() {
return myLocationForegroundBearingDrawable;
}
/**
- * @return
+ * Get the current configured MyLocationView background drawable.
+ *
+ * @return the drawable used as background
*/
public Drawable getMyLocationBackgroundDrawable() {
return myLocationBackgroundDrawable;
}
/**
- * @return
+ * Get the current configured MyLocationView foreground tint color.
+ *
+ * @return the tint color
*/
public int getMyLocationForegroundTintColor() {
return myLocationForegroundTintColor;
}
/**
- * @return
+ * Get the current configured MyLocationView background tint color.
+ *
+ * @return the tint color
*/
public int getMyLocationBackgroundTintColor() {
return myLocationBackgroundTintColor;
}
/**
- * @return
+ * Get the current configured MyLocationView background padding.
+ *
+ * @return an array describing the padding in a LTRB manner
*/
public int[] getMyLocationBackgroundPadding() {
return myLocationBackgroundPadding;
}
/**
- * @return
+ * Get the current configured MyLocationView accuracy circle color tint value.
+ *
+ * @return the tint color
*/
public int getMyLocationAccuracyTintColor() {
return myLocationAccuracyTintColor;
}
/**
- * @return
+ * Get the current configured MyLocationView accuracy circle alpha value.
+ *
+ * @return the alpha value
*/
public int getMyLocationAccuracyAlpha() {
return myLocationAccuracyAlpha;