Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release-ios-v3.6.0-android-v5.1.0' into merge_mapbox_v5_1
Browse files Browse the repository at this point in the history
* release-ios-v3.6.0-android-v5.1.0:
  [android] - update CHANGELOG for release 5.1.0-beta.5 (mapbox#9316)
  [android] update mapboxServicesVersion to 2.1.2 (mapbox#9311)
  Revisit Javadoc for 5.1.0 (mapbox#9266)
  [android] Update to LOST 3.0.1 (mapbox#9302)

# Conflicts:
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java
  • Loading branch information
Tran Thuong Tien committed Jun 21, 2017
2 parents 91b1bac + 651e70a commit 00c5bad
Show file tree
Hide file tree
Showing 43 changed files with 965 additions and 222 deletions.
15 changes: 15 additions & 0 deletions platform/android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to

## 5.1.0 - TBA

## 5.1.0-beta.5 - June 21, 2017

* Update MAS dependency to 2.1.2 [#9311](https://github.com/mapbox/mapbox-gl-native/pull/9311)
* Update LOST dependency to 3.0.1 [#9302](https://github.com/mapbox/mapbox-gl-native/pull/9302)
* Fix Pulse example Parcelable creator [#9283](https://github.com/mapbox/mapbox-gl-native/pull/9283)
* Custom marker view anchoring [#9282](https://github.com/mapbox/mapbox-gl-native/pull/9282)
* Update Activity test generation [#9276](https://github.com/mapbox/mapbox-gl-native/pull/9276)
* Validate camera position before transforming [#9275](https://github.com/mapbox/mapbox-gl-native/pull/9275)
* Revisit javadoc [#9266](https://github.com/mapbox/mapbox-gl-native/pull/9266)
* Build with NDK 15 [#9263](https://github.com/mapbox/mapbox-gl-native/pull/9263)
* Snapshot with view content [#9263](https://github.com/mapbox/mapbox-gl-native/pull/9263)
* Update source changed javadoc [#9243](https://github.com/mapbox/mapbox-gl-native/pull/9243)
* Run tests on UI-thread [#9198](https://github.com/mapbox/mapbox-gl-native/pull/9198)
* Fix trackball on worker thread [#9305](https://github.com/mapbox/mapbox-gl-native/pull/9305)

## 5.1.0-beta.4 - June 9, 2017

* Option to disable location change animation [#9210](https://github.com/mapbox/mapbox-gl-native/pull/9210)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.mapbox.mapboxsdk;

import android.app.Application;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
Expand All @@ -17,10 +16,10 @@
import com.mapbox.services.android.telemetry.location.LocationEnginePriority;

/**
* The entry point of the Mapbox Android SDK.
* The entry point to initialize the Mapbox Android SDK.
* <p>
* Obtain a reference by calling {@link #getInstance(Context, String)}. Usually this class is configured in
* {@link Application#onCreate()} and is responsible for the active access token, application context, and
* Application#onCreate() and is responsible for the active access token, application context, and
* connectivity state.
* </p>
*/
Expand Down Expand Up @@ -100,6 +99,8 @@ private static void validateAccessToken() throws MapboxConfigurationException {

/**
* Application context
*
* @return the application context
*/
public static Context getApplicationContext() {
return INSTANCE.context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -78,85 +96,173 @@ 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;
initPadding();
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;
initPadding();
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;
initPadding();
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;
initPadding();
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;
initPadding();
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Factory for creating Icons from bitmap images.
* <p>
* {@link Icon} is used to display bitmaps on top of the map using {@link Marker} and {@link MarkerView}.
* icon is used to display bitmaps on top of the map using {@link Marker} and {@link MarkerView}.
* </p>
*
* @see Icon
Expand All @@ -42,6 +42,12 @@ public final class IconFactory {

private int nextId = 0;

/**
* Get a single instance of IconFactory.
*
* @param context the context to derive the application context from
* @return the single instance of IconFactory
*/
public static synchronized IconFactory getInstance(@NonNull Context context) {
if (instance == null) {
instance = new IconFactory(context.getApplicationContext());
Expand Down Expand Up @@ -71,10 +77,10 @@ private IconFactory(@NonNull Context context) {
}

/**
* Creates an {@link Icon} from a given Bitmap image.
* Creates an icon from a given Bitmap image.
*
* @param bitmap image used for creating the Icon.
* @return The {@link Icon} using the given Bitmap image.
* @return The icon using the given Bitmap image.
*/
public Icon fromBitmap(@NonNull Bitmap bitmap) {
if (nextId < 0) {
Expand All @@ -85,10 +91,10 @@ public Icon fromBitmap(@NonNull Bitmap bitmap) {
}

/**
* Create an {@link Icon} using the resource ID of a Bitmap image.
* Creates an icon using the resource ID of a Bitmap image.
*
* @param resourceId The resource ID of a Bitmap image.
* @return The {@link Icon} that was loaded from the asset or {@code null} if failed to load.
* @return The icon that was loaded from the asset or {@code null} if failed to load.
*/
public Icon fromResource(@DrawableRes int resourceId) {
Drawable drawable = ContextCompat.getDrawable(context, resourceId);
Expand All @@ -101,9 +107,9 @@ public Icon fromResource(@DrawableRes int resourceId) {
}

/**
* Provides an {@link Icon} using the default marker icon used for {@link Marker}.
* Provides an icon using the default marker icon used for {@link Marker}.
*
* @return An {@link Icon} with the default {@link Marker} icon.
* @return An icon with the default {@link Marker} icon.
*/
public Icon defaultMarker() {
if (defaultMarker == null) {
Expand All @@ -113,9 +119,9 @@ public Icon defaultMarker() {
}

/**
* Provides an {@link Icon} using the default marker icon used for {@link MarkerView}.
* Provides an icon using the default marker icon used for {@link MarkerView}.
*
* @return An {@link Icon} with the default {@link MarkerView} icon.
* @return An icon with the default {@link MarkerView} icon.
*/
public Icon defaultMarkerView() {
if (defaultMarkerView == null) {
Expand All @@ -130,10 +136,10 @@ private Icon fromInputStream(@NonNull InputStream is) {
}

/**
* Creates an {@link Icon} using the name of a Bitmap image in the assets directory.
* Creates an Icon using the name of a Bitmap image in the assets directory.
*
* @param assetName The name of a Bitmap image in the assets directory.
* @return The {@link Icon} that was loaded from the asset or {@code null} if failed to load.
* @return The Icon that was loaded from the asset or null if failed to load.
*/
public Icon fromAsset(@NonNull String assetName) {
InputStream is;
Expand All @@ -146,23 +152,22 @@ public Icon fromAsset(@NonNull String assetName) {
}

/**
* Creates an {@link Icon} using the absolute file path of a Bitmap image.
* Creates an Icon using the absolute file path of a Bitmap image.
*
* @param absolutePath The absolute path of the Bitmap image.
* @return The {@link Icon} that was loaded from the absolute path or {@code null} if failed to
* load.
* @return The Icon that was loaded from the absolute path or null if failed to load.
*/
public Icon fromPath(@NonNull String absolutePath) {
Bitmap bitmap = BitmapFactory.decodeFile(absolutePath, options);
return fromBitmap(bitmap);
}

/**
* Create an {@link Icon} using the name of a Bitmap image file located in the internal storage.
* In particular, this calls {@link Context#openFileInput(String)}.
* Create an Icon using the name of a Bitmap image file located in the internal storage.
* In particular, this calls Context#openFileInput(String).
*
* @param fileName The name of the Bitmap image file.
* @return The {@link Icon} that was loaded from the asset or {@code null} if failed to load.
* @return The Icon that was loaded from the asset or null if failed to load.
* @see <a href="https://developer.android.com/guide/topics/data/data-storage.html#filesInternal">
* Using the Internal Storage</a>
*/
Expand All @@ -177,12 +182,11 @@ public Icon fromFile(@NonNull String fileName) {
}

/**
* Create an {@link Icon} using a previously created icon identifier along with a provided
* Bitmap.
* Create an Icon using a previously created icon identifier along with a provided Bitmap.
*
* @param iconId The {@link Icon} identifier you'd like to recreate.
* @param iconId The Icon identifier you'd like to recreate.
* @param bitmap a Bitmap used to replace the current one.
* @return The {@link Icon} using the new Bitmap.
* @return The Icon using the new Bitmap.
*/
public static Icon recreate(@NonNull String iconId, @NonNull Bitmap bitmap) {
return new Icon(iconId, bitmap);
Expand Down
Loading

0 comments on commit 00c5bad

Please sign in to comment.