diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils')
3 files changed, 34 insertions, 5 deletions
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 e3fc765734..af3a79539f 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.graphics.Canvas; 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 class BitmapUtils { 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/ColorUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ColorUtils.java index 24c76243d9..14b18b00dc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ColorUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ColorUtils.java @@ -23,7 +23,7 @@ import java.util.regex.Pattern; public class ColorUtils { /** - * Returns a color integer associated as primary color from a theme based on a {@link Context}. + * Returns a color integer associated as primary color from a theme based on a Context. * * @param context The context used to style the color attributes. * @return The primary color value of current theme in the form 0xAARRGGBB. @@ -37,7 +37,7 @@ public class ColorUtils { } /** - * Returns a color integer associated as primary dark color from a theme based on a {@link Context}. + * Returns a color integer associated as primary dark color from a theme based on a Context. * * @param context The context used to style the color attributes. * @return The primary dark color value of current theme in the form 0xAARRGGBB. @@ -51,7 +51,7 @@ public class ColorUtils { } /** - * Returns a color integer associated as accent color from a theme based on a {@link Context}. + * Returns a color integer associated as accent color from a theme based on a Context. * * @param context The context used to style the color attributes. * @return The accent color value of current theme in the form 0xAARRGGBB. @@ -65,7 +65,7 @@ public class ColorUtils { } /** - * Returns a color state list associated with a theme based on a {@link Context} + * Returns a color state list associated with a theme based on a Context. * * @param color The color used for tinting. * @return A ColorStateList object containing the primary color of a theme @@ -85,7 +85,7 @@ public class ColorUtils { } /** - * Set a color tint list to the {@link Drawable} of an {@link ImageView}. + * Set a color tint list to the Drawable of an ImageView. * * @param imageView The view to set the default tint list. * @param tintColor The color to tint. 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 f810d6231d..007880acd1 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 @@ import com.mapbox.mapboxsdk.maps.MapboxMapOptions; */ 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)) { |