diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java index 07e038c08cf..c58cc310a8e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java @@ -27,14 +27,32 @@ public class BubbleLayout extends LinearLayout { private float strokeWidth; private int strokeColor; + /** + * Creates an instance of bubble layout. + * + * @param context The context used to inflate this bubble layout + */ public BubbleLayout(Context context) { this(context, null, 0); } + /** + * Creates an instance of bubble layout. + * + * @param context The context used to inflate this bubble layout + * @param attrs The attribute set to initialise this bubble layout from + */ public BubbleLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } + /** + * Creates an instance of bubble layout. + * + * @param context The context used to inflate this bubble layout + * @param attrs The attribute set to initialise this bubble layout from + * @param defStyleAttr The default style to apply this bubble layout with + */ public BubbleLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); @@ -78,10 +96,21 @@ static float convertDpToPixel(float dp, Context context) { return dp * (metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT); } + /** + * Get the arrow direction. + * + * @return the arrow direction + */ public ArrowDirection getArrowDirection() { return arrowDirection; } + /** + * Set the arrow direction. + * + * @param arrowDirection The direction of the arrow + * @return this + */ public BubbleLayout setArrowDirection(ArrowDirection arrowDirection) { resetPadding(); this.arrowDirection = arrowDirection; @@ -89,10 +118,21 @@ public BubbleLayout setArrowDirection(ArrowDirection arrowDirection) { return this; } + /** + * Get the arrow width. + * + * @return the width of the arrow + */ public float getArrowWidth() { return arrowWidth; } + /** + * Set the arrow width. + * + * @param arrowWidth The width of the arrow + * @return this + */ public BubbleLayout setArrowWidth(float arrowWidth) { resetPadding(); this.arrowWidth = arrowWidth; @@ -100,10 +140,21 @@ public BubbleLayout setArrowWidth(float arrowWidth) { return this; } + /** + * Get the arrow height + * + * @return the height of the arrow + */ public float getArrowHeight() { return arrowHeight; } + /** + * Set the arrow height. + * + * @param arrowHeight The height of the arrow + * @return this + */ public BubbleLayout setArrowHeight(float arrowHeight) { resetPadding(); this.arrowHeight = arrowHeight; @@ -111,10 +162,21 @@ public BubbleLayout setArrowHeight(float arrowHeight) { return this; } + /** + * Get the arrow position. + * + * @return the arrow position + */ public float getArrowPosition() { return arrowPosition; } + /** + * Get the arrow position. + * + * @param arrowPosition The arrow position + * @return this + */ public BubbleLayout setArrowPosition(float arrowPosition) { resetPadding(); this.arrowPosition = arrowPosition; @@ -122,30 +184,63 @@ public BubbleLayout setArrowPosition(float arrowPosition) { return this; } + /** + * Get the corner radius + * + * @return the corner radius + */ public float getCornersRadius() { return cornersRadius; } + /** + * Set the corner radius + * + * @param cornersRadius The corner radius + * @return this + */ public BubbleLayout setCornersRadius(float cornersRadius) { this.cornersRadius = cornersRadius; requestLayout(); return this; } + /** + * Get the bubble color. + * + * @return the bubble color + */ public int getBubbleColor() { return bubbleColor; } + /** + * Set the bubble color. + * + * @param bubbleColor The buble color + * @return this + */ public BubbleLayout setBubbleColor(int bubbleColor) { this.bubbleColor = bubbleColor; requestLayout(); return this; } + /** + * Get stroke width. + * + * @return the stroke width + */ public float getStrokeWidth() { return strokeWidth; } + /** + * Set the stroke width. + * + * @param strokeWidth The stroke width + * @return this + */ public BubbleLayout setStrokeWidth(float strokeWidth) { resetPadding(); this.strokeWidth = strokeWidth; @@ -153,10 +248,21 @@ public BubbleLayout setStrokeWidth(float strokeWidth) { return this; } + /** + * Get the stroke color. + * + * @return the stroke color + */ public int getStrokeColor() { return strokeColor; } + /** + * Set the stroke color. + * + * @param strokeColor The stroke color + * @return this + */ public BubbleLayout setStrokeColor(int strokeColor) { this.strokeColor = strokeColor; requestLayout(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java index 7ce3ad626f9..6d42842b7dc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java @@ -135,6 +135,12 @@ public void animateRotationBy(@NonNull MarkerView marker, float rotation) { } } + /** + * Set the rotation of a MarkerView to a given rotation value. + * + * @param marker The MarkerView to change its rotation value + * @param rotation The rotation value + */ public void setRotation(@NonNull MarkerView marker, float rotation) { View convertView = markerViewMap.get(marker); if (convertView != null) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java index f0f9b9236b2..44ee83265db 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java @@ -5,6 +5,9 @@ */ public class InvalidMarkerPositionException extends RuntimeException { + /** + * Creates a invalid marker position exception thrown when a Marker object is created with an invalid LatLng position. + */ public InvalidMarkerPositionException() { super("Adding an invalid Marker to a Map. " + "Missing the required position field. " diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java index 74bceb196c7..e9a0261d850 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java @@ -8,10 +8,14 @@ * This occurs either when {@link com.mapbox.mapboxsdk.Mapbox} is not correctly initialised or the provided access token * through {@link com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String)} isn't valid. *

+ * * @see com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String) */ public class MapboxConfigurationException extends RuntimeException { + /** + * Creates a Mapbox configuration exception thrown by MapboxMap when the SDK hasn't been properly initialised. + */ public MapboxConfigurationException() { super("\nUsing MapView requires setting a valid access token. Use Mapbox.getInstance(Context context, " + "String accessToken) to provide one. " diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java index 9740679cf59..72868a91d86 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java @@ -45,6 +45,9 @@ /** * UI element overlaid on a map to show the user's location. + *

+ * Use {@link MyLocationViewSettings} to manipulate the state of this view. + *

*/ public class MyLocationView extends View { @@ -155,6 +158,12 @@ public void init(LocationSource locationSource) { this.locationSource = locationSource; } + /** + * Set the foreground drawable, for internal use only. + * + * @param defaultDrawable The drawable shown when showing this view + * @param bearingDrawable The drawable shown when tracking of bearing is enabled + */ public final void setForegroundDrawables(Drawable defaultDrawable, Drawable bearingDrawable) { if (defaultDrawable == null) { return; @@ -183,6 +192,11 @@ public final void setForegroundDrawables(Drawable defaultDrawable, Drawable bear invalidateBounds(); } + /** + * Set the foreground drawable tint, for internal use only. + * + * @param color The color to tint the drawable with + */ public final void setForegroundDrawableTint(@ColorInt int color) { if (foregroundDrawable != null) { foregroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN); @@ -193,10 +207,24 @@ public final void setForegroundDrawableTint(@ColorInt int color) { invalidate(); } + /** + * Set the shadow drawable, for internal use only. + * + * @param drawable The drawable shown as shadow + */ public final void setShadowDrawable(Drawable drawable) { setShadowDrawable(drawable, 0, 0, 0, 0); } + /** + * Set the shadow drawable with some additional offset. + * + * @param drawable The drawable shown as shadow + * @param left The left offset margin + * @param top The top offset margin + * @param right The right offset margin + * @param bottom The bottom offset margin + */ public final void setShadowDrawable(Drawable drawable, int left, int top, int right, int bottom) { if (drawable != null) { backgroundDrawable = drawable; @@ -210,6 +238,11 @@ public final void setShadowDrawable(Drawable drawable, int left, int top, int ri invalidateBounds(); } + /** + * Set the shadow drawable tint color, for internal use only. + * + * @param color The tint color to apply + */ public final void setShadowDrawableTint(@ColorInt int color) { if (backgroundDrawable == null) { return; @@ -218,6 +251,11 @@ public final void setShadowDrawableTint(@ColorInt int color) { invalidate(); } + /** + * Set the accuracy tint color, for internal use only. + * + * @param color The tint color to apply + */ public final void setAccuracyTint(@ColorInt int color) { int alpha = accuracyPaint.getAlpha(); accuracyPaint.setColor(color); @@ -225,6 +263,11 @@ public final void setAccuracyTint(@ColorInt int color) { invalidate(); } + /** + * Set the accuracy alpha value, for internal use only. + * + * @param alpha The alpha accuracy value to apply + */ public final void setAccuracyAlpha(@IntRange(from = 0, to = 255) int alpha) { accuracyPaint.setAlpha(alpha); invalidate(); @@ -314,6 +357,11 @@ protected void onDraw(Canvas canvas) { } } + /** + * Set the tilt value, for internal use only. + * + * @param tilt The tilt to apply + */ public void setTilt(@FloatRange(from = 0, to = 60.0f) double tilt) { this.tilt = tilt; if (myLocationTrackingMode == MyLocationTracking.TRACKING_FOLLOW) { @@ -322,6 +370,11 @@ public void setTilt(@FloatRange(from = 0, to = 60.0f) double tilt) { invalidate(); } + /** + * Set the bearing value, for internal use only. + * + * @param bearing The bearing to apply + */ public void setBearing(double bearing) { this.bearing = bearing; if (myLocationTrackingMode == MyLocationTracking.TRACKING_NONE) { @@ -335,6 +388,11 @@ public void setBearing(double bearing) { } } + /** + * Set the bearing and tilt from a camera position, for internal use only. + * + * @param position The camera position to extract bearing and tilt from + */ public void setCameraPosition(CameraPosition position) { if (position != null) { setBearing(position.bearing); @@ -342,6 +400,9 @@ public void setCameraPosition(CameraPosition position) { } } + /** + * Called when the hosting activity is starting, for internal use only. + */ public void onStart() { if (myBearingTrackingMode == MyBearingTracking.COMPASS && compassListener.isSensorAvailable()) { compassListener.onResume(); @@ -351,6 +412,9 @@ public void onStart() { } } + /** + * Called when the hosting activity is stopping, for internal use only. + */ public void onStop() { compassListener.onPause(); toggleGps(false); @@ -382,6 +446,9 @@ protected void onDetachedFromWindow() { } } + /** + * Update current locationstate. + */ public void update() { if (isEnabled()) { myLocationBehavior.invalidate(); @@ -396,17 +463,33 @@ public void setMapboxMap(MapboxMap mapboxMap) { this.projection = mapboxMap.getProjection(); } + /** + * Set the enabled state, for internal use only. + * + * @param enabled The value to set the state to + */ @Override public void setEnabled(boolean enabled) { setEnabled(enabled, false); } + /** + * Set the enabled state, for internal use only. + * + * @param enabled The value to set the state to + * @param isCustomLocationSource Flag handling for handling user provided custom location source + */ public void setEnabled(boolean enabled, boolean isCustomLocationSource) { super.setEnabled(enabled); setVisibility(enabled ? View.VISIBLE : View.INVISIBLE); toggleGps(enabled, isCustomLocationSource); } + /** + * Save the view instance state, for internal use only. + * + * @return the marshaled representation of the view state + */ @Override protected Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); @@ -415,6 +498,11 @@ protected Parcelable onSaveInstanceState() { return bundle; } + /** + * Restore the view instance state, for internal use only. + * + * @param state the marshalled representation of the state to restore + */ @Override public void onRestoreInstanceState(Parcelable state) { if (state instanceof Bundle) { @@ -430,7 +518,7 @@ private void toggleGps(boolean enableGps) { } /** - * Enabled / Disable GPS location updates along with updating the UI + * Enabled / Disable GPS location updates along with updating the UI, for internal use only. * * @param enableGps true if GPS is to be enabled, false if GPS is to be disabled */ @@ -463,10 +551,20 @@ private void toggleGps(boolean enableGps, boolean isCustomLocationSource) { } } + /** + * Get the current location. + * + * @return the current location + */ public Location getLocation() { return location; } + /** + * Set the current location, for internal use only. + * + * @param location The current location + */ public void setLocation(Location location) { if (location == null) { this.location = null; @@ -482,10 +580,20 @@ public void setLocation(Location location) { } } + /** + * Set location change animation enabled, for internal use only. + * + * @param locationChangeAnimationEnabled True if location changes are animated + */ public void setLocationChangeAnimationEnabled(boolean locationChangeAnimationEnabled) { this.locationChangeAnimationEnabled = locationChangeAnimationEnabled; } + /** + * Set the bearing tracking mode, for internal use only. + * + * @param myBearingTrackingMode The bearing tracking mode + */ public void setMyBearingTrackingMode(@MyBearingTracking.Mode int myBearingTrackingMode) { this.myBearingTrackingMode = myBearingTrackingMode; if (myBearingTrackingMode == MyBearingTracking.COMPASS && compassListener.isSensorAvailable()) { @@ -502,6 +610,11 @@ public void setMyBearingTrackingMode(@MyBearingTracking.Mode int myBearingTracki invalidate(); } + /** + * Set the location tracking mode, for internla use only. + * + * @param myLocationTrackingMode The location tracking mode + */ public void setMyLocationTrackingMode(@MyLocationTracking.Mode int myLocationTrackingMode) { MyLocationBehaviorFactory factory = new MyLocationBehaviorFactory(); myLocationBehavior = factory.getBehavioralModel(myLocationTrackingMode); @@ -522,17 +635,32 @@ public void setMyLocationTrackingMode(@MyLocationTracking.Mode int myLocationTra invalidate(); } + /** + * Get the location tracking mode, for internal use only. + * + * @return The location tracking mode + */ @MyLocationTracking.Mode public int getMyLocationTrackingMode() { return myLocationTrackingMode; } + /** + * Get the bearing tracking mode, for internal use only. + * + * @return the bearing tracking mode + */ @MyBearingTracking.Mode public int getMyBearingTrackingMode() { return myBearingTrackingMode; } + /** + * Set the compass bearing value, for internal use only. + * + * @param bearing The compas bearing value + */ private void setCompass(double bearing) { setCompass(bearing, 0 /* no animation */); } @@ -560,14 +688,29 @@ private void setCompass(double bearing, long duration) { directionAnimator.start(); } + /** + * Get the center of this view in screen coordinates. + * + * @return the center of the view + */ public PointF getCenter() { return new PointF(getCenterX(), getCenterY()); } + /** + * Get the x value of the center of this view. + * + * @return the x value of the center of the view + */ private float getCenterX() { return (getX() + getMeasuredWidth()) / 2 + contentPaddingX - projectedX; } + /** + * Get the y value of the center of this view. + * + * @return the y value of the center of the view + */ private float getCenterY() { return (getY() + getMeasuredHeight()) / 2 + contentPaddingY - projectedY; } @@ -577,6 +720,11 @@ public void setContentPadding(int[] padding) { contentPaddingY = (padding[1] - padding[3]) / 2; } + /** + * Set the location source from which location updates are received, for internal use only. + * + * @param locationSource The location source to receive updates from + */ public void setLocationSource(LocationEngine locationSource) { toggleGps(false); this.locationSource = locationSource; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationViewSettings.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationViewSettings.java index e9d823ebda6..2ad1bf7ebc0 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationViewSettings.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationViewSettings.java @@ -5,9 +5,9 @@ import android.support.annotation.IntRange; import android.support.annotation.NonNull; +import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.constants.MyLocationTracking; import com.mapbox.mapboxsdk.maps.FocalPointChangeListener; -import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.maps.MapboxMapOptions; import com.mapbox.mapboxsdk.maps.Projection; @@ -77,6 +77,11 @@ public MyLocationViewSettings(MyLocationView myLocationView, Projection projecti this.focalPointChangeListener = focalPointChangedListener; } + /** + * Initialise this with MapboxMapOptions. + * + * @param options the options to initialise this class from + */ public void initialise(@NonNull MapboxMapOptions options) { CameraPosition position = options.getCamera(); if (position != null && !position.equals(CameraPosition.DEFAULT)) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.java index 95cb7d66c43..d572d696db8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.java @@ -115,6 +115,12 @@ public void run() { }).start(); } + /** + * Get the single instance of offline manager. + * + * @param context the context used to host the offline manager + * @return the single instance of offline manager + */ public static synchronized OfflineManager getInstance(Context context) { if (instance == null) { instance = new OfflineManager(context); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java index 610d9c0ca83..eafef80e8d1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java @@ -39,6 +39,12 @@ public interface ResourceTransformCallback { // File source instance is kept alive after initialization private static FileSource INSTANCE; + /** + * Get the single instance of FileSource. + * + * @param context the context to derive the cache path from + * @return the single instance of FileSource + */ public static synchronized FileSource getInstance(Context context) { if (INSTANCE == null) { String cachePath = getCachePath(context); @@ -48,6 +54,12 @@ public static synchronized FileSource getInstance(Context context) { return INSTANCE; } + /** + * Get the cache path for a context. + * + * @param context the context to derive the cache path from + * @return the cache path + */ public static String getCachePath(Context context) { // Default value boolean setStorageExternal = MapboxConstants.DEFAULT_SET_STORAGE_EXTERNAL; 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 68727c8a4fc..a57c440df4e 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 PropertyValue(@NonNull String name, T value) { 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 Function getFunction() { } } + /** + * Get the value of the property. + * + * @return the property value + */ @Nullable public T getValue() { if (isValue()) { @@ -64,6 +84,11 @@ public T getValue() { } } + /** + * 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 Integer getColorInt() { } } + /** + * 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/utils/BitmapUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java index e3fc7657342..af3a79539fd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java @@ -5,8 +5,17 @@ import android.support.annotation.NonNull; import android.view.View; +/** + * Utility class for creating bitmaps + */ public class BitmapUtils { + /** + * Convert a view to a bitmap. + * + * @param view the view to convert + * @return the converted bitmap + */ public static Bitmap createBitmapFromView(@NonNull View view) { view.setDrawingCacheEnabled(true); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); @@ -22,6 +31,13 @@ public static Bitmap createBitmapFromView(@NonNull View view) { return snapshot; } + /** + * Create a bitmap from a background and a foreground bitmap + * + * @param background The bitmap placed in the background + * @param foreground The bitmap placed in the foreground + * @return the merged bitmap + */ public static Bitmap mergeBitmap(@NonNull Bitmap background, @NonNull Bitmap foreground) { Bitmap result = Bitmap.createBitmap(background.getWidth(), background.getHeight(), background.getConfig()); Canvas canvas = new Canvas(result); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MapFragmentUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MapFragmentUtils.java index f810d6231da..007880acd13 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MapFragmentUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MapFragmentUtils.java @@ -18,12 +18,25 @@ */ public class MapFragmentUtils { + /** + * Convert MapboxMapOptions to a bundle of fragment arguments. + * + * @param options The MapboxMapOptions to convert + * @return a bundle of converted fragment arguments + */ public static Bundle createFragmentArgs(MapboxMapOptions options) { Bundle bundle = new Bundle(); bundle.putParcelable(MapboxConstants.FRAG_ARG_MAPBOXMAPOPTIONS, options); return bundle; } + /** + * Convert a bundle of fragment arguments to MapboxMapOptions. + * + * @param context The context of the activity hosting the fragment + * @param args The fragment arguments + * @return converted MapboxMapOptions + */ public static MapboxMapOptions resolveArgs(Context context, Bundle args) { MapboxMapOptions options; if (args != null && args.containsKey(MapboxConstants.FRAG_ARG_MAPBOXMAPOPTIONS)) {