Prefix library resources to avoid naming conflicts (#6878)
* [android] - add library resource prefix * update SDK resources with prefix * fixup tests
@@ -45,6 +45,10 @@ android {
|
||||
buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision())
|
||||
}
|
||||
|
||||
android {
|
||||
resourcePrefix 'mapbox_'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.res.srcDirs += 'src/main/res-public'
|
||||
}
|
||||
|
||||
@@ -120,14 +120,14 @@ public final class IconFactory {
|
||||
|
||||
public Icon defaultMarker() {
|
||||
if (mDefaultMarker == null) {
|
||||
mDefaultMarker = fromResource(R.drawable.default_marker);
|
||||
mDefaultMarker = fromResource(R.drawable.mapbox_marker_icon_default);
|
||||
}
|
||||
return mDefaultMarker;
|
||||
}
|
||||
|
||||
public Icon defaultMarkerView() {
|
||||
if (mDefaultMarkerView == null) {
|
||||
mDefaultMarkerView = fromResource(R.drawable.default_markerview);
|
||||
mDefaultMarkerView = fromResource(R.drawable.mapbox_markerview_icon_default);
|
||||
}
|
||||
return mDefaultMarkerView;
|
||||
}
|
||||
|
||||
@@ -129,8 +129,8 @@ public class InfoWindow {
|
||||
final float mapRight = mapView.getRight();
|
||||
final float mapLeft = mapView.getLeft();
|
||||
|
||||
float marginHorizontal = resources.getDimension(R.dimen.infowindow_margin);
|
||||
float tipViewOffset = resources.getDimension(R.dimen.infowindow_tipview_width) / 2;
|
||||
float marginHorizontal = resources.getDimension(R.dimen.mapbox_infowindow_margin);
|
||||
float tipViewOffset = resources.getDimension(R.dimen.mapbox_infowindow_tipview_width) / 2;
|
||||
float tipViewMarginLeft = view.getMeasuredWidth() / 2 - tipViewOffset;
|
||||
|
||||
boolean outOfBoundsLeft = false;
|
||||
|
||||
@@ -20,7 +20,7 @@ final class InfoWindowTipView extends View {
|
||||
super(context, attrs);
|
||||
|
||||
mPath = new Path();
|
||||
mLineWidth = (int) context.getResources().getDimension(R.dimen.infowindow_line_width);
|
||||
mLineWidth = (int) context.getResources().getDimension(R.dimen.mapbox_infowindow_line_width);
|
||||
mPaint = new Paint();
|
||||
mPaint.setColor(Color.WHITE);
|
||||
mPaint.setAntiAlias(true);
|
||||
|
||||
@@ -25,7 +25,7 @@ class InfoWindowView extends RelativeLayout {
|
||||
}
|
||||
|
||||
private void initialize(Context context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.infowindow_content, this);
|
||||
LayoutInflater.from(context).inflate(R.layout.mapbox_infowindow_content, this);
|
||||
mTipView = (InfoWindowTipView) findViewById(R.id.infowindow_tipview);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ class InfoWindowView extends RelativeLayout {
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mTipView.getLayoutParams();
|
||||
layoutParams.leftMargin = marginLeft;
|
||||
// This is a bit of a hack but prevents an occasional gap between the InfoWindow
|
||||
layoutParams.topMargin = (int) getResources().getDimension(R.dimen.infowindow_offset);
|
||||
layoutParams.topMargin = (int) getResources().getDimension(R.dimen.mapbox_infowindow_offset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public class Marker extends Annotation {
|
||||
|
||||
private InfoWindow getInfoWindow(@NonNull MapView mapView) {
|
||||
if (infoWindow == null && mapView.getContext() != null) {
|
||||
infoWindow = new InfoWindow(mapView, R.layout.infowindow_view, getMapboxMap());
|
||||
infoWindow = new InfoWindow(mapView, R.layout.mapbox_infowindow_view, getMapboxMap());
|
||||
}
|
||||
return infoWindow;
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ public class MarkerViewManager {
|
||||
ViewHolder viewHolder;
|
||||
if (convertView == null) {
|
||||
viewHolder = new ViewHolder();
|
||||
convertView = inflater.inflate(R.layout.view_image_marker, parent, false);
|
||||
convertView = inflater.inflate(R.layout.mapbox_view_image_marker, parent, false);
|
||||
viewHolder.imageView = (ImageView) convertView.findViewById(R.id.image);
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
|
||||
@@ -154,12 +154,12 @@ public final class CameraPosition implements Parcelable {
|
||||
public Builder(TypedArray typedArray) {
|
||||
super();
|
||||
if (typedArray != null) {
|
||||
this.bearing = typedArray.getFloat(R.styleable.MapView_direction, 0.0f);
|
||||
double lat = typedArray.getFloat(R.styleable.MapView_center_latitude, 0.0f);
|
||||
double lng = typedArray.getFloat(R.styleable.MapView_center_longitude, 0.0f);
|
||||
this.bearing = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_direction, 0.0f);
|
||||
double lat = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_center_latitude, 0.0f);
|
||||
double lng = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_center_longitude, 0.0f);
|
||||
this.target = new LatLng(lat, lng);
|
||||
this.tilt = typedArray.getFloat(R.styleable.MapView_tilt, 0.0f);
|
||||
this.zoom = typedArray.getFloat(R.styleable.MapView_zoom, 0.0f);
|
||||
this.tilt = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_tilt, 0.0f);
|
||||
this.zoom = typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_zoom, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,16 +94,16 @@ public final class MapFragment extends Fragment {
|
||||
Drawable foregroundBearingDrawable = options.getMyLocationForegroundBearingDrawable();
|
||||
if (foregroundDrawable == null || foregroundBearingDrawable == null) {
|
||||
if (foregroundDrawable == null) {
|
||||
foregroundDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_normal);
|
||||
foregroundDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_icon_default);
|
||||
}
|
||||
if (foregroundBearingDrawable == null) {
|
||||
foregroundBearingDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_bearing);
|
||||
foregroundBearingDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_icon_bearing);
|
||||
}
|
||||
options.myLocationForegroundDrawables(foregroundDrawable, foregroundBearingDrawable);
|
||||
}
|
||||
|
||||
if (options.getMyLocationBackgroundDrawable() == null) {
|
||||
options.myLocationBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_background));
|
||||
options.myLocationBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_bg_shape));
|
||||
}
|
||||
|
||||
return map = new MapView(inflater.getContext(), options);
|
||||
|
||||
@@ -190,7 +190,7 @@ public class MapView extends FrameLayout {
|
||||
private void initialize(@NonNull Context context, @NonNull MapboxMapOptions options) {
|
||||
if (isInEditMode()) {
|
||||
// if we are in an editor mode we show an image of a map
|
||||
LayoutInflater.from(context).inflate(R.layout.mapview_preview, this);
|
||||
LayoutInflater.from(context).inflate(R.layout.mapbox_mapview_preview, this);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class MapView extends FrameLayout {
|
||||
projection = mapboxMap.getProjection();
|
||||
|
||||
icons = new ArrayList<>();
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.mapview_internal, this);
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.mapbox_mapview_internal, this);
|
||||
setWillNotDraw(false);
|
||||
|
||||
if (options.getTextureMode()) {
|
||||
@@ -329,7 +329,7 @@ public class MapView extends FrameLayout {
|
||||
if (compassMargins != null) {
|
||||
uiSettings.setCompassMargins(compassMargins[0], compassMargins[1], compassMargins[2], compassMargins[3]);
|
||||
} else {
|
||||
int tenDp = (int) getResources().getDimension(R.dimen.ten_dp);
|
||||
int tenDp = (int) getResources().getDimension(R.dimen.mapbox_ten_dp);
|
||||
uiSettings.setCompassMargins(tenDp, tenDp, tenDp, tenDp);
|
||||
}
|
||||
uiSettings.setCompassFadeFacingNorth(options.getCompassFadeFacingNorth());
|
||||
@@ -341,7 +341,7 @@ public class MapView extends FrameLayout {
|
||||
if (logoMargins != null) {
|
||||
uiSettings.setLogoMargins(logoMargins[0], logoMargins[1], logoMargins[2], logoMargins[3]);
|
||||
} else {
|
||||
int sixteenDp = (int) getResources().getDimension(R.dimen.sixteen_dp);
|
||||
int sixteenDp = (int) getResources().getDimension(R.dimen.mapbox_sixteen_dp);
|
||||
uiSettings.setLogoMargins(sixteenDp, sixteenDp, sixteenDp, sixteenDp);
|
||||
}
|
||||
|
||||
@@ -353,8 +353,8 @@ public class MapView extends FrameLayout {
|
||||
uiSettings.setAttributionMargins(attributionMargins[0], attributionMargins[1], attributionMargins[2], attributionMargins[3]);
|
||||
} else {
|
||||
Resources resources = getResources();
|
||||
int sevenDp = (int) resources.getDimension(R.dimen.seven_dp);
|
||||
int seventySixDp = (int) resources.getDimension(R.dimen.seventy_six_dp);
|
||||
int sevenDp = (int) resources.getDimension(R.dimen.mapbox_seven_dp);
|
||||
int seventySixDp = (int) resources.getDimension(R.dimen.mapbox_seventy_six_dp);
|
||||
uiSettings.setAttributionMargins(seventySixDp, sevenDp, sevenDp, sevenDp);
|
||||
}
|
||||
|
||||
@@ -2930,10 +2930,10 @@ public class MapView extends FrameLayout {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mapView.getContext(), R.style.TelemAlertDialogStyle);
|
||||
builder.setTitle(R.string.attributionsDialogTitle);
|
||||
String[] items = mapView.getContext().getResources().getStringArray(R.array.attribution_names);
|
||||
builder.setAdapter(new ArrayAdapter<>(mapView.getContext(), R.layout.attribution_list_item, items), this);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mapView.getContext(), R.style.mapbox_AlertDialogStyle);
|
||||
builder.setTitle(R.string.mapbox_attributionsDialogTitle);
|
||||
String[] items = mapView.getContext().getResources().getStringArray(R.array.mapbox_attribution_names);
|
||||
builder.setAdapter(new ArrayAdapter<>(mapView.getContext(), R.layout.mapbox_attribution_list_item, items), this);
|
||||
AlertDialog attributionDialog = builder.show();
|
||||
|
||||
// TODO Change listview text color to mapView.getAttributionTintColor()
|
||||
@@ -2944,27 +2944,27 @@ public class MapView extends FrameLayout {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final Context context = ((Dialog) dialog).getContext();
|
||||
if (which == ATTRIBUTION_INDEX_TELEMETRY_SETTINGS) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.TelemAlertDialogStyle);
|
||||
builder.setTitle(R.string.attributionTelemetryTitle);
|
||||
builder.setMessage(R.string.attributionTelemetryMessage);
|
||||
builder.setPositiveButton(R.string.attributionTelemetryPositive, new DialogInterface.OnClickListener() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.mapbox_AlertDialogStyle);
|
||||
builder.setTitle(R.string.mapbox_attributionTelemetryTitle);
|
||||
builder.setMessage(R.string.mapbox_attributionTelemetryMessage);
|
||||
builder.setPositiveButton(R.string.mapbox_attributionTelemetryPositive, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
MapboxEventManager.getMapboxEventManager().setTelemetryEnabled(true);
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
builder.setNeutralButton(R.string.attributionTelemetryNeutral, new DialogInterface.OnClickListener() {
|
||||
builder.setNeutralButton(R.string.mapbox_attributionTelemetryNeutral, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String url = context.getResources().getStringArray(R.array.attribution_links)[3];
|
||||
String url = context.getResources().getStringArray(R.array.mapbox_attribution_links)[3];
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url));
|
||||
context.startActivity(intent);
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.attributionTelemetryNegative, new DialogInterface.OnClickListener() {
|
||||
builder.setNegativeButton(R.string.mapbox_attributionTelemetryNegative, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
MapboxEventManager.getMapboxEventManager().setTelemetryEnabled(false);
|
||||
@@ -2978,7 +2978,7 @@ public class MapView extends FrameLayout {
|
||||
telemDialog.getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(mapView.getAttributionTintColor());
|
||||
return;
|
||||
}
|
||||
String url = context.getResources().getStringArray(R.array.attribution_links)[which];
|
||||
String url = context.getResources().getStringArray(R.array.mapbox_attribution_links)[which];
|
||||
if (which == ATTRIBUTION_INDEX_IMPROVE_THIS_MAP) {
|
||||
LatLng latLng = mapView.getMapboxMap().getCameraPosition().target;
|
||||
url = String.format(url, latLng.getLongitude(), latLng.getLatitude(), (int) mapView.getZoom());
|
||||
|
||||
@@ -170,76 +170,76 @@ public class MapboxMapOptions implements Parcelable {
|
||||
public static MapboxMapOptions createFromAttributes(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
MapboxMapOptions mapboxMapOptions = new MapboxMapOptions();
|
||||
float screenDensity = context.getResources().getDisplayMetrics().density;
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MapView, 0, 0);
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.mapbox_MapView, 0, 0);
|
||||
try {
|
||||
mapboxMapOptions.debugActive(typedArray.getBoolean(R.styleable.MapView_debug_active, false));
|
||||
mapboxMapOptions.debugActive(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_debug_active, false));
|
||||
|
||||
mapboxMapOptions.camera(new CameraPosition.Builder(typedArray).build());
|
||||
|
||||
mapboxMapOptions.accessToken(typedArray.getString(R.styleable.MapView_access_token));
|
||||
mapboxMapOptions.styleUrl(typedArray.getString(R.styleable.MapView_style_url));
|
||||
mapboxMapOptions.apiBaseUrl(typedArray.getString(R.styleable.MapView_api_base_url));
|
||||
mapboxMapOptions.accessToken(typedArray.getString(R.styleable.mapbox_MapView_mapbox_access_token));
|
||||
mapboxMapOptions.styleUrl(typedArray.getString(R.styleable.mapbox_MapView_mapbox_style_url));
|
||||
mapboxMapOptions.apiBaseUrl(typedArray.getString(R.styleable.mapbox_MapView_mapbox_api_base_url));
|
||||
|
||||
mapboxMapOptions.zoomGesturesEnabled(typedArray.getBoolean(R.styleable.MapView_zoom_enabled, true));
|
||||
mapboxMapOptions.scrollGesturesEnabled(typedArray.getBoolean(R.styleable.MapView_scroll_enabled, true));
|
||||
mapboxMapOptions.rotateGesturesEnabled(typedArray.getBoolean(R.styleable.MapView_rotate_enabled, true));
|
||||
mapboxMapOptions.tiltGesturesEnabled(typedArray.getBoolean(R.styleable.MapView_tilt_enabled, true));
|
||||
mapboxMapOptions.zoomControlsEnabled(typedArray.getBoolean(R.styleable.MapView_zoom_controls_enabled, false));
|
||||
mapboxMapOptions.zoomGesturesEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_zoom_enabled, true));
|
||||
mapboxMapOptions.scrollGesturesEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_scroll_enabled, true));
|
||||
mapboxMapOptions.rotateGesturesEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_rotate_enabled, true));
|
||||
mapboxMapOptions.tiltGesturesEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_tilt_enabled, true));
|
||||
mapboxMapOptions.zoomControlsEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_zoom_controls_enabled, false));
|
||||
|
||||
mapboxMapOptions.maxZoom(typedArray.getFloat(R.styleable.MapView_zoom_max, MapboxConstants.MAXIMUM_ZOOM));
|
||||
mapboxMapOptions.minZoom(typedArray.getFloat(R.styleable.MapView_zoom_min, MapboxConstants.MINIMUM_ZOOM));
|
||||
mapboxMapOptions.maxZoom(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_zoom_max, MapboxConstants.MAXIMUM_ZOOM));
|
||||
mapboxMapOptions.minZoom(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_zoom_min, MapboxConstants.MINIMUM_ZOOM));
|
||||
|
||||
mapboxMapOptions.compassEnabled(typedArray.getBoolean(R.styleable.MapView_compass_enabled, true));
|
||||
mapboxMapOptions.compassGravity(typedArray.getInt(R.styleable.MapView_compass_gravity, Gravity.TOP | Gravity.END));
|
||||
mapboxMapOptions.compassMargins(new int[]{(int) (typedArray.getDimension(R.styleable.MapView_compass_margin_left, DIMENSION_TEN_DP) * screenDensity)
|
||||
, ((int) typedArray.getDimension(R.styleable.MapView_compass_margin_top, DIMENSION_TEN_DP * screenDensity))
|
||||
, ((int) typedArray.getDimension(R.styleable.MapView_compass_margin_right, DIMENSION_TEN_DP * screenDensity))
|
||||
, ((int) typedArray.getDimension(R.styleable.MapView_compass_margin_bottom, DIMENSION_TEN_DP * screenDensity))});
|
||||
mapboxMapOptions.compassFadesWhenFacingNorth(typedArray.getBoolean(R.styleable.MapView_compass_fade_facing_north, true));
|
||||
mapboxMapOptions.compassEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_compass_enabled, true));
|
||||
mapboxMapOptions.compassGravity(typedArray.getInt(R.styleable.mapbox_MapView_mapbox_compass_gravity, Gravity.TOP | Gravity.END));
|
||||
mapboxMapOptions.compassMargins(new int[]{(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_compass_margin_left, DIMENSION_TEN_DP) * screenDensity)
|
||||
, ((int) typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_compass_margin_top, DIMENSION_TEN_DP * screenDensity))
|
||||
, ((int) typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_compass_margin_right, DIMENSION_TEN_DP * screenDensity))
|
||||
, ((int) typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_compass_margin_bottom, DIMENSION_TEN_DP * screenDensity))});
|
||||
mapboxMapOptions.compassFadesWhenFacingNorth(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_compass_fade_facing_north, true));
|
||||
|
||||
mapboxMapOptions.logoEnabled(typedArray.getBoolean(R.styleable.MapView_logo_enabled, true));
|
||||
mapboxMapOptions.logoGravity(typedArray.getInt(R.styleable.MapView_logo_gravity, Gravity.BOTTOM | Gravity.START));
|
||||
mapboxMapOptions.logoMargins(new int[]{(int) (typedArray.getDimension(R.styleable.MapView_logo_margin_left, DIMENSION_SIXTEEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_logo_margin_top, DIMENSION_SIXTEEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_logo_margin_right, DIMENSION_SIXTEEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_logo_margin_bottom, DIMENSION_SIXTEEN_DP) * screenDensity)});
|
||||
mapboxMapOptions.logoEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_logo_enabled, true));
|
||||
mapboxMapOptions.logoGravity(typedArray.getInt(R.styleable.mapbox_MapView_mapbox_logo_gravity, Gravity.BOTTOM | Gravity.START));
|
||||
mapboxMapOptions.logoMargins(new int[]{(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_logo_margin_left, DIMENSION_SIXTEEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_logo_margin_top, DIMENSION_SIXTEEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_logo_margin_right, DIMENSION_SIXTEEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_logo_margin_bottom, DIMENSION_SIXTEEN_DP) * screenDensity)});
|
||||
|
||||
mapboxMapOptions.attributionTintColor(typedArray.getColor(R.styleable.MapView_attribution_tint, -1));
|
||||
mapboxMapOptions.attributionEnabled(typedArray.getBoolean(R.styleable.MapView_attribution_enabled, true));
|
||||
mapboxMapOptions.attributionGravity(typedArray.getInt(R.styleable.MapView_attribution_gravity, Gravity.BOTTOM));
|
||||
mapboxMapOptions.attributionMargins(new int[]{(int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_left, DIMENSION_SEVENTY_SIX_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_top, DIMENSION_SEVEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_right, DIMENSION_SEVEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_bottom, DIMENSION_SEVEN_DP) * screenDensity)});
|
||||
mapboxMapOptions.attributionTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_attribution_tint, -1));
|
||||
mapboxMapOptions.attributionEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_attribution_enabled, true));
|
||||
mapboxMapOptions.attributionGravity(typedArray.getInt(R.styleable.mapbox_MapView_mapbox_attribution_gravity, Gravity.BOTTOM));
|
||||
mapboxMapOptions.attributionMargins(new int[]{(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_attribution_margin_left, DIMENSION_SEVENTY_SIX_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_attribution_margin_top, DIMENSION_SEVEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_attribution_margin_right, DIMENSION_SEVEN_DP) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_attribution_margin_bottom, DIMENSION_SEVEN_DP) * screenDensity)});
|
||||
|
||||
mapboxMapOptions.locationEnabled(typedArray.getBoolean(R.styleable.MapView_my_location_enabled, false));
|
||||
mapboxMapOptions.myLocationForegroundTintColor(typedArray.getColor(R.styleable.MapView_my_location_foreground_tint, Color.TRANSPARENT));
|
||||
mapboxMapOptions.myLocationBackgroundTintColor(typedArray.getColor(R.styleable.MapView_my_location_background_tint, Color.TRANSPARENT));
|
||||
mapboxMapOptions.locationEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_my_location_enabled, false));
|
||||
mapboxMapOptions.myLocationForegroundTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_my_location_foreground_tint, Color.TRANSPARENT));
|
||||
mapboxMapOptions.myLocationBackgroundTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_my_location_background_tint, Color.TRANSPARENT));
|
||||
|
||||
Drawable foregroundDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_foreground);
|
||||
Drawable foregroundDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_my_location_foreground);
|
||||
if (foregroundDrawable == null) {
|
||||
foregroundDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_normal);
|
||||
foregroundDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_icon_default);
|
||||
}
|
||||
|
||||
Drawable foregroundBearingDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_foreground_bearing);
|
||||
Drawable foregroundBearingDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_my_location_foreground_bearing);
|
||||
if (foregroundBearingDrawable == null) {
|
||||
foregroundBearingDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_bearing);
|
||||
foregroundBearingDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_icon_bearing);
|
||||
}
|
||||
|
||||
Drawable backgroundDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_background);
|
||||
Drawable backgroundDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_my_location_background);
|
||||
if (backgroundDrawable == null) {
|
||||
backgroundDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_background);
|
||||
backgroundDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_bg_shape);
|
||||
}
|
||||
|
||||
mapboxMapOptions.myLocationForegroundDrawables(foregroundDrawable, foregroundBearingDrawable);
|
||||
mapboxMapOptions.myLocationBackgroundDrawable(backgroundDrawable);
|
||||
mapboxMapOptions.myLocationBackgroundPadding(new int[]{(int) (typedArray.getDimension(R.styleable.MapView_my_location_background_left, 0) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_my_location_background_top, 0) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_my_location_background_right, 0) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.MapView_my_location_background_bottom, 0) * screenDensity)});
|
||||
mapboxMapOptions.myLocationAccuracyAlpha(typedArray.getInt(R.styleable.MapView_my_location_accuracy_alpha, 100));
|
||||
mapboxMapOptions.myLocationAccuracyTint(typedArray.getColor(R.styleable.MapView_my_location_accuracy_tint, ColorUtils.getPrimaryColor(context)));
|
||||
mapboxMapOptions.textureMode(typedArray.getBoolean(R.styleable.MapView_texture_mode, false));
|
||||
mapboxMapOptions.myLocationBackgroundPadding(new int[]{(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_my_location_background_left, 0) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_my_location_background_top, 0) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_my_location_background_right, 0) * screenDensity)
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_my_location_background_bottom, 0) * screenDensity)});
|
||||
mapboxMapOptions.myLocationAccuracyAlpha(typedArray.getInt(R.styleable.mapbox_MapView_mapbox_my_location_accuracy_alpha, 100));
|
||||
mapboxMapOptions.myLocationAccuracyTint(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_my_location_accuracy_tint, ColorUtils.getPrimaryColor(context)));
|
||||
mapboxMapOptions.textureMode(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_texture_mode, false));
|
||||
} finally {
|
||||
typedArray.recycle();
|
||||
}
|
||||
@@ -329,9 +329,9 @@ public class MapboxMapOptions implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the visibility state of a compass for a map view.
|
||||
* Specifies the visibility state of a mapbox_compass_icon for a map view.
|
||||
*
|
||||
* @param enabled True and compass is shown
|
||||
* @param enabled True and mapbox_compass_icon is shown
|
||||
* @return This
|
||||
*/
|
||||
public MapboxMapOptions compassEnabled(boolean enabled) {
|
||||
@@ -340,7 +340,7 @@ public class MapboxMapOptions implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the gravity state of compass for a map view.
|
||||
* Specifies the gravity state of mapbox_compass_icon for a map view.
|
||||
*
|
||||
* @param gravity see {@link android.view.Gravity}
|
||||
* @return This
|
||||
@@ -351,7 +351,7 @@ public class MapboxMapOptions implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the margin state of compass for a map view
|
||||
* Specifies the margin state of mapbox_compass_icon for a map view
|
||||
*
|
||||
* @param margins 4 long array for LTRB margins
|
||||
* @return This
|
||||
@@ -362,12 +362,12 @@ public class MapboxMapOptions implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies if the compass fades to invisible when facing north.
|
||||
* Specifies if the mapbox_compass_icon fades to invisible when facing north.
|
||||
* <p>
|
||||
* By default this value is true.
|
||||
* </p>
|
||||
*
|
||||
* @param compassFadeWhenFacingNorth true is compass fades to invisble
|
||||
* @param compassFadeWhenFacingNorth true is mapbox_compass_icon fades to invisble
|
||||
* @return This
|
||||
*/
|
||||
public MapboxMapOptions compassFadesWhenFacingNorth(boolean compassFadeWhenFacingNorth) {
|
||||
@@ -670,45 +670,45 @@ public class MapboxMapOptions implements Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current configured visibility state for compass for a map view.
|
||||
* Get the current configured visibility state for mapbox_compass_icon for a map view.
|
||||
*
|
||||
* @return Visibility state of the compass
|
||||
* @return Visibility state of the mapbox_compass_icon
|
||||
*/
|
||||
public boolean getCompassEnabled() {
|
||||
return compassEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current configured gravity state for compass for a map view.
|
||||
* Get the current configured gravity state for mapbox_compass_icon for a map view.
|
||||
*
|
||||
* @return Gravity state of the compass
|
||||
* @return Gravity state of the mapbox_compass_icon
|
||||
*/
|
||||
public int getCompassGravity() {
|
||||
return compassGravity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current configured margins for compass for a map view.
|
||||
* Get the current configured margins for mapbox_compass_icon for a map view.
|
||||
*
|
||||
* @return Margins state of the compass
|
||||
* @return Margins state of the mapbox_compass_icon
|
||||
*/
|
||||
public int[] getCompassMargins() {
|
||||
return compassMargins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current configured state for fading the compass when facing north.
|
||||
* Get the current configured state for fading the mapbox_compass_icon when facing north.
|
||||
*
|
||||
* @return True if compass fades to invisible when facing north
|
||||
* @return True if mapbox_compass_icon fades to invisible when facing north
|
||||
*/
|
||||
public boolean getCompassFadeFacingNorth() {
|
||||
return fadeCompassFacingNorth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current configured visibility state for compass for a map view.
|
||||
* Get the current configured visibility state for mapbox_compass_icon for a map view.
|
||||
*
|
||||
* @return Visibility state of the compass
|
||||
* @return Visibility state of the mapbox_compass_icon
|
||||
*/
|
||||
public boolean getLogoEnabled() {
|
||||
return logoEnabled;
|
||||
|
||||
@@ -103,16 +103,16 @@ public class SupportMapFragment extends Fragment {
|
||||
Drawable foregroundBearingDrawable = options.getMyLocationForegroundBearingDrawable();
|
||||
if (foregroundDrawable == null || foregroundBearingDrawable == null) {
|
||||
if (foregroundDrawable == null) {
|
||||
foregroundDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_normal);
|
||||
foregroundDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_icon_default);
|
||||
}
|
||||
if (foregroundBearingDrawable == null) {
|
||||
foregroundBearingDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_bearing);
|
||||
foregroundBearingDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_icon_bearing);
|
||||
}
|
||||
options.myLocationForegroundDrawables(foregroundDrawable, foregroundBearingDrawable);
|
||||
}
|
||||
|
||||
if (options.getMyLocationBackgroundDrawable() == null) {
|
||||
options.myLocationBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_background));
|
||||
options.myLocationBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.mapbox_mylocationview_bg_shape));
|
||||
}
|
||||
|
||||
return map = new MapView(inflater.getContext(), options);
|
||||
|
||||
@@ -51,8 +51,8 @@ public final class CompassView extends ImageView implements Runnable {
|
||||
}
|
||||
|
||||
private void initialize(Context context) {
|
||||
setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.compass));
|
||||
setContentDescription(getResources().getString(R.string.compassContentDescription));
|
||||
setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.mapbox_compass_icon));
|
||||
setContentDescription(getResources().getString(R.string.mapbox_compassContentDescription));
|
||||
setEnabled(false);
|
||||
|
||||
// Layout params
|
||||
|
||||
@@ -1,57 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!--Add references to exposed resources-->
|
||||
<public name="AttributionAlertDialogStyle" type="style" />
|
||||
|
||||
<public name="style_mapbox_streets" type="string" />
|
||||
<public name="style_emerald" type="string" />
|
||||
<public name="style_light" type="string" />
|
||||
<public name="style_dark" type="string" />
|
||||
<public name="style_satellite" type="string" />
|
||||
<public name="style_satellite_streets" type="string" />
|
||||
<!-- This file contains attributes and styles that are part of the public API-->
|
||||
<!-- Users can find these with code completion while other ones from this module will remain-->
|
||||
<!-- hidden, though the user can reference them but won't show up during code completion-->
|
||||
|
||||
<public name="center_longitude" type="attr" />
|
||||
<public name="center_latitude" type="attr" />
|
||||
<public name="zoom_level" type="attr" />
|
||||
<public name="direction" type="attr" />
|
||||
<public name="zoom_enabled" type="attr" />
|
||||
<public name="scroll_enabled" type="attr" />
|
||||
<public name="rotate_enabled" type="attr" />
|
||||
<public name="zoom_controls_enabled" type="attr" />
|
||||
<public name="debug_active" type="attr" />
|
||||
<public name="style_url" type="attr" />
|
||||
<public name="access_token" type="attr" />
|
||||
<public name="style_classes" type="attr" />
|
||||
<public name="my_location_enabled" type="attr" />
|
||||
<public name="compass_enabled" type="attr" />
|
||||
<public name="compass_gravity" type="attr" />
|
||||
<public name="compass_margin_left" type="attr" />
|
||||
<public name="compass_margin_top" type="attr" />
|
||||
<public name="compass_margin_right" type="attr" />
|
||||
<public name="compass_margin_bottom" type="attr" />
|
||||
<public name="compass_fade_facing_north" type="attr" />
|
||||
<public name="logo_gravity" type="attr" />
|
||||
<public name="logo_margin_left" type="attr" />
|
||||
<public name="logo_margin_top" type="attr" />
|
||||
<public name="logo_margin_right" type="attr" />
|
||||
<public name="logo_margin_bottom" type="attr" />
|
||||
<public name="logo_visibility" type="attr" />
|
||||
<public name="attribution_gravity" type="attr" />
|
||||
<public name="attribution_margin_left" type="attr" />
|
||||
<public name="attribution_margin_top" type="attr" />
|
||||
<public name="attribution_margin_right" type="attr" />
|
||||
<public name="attribution_margin_bottom" type="attr" />
|
||||
<public name="attribution_visibility" type="attr" />
|
||||
<public name="mapbox_AlertDialogStyle" type="style" />
|
||||
|
||||
<public name="attribution_logo" type="drawable" />
|
||||
<public name="compass" type="drawable" />
|
||||
<public name="default_marker" type="drawable" />
|
||||
<public name="attribution_button_pressed_selector" type="drawable" />
|
||||
<public name="attribution_button_pressed_normal" type="drawable" />
|
||||
<public name="attribution_button_pressed_pressed" type="drawable" />
|
||||
<public name="my_location" type="drawable" />
|
||||
<public name="my_location_bearing" type="drawable" />
|
||||
<public name="my_location_stale" type="drawable" />
|
||||
<public name="my_location_ring" type="color" />
|
||||
<public name="mapbox_style_mapbox_streets" type="string" />
|
||||
<public name="mapbox_style_emerald" type="string" />
|
||||
<public name="mapbox_style_light" type="string" />
|
||||
<public name="mapbox_style_dark" type="string" />
|
||||
<public name="mapbox_style_satellite" type="string" />
|
||||
<public name="mapbox_style_satellite_streets" type="string" />
|
||||
|
||||
<public name="mapbox_center_longitude" type="attr" />
|
||||
<public name="mapbox_center_latitude" type="attr" />
|
||||
<public name="mapbox_zoom_level" type="attr" />
|
||||
<public name="mapbox_direction" type="attr" />
|
||||
<public name="mapbox_zoom_enabled" type="attr" />
|
||||
<public name="mapbox_scroll_enabled" type="attr" />
|
||||
<public name="mapbox_rotate_enabled" type="attr" />
|
||||
<public name="mapbox_zoom_controls_enabled" type="attr" />
|
||||
<public name="mapbox_debug_active" type="attr" />
|
||||
<public name="mapbox_style_url" type="attr" />
|
||||
<public name="mapbox_access_token" type="attr" />
|
||||
<public name="mapbox_style_classes" type="attr" />
|
||||
<public name="mapbox_my_location_enabled" type="attr" />
|
||||
<public name="mapbox_compass_enabled" type="attr" />
|
||||
<public name="mapbox_compass_gravity" type="attr" />
|
||||
<public name="mapbox_compass_margin_left" type="attr" />
|
||||
<public name="mapbox_compass_margin_top" type="attr" />
|
||||
<public name="mapbox_compass_margin_right" type="attr" />
|
||||
<public name="mapbox_compass_margin_bottom" type="attr" />
|
||||
<public name="mapbox_compass_fade_facing_north" type="attr" />
|
||||
<public name="mapbox_logo_gravity" type="attr" />
|
||||
<public name="mapbox_logo_margin_left" type="attr" />
|
||||
<public name="mapbox_logo_margin_top" type="attr" />
|
||||
<public name="mapbox_logo_margin_right" type="attr" />
|
||||
<public name="mapbox_logo_margin_bottom" type="attr" />
|
||||
<public name="mapbox_logo_visibility" type="attr" />
|
||||
<public name="mapbox_attribution_gravity" type="attr" />
|
||||
<public name="mapbox_attribution_margin_left" type="attr" />
|
||||
<public name="mapbox_attribution_margin_top" type="attr" />
|
||||
<public name="mapbox_attribution_margin_right" type="attr" />
|
||||
<public name="mapbox_attribution_margin_bottom" type="attr" />
|
||||
<public name="mapbox_attribution_visibility" type="attr" />
|
||||
|
||||
<public name="mapbox_attribution_logo" type="drawable" />
|
||||
<public name="mapbox_compass" type="drawable" />
|
||||
<public name="mapbox_default_marker" type="drawable" />
|
||||
<public name="mapbox_attribution_button_pressed_selector" type="drawable" />
|
||||
<public name="mapbox_attribution_button_pressed_normal" type="drawable" />
|
||||
<public name="mapbox_attribution_button_pressed_pressed" type="drawable" />
|
||||
<public name="mapbox_my_location" type="drawable" />
|
||||
<public name="mapbox_my_location_bearing" type="drawable" />
|
||||
<public name="mapbox_my_location_stale" type="drawable" />
|
||||
<public name="mapbox_my_location_ring" type="color" />
|
||||
<public name="mapbox_blue" type="color" />
|
||||
</resources>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1010 B After Width: | Height: | Size: 1010 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 649 B After Width: | Height: | Size: 649 B |
|
Before Width: | Height: | Size: 555 B After Width: | Height: | Size: 555 B |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 928 B After Width: | Height: | Size: 928 B |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_info_outline_24dp_selected" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/ic_info_outline_24dp" />
|
||||
</selector>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
<size
|
||||
android:width="@dimen/my_locationview_outer_circle"
|
||||
android:height="@dimen/my_locationview_outer_circle" />
|
||||
</shape>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/gray_light" android:state_pressed="true" />
|
||||
<item android:drawable="@color/gray_light" android:state_focused="true" />
|
||||
<item android:drawable="@color/mapbox_gray_light" android:state_pressed="true" />
|
||||
<item android:drawable="@color/mapbox_gray_light" android:state_focused="true" />
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/mapbox_info_icon_selected" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/mapbox_info_icon_default" />
|
||||
</selector>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<size
|
||||
android:width="@dimen/mapbox_my_locationview_outer_circle"
|
||||
android:height="@dimen/mapbox_my_locationview_outer_circle" />
|
||||
</shape>
|
||||
@@ -5,7 +5,7 @@
|
||||
android:id="@+id/infowindow_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_infowindow_content"
|
||||
android:background="@drawable/mapbox_infowindow_icon_bg"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="20dp"
|
||||
@@ -18,8 +18,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:maxEms="17"
|
||||
android:text="@string/infoWindowTitle"
|
||||
android:textColor="@color/black"
|
||||
android:text="@string/mapbox_infoWindowTitle"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
android:layout_marginTop="2dp"
|
||||
android:lineSpacingExtra="1dp"
|
||||
android:maxEms="17"
|
||||
android:text="@string/infoWindowDescription"
|
||||
android:textColor="@color/gray"
|
||||
android:text="@string/mapbox_infoWindowDescription"
|
||||
android:textColor="@color/mapbox_gray"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
@@ -40,15 +40,15 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxEms="17"
|
||||
android:text="@string/infoWindowAddress"
|
||||
android:textColor="@color/black"
|
||||
android:text="@string/mapbox_infoWindowAddress"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.mapbox.mapboxsdk.annotations.InfoWindowTipView
|
||||
android:id="@+id/infowindow_tipview"
|
||||
android:layout_width="@dimen/infowindow_tipview_width"
|
||||
android:layout_width="@dimen/mapbox_infowindow_tipview_width"
|
||||
android:layout_height="14dp"
|
||||
android:layout_below="@+id/infowindow_content" />
|
||||
|
||||
@@ -27,18 +27,18 @@
|
||||
android:id="@+id/logoView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/mapboxIconContentDescription"
|
||||
android:src="@drawable/attribution_logo" />
|
||||
android:contentDescription="@string/mapbox_iconContentDescription"
|
||||
android:src="@drawable/mapbox_logo_icon" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/attributionView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/bg_default_selector"
|
||||
android:background="@drawable/mapbox_default_bg_selector"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/attributionsIconContentDescription"
|
||||
android:contentDescription="@string/mapbox_attributionsIconContentDescription"
|
||||
android:padding="7dp"
|
||||
android:src="@drawable/ic_info_outline_24dp_selector" />
|
||||
android:src="@drawable/mapbox_info_bg_selector" />
|
||||
|
||||
</merge>
|
||||
@@ -8,34 +8,34 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/mapview_preview" />
|
||||
android:src="@drawable/mapbox_mapview_preview" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginBottom="@dimen/eight_dp"
|
||||
android:layout_marginLeft="@dimen/eight_dp"
|
||||
android:contentDescription="@string/mapboxIconContentDescription"
|
||||
android:src="@drawable/attribution_logo" />
|
||||
android:layout_marginBottom="@dimen/mapbox_eight_dp"
|
||||
android:layout_marginLeft="@dimen/mapbox_eight_dp"
|
||||
android:contentDescription="@string/mapbox_iconContentDescription"
|
||||
android:src="@drawable/mapbox_logo_icon" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="@dimen/seven_dp"
|
||||
android:layout_marginLeft="@dimen/seventy_six_dp"
|
||||
android:background="@drawable/bg_default_selector"
|
||||
android:layout_marginBottom="@dimen/mapbox_seven_dp"
|
||||
android:layout_marginLeft="@dimen/mapbox_seventy_six_dp"
|
||||
android:background="@drawable/mapbox_default_bg_selector"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/attributionsIconContentDescription"
|
||||
android:src="@drawable/ic_info_outline_24dp_selector" />
|
||||
android:contentDescription="@string/mapbox_attributionsIconContentDescription"
|
||||
android:src="@drawable/mapbox_info_bg_selector" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="10dp"
|
||||
android:src="@drawable/compass" />
|
||||
android:src="@drawable/mapbox_compass_icon" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<array name="attribution_names">
|
||||
<array name="mapbox_attribution_names">
|
||||
<item>© Mapbox</item>
|
||||
<item>© OpenStreetMap</item>
|
||||
<item>Improve this map</item>
|
||||
<item>Telemetry Settings</item>
|
||||
</array>
|
||||
<!-- If editing this array update MapView.ATTRIBUTION_INDEX_IMPROVE_THIS_MAP -->
|
||||
<array name="attribution_links" formatted="false" translatable="false">
|
||||
<array name="mapbox_attribution_links" formatted="false" translatable="false">
|
||||
<item>https://www.mapbox.com/about/maps/</item>
|
||||
<item>http://www.openstreetmap.org/about/</item>
|
||||
<item>https://www.mapbox.com/map-feedback/#/%1$f/%2$f/%3$d</item>
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
<resources>
|
||||
<!-- these are public -->
|
||||
<declare-styleable name="MapView">
|
||||
<declare-styleable name="mapbox_MapView">
|
||||
|
||||
<!--Configuration-->
|
||||
<attr name="access_token" format="string" />
|
||||
<attr name="style_url" format="string" />
|
||||
<attr name="api_base_url" format="string" />
|
||||
<attr name="mapbox_access_token" format="string" />
|
||||
<attr name="mapbox_style_url" format="string" />
|
||||
<attr name="mapbox_api_base_url" format="string" />
|
||||
|
||||
<!--Camera-->
|
||||
<attr name="center_longitude" format="float" />
|
||||
<attr name="center_latitude" format="float" />
|
||||
<attr name="zoom" format="float" />
|
||||
<attr name="direction" format="float" />
|
||||
<attr name="tilt" format="float" />
|
||||
<attr name="mapbox_center_longitude" format="float" />
|
||||
<attr name="mapbox_center_latitude" format="float" />
|
||||
<attr name="mapbox_zoom" format="float" />
|
||||
<attr name="mapbox_direction" format="float" />
|
||||
<attr name="mapbox_tilt" format="float" />
|
||||
|
||||
<!--Zoom-->
|
||||
<attr name="zoom_max" format="float" />
|
||||
<attr name="zoom_min" format="float" />
|
||||
<attr name="mapbox_zoom_max" format="float" />
|
||||
<attr name="mapbox_zoom_min" format="float" />
|
||||
|
||||
<!--Gestures-->
|
||||
<attr name="zoom_enabled" format="boolean" />
|
||||
<attr name="scroll_enabled" format="boolean" />
|
||||
<attr name="rotate_enabled" format="boolean" />
|
||||
<attr name="tilt_enabled" format="boolean" />
|
||||
<attr name="debug_active" format="boolean" />
|
||||
<attr name="mapbox_zoom_enabled" format="boolean" />
|
||||
<attr name="mapbox_scroll_enabled" format="boolean" />
|
||||
<attr name="mapbox_rotate_enabled" format="boolean" />
|
||||
<attr name="mapbox_tilt_enabled" format="boolean" />
|
||||
<attr name="mapbox_debug_active" format="boolean" />
|
||||
|
||||
<!--UI-Controls-->
|
||||
<attr name="zoom_controls_enabled" format="boolean" />
|
||||
<attr name="mapbox_zoom_controls_enabled" format="boolean" />
|
||||
|
||||
<!--MyLocation-->
|
||||
<attr name="my_location_enabled" format="boolean" />
|
||||
<attr name="my_location_foreground" format="reference" />
|
||||
<attr name="my_location_foreground_bearing" format="reference" />
|
||||
<attr name="my_location_foreground_tint" format="color" />
|
||||
<attr name="my_location_background" format="reference" />
|
||||
<attr name="my_location_background_tint" format="color" />
|
||||
<attr name="my_location_background_left" format="dimension" />
|
||||
<attr name="my_location_background_top" format="dimension" />
|
||||
<attr name="my_location_background_right" format="dimension" />
|
||||
<attr name="my_location_background_bottom" format="dimension" />
|
||||
<attr name="my_location_accuracy_tint" format="color" />
|
||||
<attr name="my_location_accuracy_alpha" format="integer" />
|
||||
<attr name="mapbox_my_location_enabled" format="boolean" />
|
||||
<attr name="mapbox_my_location_foreground" format="reference" />
|
||||
<attr name="mapbox_my_location_foreground_bearing" format="reference" />
|
||||
<attr name="mapbox_my_location_foreground_tint" format="color" />
|
||||
<attr name="mapbox_my_location_background" format="reference" />
|
||||
<attr name="mapbox_my_location_background_tint" format="color" />
|
||||
<attr name="mapbox_my_location_background_left" format="dimension" />
|
||||
<attr name="mapbox_my_location_background_top" format="dimension" />
|
||||
<attr name="mapbox_my_location_background_right" format="dimension" />
|
||||
<attr name="mapbox_my_location_background_bottom" format="dimension" />
|
||||
<attr name="mapbox_my_location_accuracy_tint" format="color" />
|
||||
<attr name="mapbox_my_location_accuracy_alpha" format="integer" />
|
||||
|
||||
<!--Compass-->
|
||||
<attr name="compass_enabled" format="boolean" />
|
||||
<attr name="compass_gravity">
|
||||
<attr name="mapbox_compass_enabled" format="boolean" />
|
||||
<attr name="mapbox_compass_gravity">
|
||||
<flag name="top" value="0x30" />
|
||||
<flag name="bottom" value="0x50" />
|
||||
<flag name="left" value="0x03" />
|
||||
@@ -60,14 +60,14 @@
|
||||
<flag name="start" value="0x00800003" />
|
||||
<flag name="end" value="0x00800005" />
|
||||
</attr>
|
||||
<attr name="compass_margin_left" format="dimension" />
|
||||
<attr name="compass_margin_top" format="dimension" />
|
||||
<attr name="compass_margin_right" format="dimension" />
|
||||
<attr name="compass_margin_bottom" format="dimension" />
|
||||
<attr name="compass_fade_facing_north" format="boolean" />
|
||||
<attr name="mapbox_compass_margin_left" format="dimension" />
|
||||
<attr name="mapbox_compass_margin_top" format="dimension" />
|
||||
<attr name="mapbox_compass_margin_right" format="dimension" />
|
||||
<attr name="mapbox_compass_margin_bottom" format="dimension" />
|
||||
<attr name="mapbox_compass_fade_facing_north" format="boolean" />
|
||||
|
||||
<!--Logo-->
|
||||
<attr name="logo_gravity">
|
||||
<attr name="mapbox_logo_gravity">
|
||||
<flag name="top" value="0x30" />
|
||||
<flag name="bottom" value="0x50" />
|
||||
<flag name="left" value="0x03" />
|
||||
@@ -83,14 +83,14 @@
|
||||
<flag name="start" value="0x00800003" />
|
||||
<flag name="end" value="0x00800005" />
|
||||
</attr>
|
||||
<attr name="logo_margin_left" format="dimension" />
|
||||
<attr name="logo_margin_top" format="dimension" />
|
||||
<attr name="logo_margin_right" format="dimension" />
|
||||
<attr name="logo_margin_bottom" format="dimension" />
|
||||
<attr name="logo_enabled" format="boolean" />
|
||||
<attr name="mapbox_logo_margin_left" format="dimension" />
|
||||
<attr name="mapbox_logo_margin_top" format="dimension" />
|
||||
<attr name="mapbox_logo_margin_right" format="dimension" />
|
||||
<attr name="mapbox_logo_margin_bottom" format="dimension" />
|
||||
<attr name="mapbox_logo_enabled" format="boolean" />
|
||||
|
||||
<!--Attribution-->
|
||||
<attr name="attribution_gravity">
|
||||
<attr name="mapbox_attribution_gravity">
|
||||
<flag name="top" value="0x30" />
|
||||
<flag name="bottom" value="0x50" />
|
||||
<flag name="left" value="0x03" />
|
||||
@@ -106,14 +106,14 @@
|
||||
<flag name="start" value="0x00800003" />
|
||||
<flag name="end" value="0x00800005" />
|
||||
</attr>
|
||||
<attr name="attribution_margin_left" format="dimension" />
|
||||
<attr name="attribution_margin_top" format="dimension" />
|
||||
<attr name="attribution_margin_right" format="dimension" />
|
||||
<attr name="attribution_margin_bottom" format="dimension" />
|
||||
<attr name="attribution_enabled" format="boolean" />
|
||||
<attr name="attribution_tint" format="color" />
|
||||
<attr name="mapbox_attribution_margin_left" format="dimension" />
|
||||
<attr name="mapbox_attribution_margin_top" format="dimension" />
|
||||
<attr name="mapbox_attribution_margin_right" format="dimension" />
|
||||
<attr name="mapbox_attribution_margin_bottom" format="dimension" />
|
||||
<attr name="mapbox_attribution_enabled" format="boolean" />
|
||||
<attr name="mapbox_attribution_tint" format="color" />
|
||||
|
||||
<!-- Deprecated to use TextureView-->
|
||||
<attr name="texture_mode" format="boolean" />
|
||||
<attr name="mapbox_texture_mode" format="boolean" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="white">#F9F9F9</color>
|
||||
<color name="black">#000000</color>
|
||||
<color name="gray">#7D7F80</color>
|
||||
<color name="gray_light">#EEEEEE</color>
|
||||
<color name="mapbox_gray">#7D7F80</color>
|
||||
<color name="mapbox_gray_light">#EEEEEE</color>
|
||||
<color name="mapbox_blue">#1E8CAB</color>
|
||||
<color name="my_location_ring">@color/mapbox_blue</color>
|
||||
<color name="mapbox_my_location_ring">@color/mapbox_blue</color>
|
||||
</resources>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="infowindow_tipview_width">20dp</dimen>
|
||||
<dimen name="infowindow_margin">8dp</dimen>
|
||||
<dimen name="infowindow_offset">-2dp</dimen>
|
||||
<dimen name="infowindow_line_width">1.5dp</dimen>
|
||||
<dimen name="seven_dp">7dp</dimen>
|
||||
<dimen name="eight_dp">8dp</dimen>
|
||||
<dimen name="ten_dp">10dp</dimen>
|
||||
<dimen name="sixteen_dp">16dp</dimen>
|
||||
<dimen name="seventy_six_dp">76dp</dimen>
|
||||
<dimen name="my_locationview_outer_circle">18dp</dimen>
|
||||
<dimen name="mapbox_infowindow_tipview_width">20dp</dimen>
|
||||
<dimen name="mapbox_infowindow_margin">8dp</dimen>
|
||||
<dimen name="mapbox_infowindow_offset">-2dp</dimen>
|
||||
<dimen name="mapbox_infowindow_line_width">1.5dp</dimen>
|
||||
<dimen name="mapbox_seven_dp">7dp</dimen>
|
||||
<dimen name="mapbox_eight_dp">8dp</dimen>
|
||||
<dimen name="mapbox_ten_dp">10dp</dimen>
|
||||
<dimen name="mapbox_sixteen_dp">16dp</dimen>
|
||||
<dimen name="mapbox_seventy_six_dp">76dp</dimen>
|
||||
<dimen name="mapbox_my_locationview_outer_circle">18dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="style_version">9</integer>
|
||||
</resources>
|
||||
@@ -1,27 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="compassContentDescription">Map compass. Click to reset the map rotation to North.</string>
|
||||
<string name="attributionsIconContentDescription">Attribution icon. Click to show attribution dialog.</string>
|
||||
<string name="attributionsDialogTitle">Mapbox Android SDK</string>
|
||||
<string name="attributionTelemetryTitle">Make Mapbox Maps Better</string>
|
||||
<string name="attributionTelemetryMessage">You are helping to make OpenStreetMap and Mapbox maps better by contributing anonymous usage data.</string>
|
||||
<string name="attributionTelemetryPositive">Agree</string>
|
||||
<string name="attributionTelemetryNegative">Disagree</string>
|
||||
<string name="attributionTelemetryNeutral">More info</string>
|
||||
<string name="mapboxIconContentDescription">The Mapbox logo.</string>
|
||||
<string name="infoWindowTitle">Title</string>
|
||||
<string name="infoWindowDescription">Description</string>
|
||||
<string name="infoWindowAddress">Address</string>
|
||||
<string name="mapbox_compassContentDescription">Map compass. Click to reset the map rotation to North.</string>
|
||||
<string name="mapbox_attributionsIconContentDescription">Attribution icon. Click to show attribution dialog.</string>
|
||||
<string name="mapbox_attributionsDialogTitle">Mapbox Android SDK</string>
|
||||
<string name="mapbox_attributionTelemetryTitle">Make Mapbox Maps Better</string>
|
||||
<string name="mapbox_attributionTelemetryMessage">You are helping to make OpenStreetMap and Mapbox maps better by contributing anonymous usage data.</string>
|
||||
<string name="mapbox_attributionTelemetryPositive">Agree</string>
|
||||
<string name="mapbox_attributionTelemetryNegative">Disagree</string>
|
||||
<string name="mapbox_attributionTelemetryNeutral">More info</string>
|
||||
<string name="mapbox_iconContentDescription">The Mapbox logo.</string>
|
||||
<string name="mapbox_infoWindowTitle">Title</string>
|
||||
<string name="mapbox_infoWindowDescription">Description</string>
|
||||
<string name="mapbox_infoWindowAddress">Address</string>
|
||||
|
||||
<!-- these are public -->
|
||||
<!-- Using one of these constants means your map style will always use the latest version and
|
||||
may change as we improve the style. -->
|
||||
<string name="style_mapbox_streets">mapbox://styles/mapbox/streets-v9</string>
|
||||
<string name="style_outdoors">mapbox://styles/mapbox/outdoors-v9</string>
|
||||
<string name="mapbox_style_mapbox_streets">mapbox://styles/mapbox/streets-v9</string>
|
||||
<string name="mapbox_style_outdoors">mapbox://styles/mapbox/outdoors-v9</string>
|
||||
<!-- Note: Emerald style has been deprecated and will be removed in a future release-->
|
||||
<string name="style_emerald">mapbox://styles/mapbox/emerald-v8</string>
|
||||
<string name="style_light">mapbox://styles/mapbox/light-v9</string>
|
||||
<string name="style_dark">mapbox://styles/mapbox/dark-v9</string>
|
||||
<string name="style_satellite">mapbox://styles/mapbox/satellite-v9</string>
|
||||
<string name="style_satellite_streets">mapbox://styles/mapbox/satellite-streets-v9</string>
|
||||
<string name="mapbox_style_emerald">mapbox://styles/mapbox/emerald-v8</string>
|
||||
<string name="mapbox_style_light">mapbox://styles/mapbox/light-v9</string>
|
||||
<string name="mapbox_style_dark">mapbox://styles/mapbox/dark-v9</string>
|
||||
<string name="mapbox_style_satellite">mapbox://styles/mapbox/satellite-v9</string>
|
||||
<string name="mapbox_style_satellite_streets">mapbox://styles/mapbox/satellite-streets-v9</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- these are public -->
|
||||
<style name="AttributionAlertDialogStyle" parent="Theme.AppCompat.Dialog.Alert">
|
||||
<item name="android:textColorPrimary">@android:color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="TelemAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert"/>
|
||||
<style name="mapbox_AlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert"/>
|
||||
|
||||
</resources>
|
||||
@@ -63,7 +63,7 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe
|
||||
Context context = v.getContext();
|
||||
final View dialogContent = LayoutInflater.from(context).inflate(R.layout.dialog_camera_position, null);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(
|
||||
context, com.mapbox.mapboxsdk.R.style.AttributionAlertDialogStyle);
|
||||
context, com.mapbox.mapboxsdk.R.style.mapbox_AlertDialogStyle);
|
||||
builder.setTitle(R.string.dialog_camera_position);
|
||||
builder.setView(onInflateDialogContent(dialogContent));
|
||||
builder.setPositiveButton("Animate", new DialogInterface.OnClickListener() {
|
||||
|
||||
@@ -78,7 +78,7 @@ public class MyLocationTintActivity extends AppCompatActivity implements Locatio
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
myLocationViewSettings.setAccuracyTintColor(ContextCompat.getColor(
|
||||
MyLocationTintActivity.this, R.color.my_location_ring));
|
||||
MyLocationTintActivity.this, R.color.mapbox_my_location_ring));
|
||||
myLocationViewSettings.setForegroundTintColor(ContextCompat.getColor(
|
||||
MyLocationTintActivity.this, R.color.mapbox_blue));
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
app:center_latitude="52.519003"
|
||||
app:center_longitude="13.400972"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="16"
|
||||
app:mapbox_center_latitude="52.519003"
|
||||
app:mapbox_center_longitude="13.400972"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="16"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:center_latitude="51.502615"
|
||||
app:center_longitude="4.972326"
|
||||
app:style_url="@string/style_light"
|
||||
app:zoom="6" />
|
||||
app:mapbox_center_latitude="51.502615"
|
||||
app:mapbox_center_longitude="4.972326"
|
||||
app:mapbox_style_url="@string/mapbox_style_light"
|
||||
app:mapbox_zoom="6" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/toolbar"
|
||||
app:center_latitude="51.50325"
|
||||
app:center_longitude="-0.11968"
|
||||
app:zoom="15" />
|
||||
app:mapbox_center_latitude="51.50325"
|
||||
app:mapbox_center_longitude="-0.11968"
|
||||
app:mapbox_zoom="15" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:style_url="@string/style_mapbox_streets" />
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:my_location_foreground_tint="@color/primary"
|
||||
app:my_location_accuracy_tint="@color/primary"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="15" />
|
||||
app:mapbox_my_location_foreground_tint="@color/primary"
|
||||
app:mapbox_my_location_accuracy_tint="@color/primary"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="15" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
app:center_latitude="52.519003"
|
||||
app:center_longitude="13.400972"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="16"
|
||||
app:mapbox_center_latitude="52.519003"
|
||||
app:mapbox_center_longitude="13.400972"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="16"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:style_url="@string/style_mapbox_streets" />
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:center_latitude="51.506675"
|
||||
app:center_longitude="-0.128699"
|
||||
app:compass_fade_facing_north="false"
|
||||
app:direction="90"
|
||||
app:tilt="40"
|
||||
app:zoom="10" />
|
||||
app:mapbox_center_latitude="51.506675"
|
||||
app:mapbox_center_longitude="-0.128699"
|
||||
app:mapbox_compass_fade_facing_north="false"
|
||||
app:mapbox_direction="90"
|
||||
app:mapbox_tilt="40"
|
||||
app:mapbox_zoom="10" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="5"
|
||||
app:center_latitude="38.90962"
|
||||
app:center_longitude="-77.04341"
|
||||
app:zoom="15" />
|
||||
app:mapbox_center_latitude="38.90962"
|
||||
app:mapbox_center_longitude="-77.04341"
|
||||
app:mapbox_zoom="15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:center_latitude="38.897705003219784"
|
||||
app:center_longitude="-77.03655168667463"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="15" />
|
||||
app:mapbox_center_latitude="38.897705003219784"
|
||||
app:mapbox_center_longitude="-77.03655168667463"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="15" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:center_latitude="47.798202"
|
||||
app:center_longitude="7.573781"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="4" />
|
||||
app:mapbox_center_latitude="47.798202"
|
||||
app:mapbox_center_longitude="7.573781"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="4" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:center_latitude="47.798202"
|
||||
app:center_longitude="7.573781"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="4" />
|
||||
app:mapbox_center_latitude="47.798202"
|
||||
app:mapbox_center_longitude="7.573781"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="4" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
<com.mapbox.mapboxsdk.maps.MapView
|
||||
android:id="@id/mapView"
|
||||
app:center_latitude="50.871062"
|
||||
app:center_longitude="1.583210"
|
||||
app:direction="220"
|
||||
app:zoom="10"
|
||||
app:mapbox_center_latitude="50.871062"
|
||||
app:mapbox_center_longitude="1.583210"
|
||||
app:mapbox_direction="220"
|
||||
app:mapbox_zoom="10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar" />
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:center_latitude="38.87031"
|
||||
app:mapbox_center_latitude="38.87031"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:center_longitude="-77.00897"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="10" />
|
||||
app:mapbox_center_longitude="-77.00897"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="10" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/countView"
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:center_latitude="38.907192"
|
||||
app:center_longitude="-77.036871"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="12" />
|
||||
app:mapbox_center_latitude="38.907192"
|
||||
app:mapbox_center_longitude="-77.036871"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/countView"
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:center_latitude="38.907192"
|
||||
app:center_longitude="-77.036871"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="12" />
|
||||
app:mapbox_center_latitude="38.907192"
|
||||
app:mapbox_center_longitude="-77.036871"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="12" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:center_latitude="-1.063510"
|
||||
app:center_longitude=" 32.895425"
|
||||
app:style_url="@string/style_satellite_streets"
|
||||
app:zoom="4" />
|
||||
app:mapbox_center_latitude="-1.063510"
|
||||
app:mapbox_center_longitude=" 32.895425"
|
||||
app:mapbox_style_url="@string/mapbox_style_satellite_streets"
|
||||
app:mapbox_zoom="4" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:my_location_foreground_tint="@color/primary"
|
||||
app:my_location_accuracy_tint="@color/primary"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="15" />
|
||||
app:mapbox_my_location_foreground_tint="@color/primary"
|
||||
app:mapbox_my_location_accuracy_tint="@color/primary"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="15" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/toolbar"
|
||||
app:attribution_tint="@android:color/holo_green_dark"
|
||||
app:center_latitude="47.798202"
|
||||
app:center_longitude="7.573781"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="4" />
|
||||
app:mapbox_attribution_tint="@android:color/holo_green_dark"
|
||||
app:mapbox_center_latitude="47.798202"
|
||||
app:mapbox_center_longitude="7.573781"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="4" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:attribution_gravity="top|end"
|
||||
app:center_latitude="45.1855569"
|
||||
app:center_longitude="5.7215506"
|
||||
app:logo_gravity="top|end"
|
||||
app:logo_margin_right="10dp"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="11" />
|
||||
app:mapbox_attribution_gravity="top|end"
|
||||
app:mapbox_center_latitude="45.1855569"
|
||||
app:mapbox_center_longitude="5.7215506"
|
||||
app:mapbox_logo_gravity="top|end"
|
||||
app:mapbox_logo_margin_right="10dp"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="11" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -80,10 +80,10 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:center_latitude="37.176546"
|
||||
app:center_longitude="-3.599007"
|
||||
app:style_url="@string/style_emerald"
|
||||
app:zoom="15" />
|
||||
app:mapbox_center_latitude="37.176546"
|
||||
app:mapbox_center_longitude="-3.599007"
|
||||
app:mapbox_style_url="@string/mapbox_style_emerald"
|
||||
app:mapbox_zoom="15" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
android:id="@id/mapView"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
app:center_latitude="52.519003"
|
||||
app:center_longitude="13.400972"
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="16"
|
||||
app:mapbox_center_latitude="52.519003"
|
||||
app:mapbox_center_longitude="13.400972"
|
||||
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
|
||||
app:mapbox_zoom="16"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:style_url="@string/style_light" />
|
||||
app:mapbox_style_url="@string/mapbox_style_light" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
mapbox:attribution_gravity="top"
|
||||
mapbox:center_latitude="34.4021"
|
||||
mapbox:center_longitude="-119.7081"
|
||||
mapbox:logo_gravity="top"
|
||||
mapbox:style_url="mapbox://styles/mapbox/streets-v9"
|
||||
mapbox:zoom="13" />
|
||||
mapbox:mapbox_attribution_gravity="top"
|
||||
mapbox:mapbox_center_latitude="34.4021"
|
||||
mapbox:mapbox_center_longitude="-119.7081"
|
||||
mapbox:mapbox_logo_gravity="top"
|
||||
mapbox:mapbox_style_url="mapbox://styles/mapbox/streets-v9"
|
||||
mapbox:mapbox_zoom="13" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -10,9 +10,9 @@
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
mapbox:center_latitude="47.6077"
|
||||
mapbox:center_longitude="-122.3421"
|
||||
mapbox:style_url="mapbox://styles/mapbox/streets-v9"
|
||||
mapbox:zoom="11"/>
|
||||
mapbox:mapbox_center_latitude="47.6077"
|
||||
mapbox:mapbox_center_longitude="-122.3421"
|
||||
mapbox:mapbox_style_url="mapbox://styles/mapbox/streets-v9"
|
||||
mapbox:mapbox_zoom="11"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -46,11 +46,11 @@ public class CameraPositionTest {
|
||||
float tilt = 44;
|
||||
|
||||
TypedArray typedArray = mock(TypedArray.class);
|
||||
when(typedArray.getFloat(R.styleable.MapView_direction, 0.0f)).thenReturn(bearing);
|
||||
when(typedArray.getFloat(R.styleable.MapView_center_latitude, 0.0f)).thenReturn(latitude);
|
||||
when(typedArray.getFloat(R.styleable.MapView_center_longitude, 0.0f)).thenReturn(longitude);
|
||||
when(typedArray.getFloat(R.styleable.MapView_zoom, 0.0f)).thenReturn(zoom);
|
||||
when(typedArray.getFloat(R.styleable.MapView_tilt, 0.0f)).thenReturn(tilt);
|
||||
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_direction, 0.0f)).thenReturn(bearing);
|
||||
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_center_latitude, 0.0f)).thenReturn(latitude);
|
||||
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_center_longitude, 0.0f)).thenReturn(longitude);
|
||||
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_zoom, 0.0f)).thenReturn(zoom);
|
||||
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_tilt, 0.0f)).thenReturn(tilt);
|
||||
doNothing().when(typedArray).recycle();
|
||||
|
||||
CameraPosition cameraPosition = new CameraPosition.Builder(typedArray).build();
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
mapbox:center_latitude="40.73581"
|
||||
mapbox:center_longitude="-73.99155"
|
||||
mapbox:style_url="mapbox://styles/mapbox/streets-v9"
|
||||
mapbox:zoom="11"
|
||||
mapbox:zoom_controls_enabled="false"/>
|
||||
mapbox:mapbox_center_latitude="40.73581"
|
||||
mapbox:mapbox_center_longitude="-73.99155"
|
||||
mapbox:mapbox_style_url="mapbox://styles/mapbox/streets-v9"
|
||||
mapbox:mapbox_zoom="11"
|
||||
mapbox:mapbox_zoom_controls_enabled="false"/>
|
||||
|
||||
</FrameLayout>
|
||||