[android] Tidy up latest MapView changes. Fix JavaDoc warnings. Implement overview and packge-info files.
For #2002
This commit is contained in:
@@ -79,13 +79,16 @@ android.libraryVariants.all { variant ->
|
||||
destinationDir = new File(destinationDir, variant.baseName)
|
||||
source = files(variant.javaCompile.source)
|
||||
classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath)
|
||||
options.windowTitle("Mapbox Android SDK")
|
||||
options.docTitle("Mapbox Android SDK")
|
||||
options.header("<b>Mapbox Android SDK</b>")
|
||||
//exclude '**/R.java'
|
||||
options.windowTitle("Mapbox Android SDK $VERSION_NAME Reference")
|
||||
options.docTitle("Mapbox Android SDK $VERSION_NAME")
|
||||
options.header("Mapbox Android SDK $VERSION_NAME Reference")
|
||||
options.bottom("© 2015 Mapbox. All rights reserved.")
|
||||
options.links("http://docs.oracle.com/javase/7/docs/api/")
|
||||
// TODO this will fail as package-list file not online, need to use offline
|
||||
options.links("http://d.android.com/reference/")
|
||||
options.linksOffline("http://d.android.com/reference/", "$System.env.ANDROID_HOME/docs/reference")
|
||||
options.overview("src/main/java/overview.html")
|
||||
options.group("Mapbox Android SDK", "com.mapbox.*")
|
||||
options.group("Third Party Libraries", "com.almeros.*")
|
||||
// TODO exclude generated R, BuildConfig, com.almeros.*
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Do not use this package.
|
||||
* Do not use this package. Used internally by the SDK.
|
||||
*/
|
||||
package com.almeros.android.multitouch.gesturedetectors;
|
||||
|
||||
@@ -80,7 +80,6 @@ public class Polygon extends MultiPoint {
|
||||
/**
|
||||
* UNIMPLEMENTED: Needs implementation in Native.
|
||||
* https://github.com/mapbox/mapbox-gl-native/issues/1737
|
||||
* @return stroke width as float
|
||||
*/
|
||||
public void setStrokeWidth(float width) {
|
||||
strokeWidth = width;
|
||||
|
||||
@@ -34,7 +34,6 @@ public class Polyline extends MultiPoint {
|
||||
* Sets the width of the polyline.
|
||||
*
|
||||
* @param width in pixels
|
||||
* @return
|
||||
*/
|
||||
public void setWidth(float width) {
|
||||
this.width = width;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class PolylineOptions extends MultiPointOptions {
|
||||
* Sets the width of the polyline.
|
||||
*
|
||||
* @param width in pixels
|
||||
* @return
|
||||
* @return a new PolylineOptions
|
||||
*/
|
||||
public PolylineOptions width(float width) {
|
||||
((Polyline)annotation).width = width;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* This package contains classes to add and manage annotations and markers in your map.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.annotations;
|
||||
@@ -2,11 +2,22 @@ package com.mapbox.mapboxsdk.constants;
|
||||
|
||||
import android.support.annotation.StringDef;
|
||||
|
||||
import com.mapbox.mapboxsdk.views.MapView;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* Style provides URLs to several professional styles designed by Mapbox.
|
||||
* <p/>
|
||||
* These styles are all ready to go in your app. To load one, pass it into {@link MapView#setStyleUrl(String)}
|
||||
*
|
||||
* @see MapView#setStyleUrl(String)
|
||||
*/
|
||||
public class Style {
|
||||
|
||||
/**
|
||||
* Indicates the parameter accepts one of the values from {@link Style}.
|
||||
*/
|
||||
@StringDef({MAPBOX_STREETS, EMERALD, LIGHT, DARK, SATELLITE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface StyleUrl {
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* This package provides access to several map related constants and bundled styles.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.constants;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* This package contains exceptions thrown in this SDK.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.exceptions;
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* This package contains classes that deal with geometry and map coordinates. Many SDK functions
|
||||
* accept or return these classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.geometry;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Do not use this package. Used internally by the SDK.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.http;
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* This package contains the {@link com.mapbox.mapboxsdk.MapFragment} class. {@code MapFragment}
|
||||
* provides a quick and easy way to add a map to your app.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk;
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* This package contains the {@link com.mapbox.mapboxsdk.utils.ApiAccess} class. {@code ApiAccess}
|
||||
* provides a methods to load a Mapbox access token.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.utils;
|
||||
@@ -1297,7 +1297,7 @@ public final class MapView extends FrameLayout {
|
||||
* <p/>
|
||||
* {@code url} can take the following forms:
|
||||
* <ul>
|
||||
* <li>{@code MapView.StyleUrls.*}: load one of the bundled styles in {@link Style}.</li>
|
||||
* <li>{@code Style.*}: load one of the bundled styles in {@link Style}.</li>
|
||||
* <li>{@code mapbox://styles/<user>/<style>}:
|
||||
* retrieves the style from a <a href="https://www.mapbox.com/account/">Mapbox account.</a>
|
||||
* {@code user} is your username. {@code style} is the ID of your custom
|
||||
@@ -1328,9 +1328,20 @@ public final class MapView extends FrameLayout {
|
||||
mNativeMapView.setStyleUrl(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a new map style from the specified bundled style.
|
||||
* <p/>
|
||||
* This method is asynchronous and will return immediately before the style finishes loading.
|
||||
* If you wish to wait for the map to finish loading listen for the {@link MapView#DID_FINISH_LOADING_MAP} event.
|
||||
* <p/>
|
||||
* If the style fails to load or an invalid style URL is set, the map view will become blank.
|
||||
* An error message will be logged in the Android logcat and {@link MapView#DID_FAIL_LOADING_MAP} event will be sent.
|
||||
*
|
||||
* @param style The bundled style. Accepts one of the values from {@link Style}.
|
||||
*/
|
||||
@UiThread
|
||||
@NonNull
|
||||
public void setStyle(@Style.StyleUrl String style){
|
||||
public void setStyle(@Style.StyleUrl String style) {
|
||||
setStyleUrl(style);
|
||||
}
|
||||
|
||||
@@ -1854,6 +1865,7 @@ public final class MapView extends FrameLayout {
|
||||
/**
|
||||
* Get Top Offset for the annotation symbol.
|
||||
* Used by InfoWindow
|
||||
*
|
||||
* @param symbolName Annotation Symbol
|
||||
* @return Top Offset in pixels
|
||||
*/
|
||||
@@ -1877,6 +1889,7 @@ public final class MapView extends FrameLayout {
|
||||
|
||||
/**
|
||||
* Get ScreenDensity of device
|
||||
*
|
||||
* @return Screen Density ratio
|
||||
*/
|
||||
public float getScreenDensity() {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* This package contains the {@link com.mapbox.mapboxsdk.views.MapView} and related classes.
|
||||
* {@code MapView} is the core component of this SDK and adds a map to your app.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.views;
|
||||
16
android/java/MapboxGLAndroidSDK/src/main/java/overview.html
Normal file
16
android/java/MapboxGLAndroidSDK/src/main/java/overview.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<body>
|
||||
An open source OpenGL-based vector map solution for Android with full styling capabilities.
|
||||
<p/>
|
||||
For more information, check out <a href="https://www.mapbox.com/android-sdk/">our online overview</a>.
|
||||
<p/>
|
||||
<img src="https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/ios/screenshot.png"/>
|
||||
<h2>Changelog</h2>
|
||||
<h3>2.1.0</h3>
|
||||
Initial release.
|
||||
<h3>2.0.0</h3>
|
||||
Initial preview release.
|
||||
<h3>0.1.0</h3>
|
||||
<p>Initial beta release.</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user