diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-11-07 09:37:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-07 09:37:43 +0100 |
commit | ee073f6b96f5e70a283def9cd2acebbae29b97d1 (patch) | |
tree | 84f5cf473266f2565109821689e14ed36595b237 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java | |
parent | c5992d71f5b011e6b664532fdc2abbb8d3c51a0b (diff) | |
download | qtlocation-mapboxgl-ee073f6b96f5e70a283def9cd2acebbae29b97d1.tar.gz |
[android] - rename attributes (#6894)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java | 102 |
1 files changed, 50 insertions, 52 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java index 51af4c029e..c919952b4e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java @@ -172,74 +172,72 @@ public class MapboxMapOptions implements Parcelable { float screenDensity = context.getResources().getDisplayMetrics().density; TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.mapbox_MapView, 0, 0); try { - 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.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.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.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.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.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.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.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.mapbox_MapView_mapbox_my_location_foreground); + mapboxMapOptions.accessToken(typedArray.getString(R.styleable.mapbox_MapView_mapbox_accessToken)); + mapboxMapOptions.styleUrl(typedArray.getString(R.styleable.mapbox_MapView_mapbox_styleUrl)); + mapboxMapOptions.apiBaseUrl(typedArray.getString(R.styleable.mapbox_MapView_mapbox_apiBaseUrl)); + + mapboxMapOptions.zoomGesturesEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiZoomGestures, true)); + mapboxMapOptions.scrollGesturesEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiScrollGestures, true)); + mapboxMapOptions.rotateGesturesEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiRotateGestures, true)); + mapboxMapOptions.tiltGesturesEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiTiltGestures, true)); + mapboxMapOptions.zoomControlsEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiZoomControls, false)); + + mapboxMapOptions.maxZoom(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_cameraZoomMax, MapboxConstants.MAXIMUM_ZOOM)); + mapboxMapOptions.minZoom(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_cameraZoomMin, MapboxConstants.MINIMUM_ZOOM)); + + mapboxMapOptions.compassEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiCompass, true)); + mapboxMapOptions.compassGravity(typedArray.getInt(R.styleable.mapbox_MapView_mapbox_uiCompassGravity, Gravity.TOP | Gravity.END)); + mapboxMapOptions.compassMargins(new int[]{(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiCompassMarginLeft, DIMENSION_TEN_DP) * screenDensity) + , ((int) typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiCompassMarginTop, DIMENSION_TEN_DP * screenDensity)) + , ((int) typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiCompassMarginRight, DIMENSION_TEN_DP * screenDensity)) + , ((int) typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiCompassMarginBottom, DIMENSION_TEN_DP * screenDensity))}); + mapboxMapOptions.compassFadesWhenFacingNorth(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiCompassFadeFacingNorth, true)); + + mapboxMapOptions.logoEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiLogo, true)); + mapboxMapOptions.logoGravity(typedArray.getInt(R.styleable.mapbox_MapView_mapbox_uiLogoGravity, Gravity.BOTTOM | Gravity.START)); + mapboxMapOptions.logoMargins(new int[]{(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiLogoMarginLeft, DIMENSION_SIXTEEN_DP) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiLogoMarginTop, DIMENSION_SIXTEEN_DP) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiLogoMarginRight, DIMENSION_SIXTEEN_DP) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiLogoMarginBottom, DIMENSION_SIXTEEN_DP) * screenDensity)}); + + mapboxMapOptions.attributionTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_uiAttributionTintColor, -1)); + mapboxMapOptions.attributionEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_uiAttribution, true)); + mapboxMapOptions.attributionGravity(typedArray.getInt(R.styleable.mapbox_MapView_mapbox_uiAttributionGravity, Gravity.BOTTOM)); + mapboxMapOptions.attributionMargins(new int[]{(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiAttributionMarginLeft, DIMENSION_SEVENTY_SIX_DP) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiAttributionMarginTop, DIMENSION_SEVEN_DP) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiAttributionMarginRight, DIMENSION_SEVEN_DP) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiAttributionMarginBottom, DIMENSION_SEVEN_DP) * screenDensity)}); + + mapboxMapOptions.locationEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_myLocation, false)); + mapboxMapOptions.myLocationForegroundTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_myLocationTintColor, Color.TRANSPARENT)); + mapboxMapOptions.myLocationBackgroundTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_myLocationBackgroundTintColor, Color.TRANSPARENT)); + + Drawable foregroundDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_myLocationDrawable); if (foregroundDrawable == null) { foregroundDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocation_icon_default); } - Drawable foregroundBearingDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_my_location_foreground_bearing); + Drawable foregroundBearingDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_myLocationBearingDrawable); if (foregroundBearingDrawable == null) { foregroundBearingDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocation_icon_bearing); } - Drawable backgroundDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_my_location_background); + Drawable backgroundDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_myLocationBackgroundDrawable); if (backgroundDrawable == null) { backgroundDrawable = ContextCompat.getDrawable(context, R.drawable.mapbox_mylocation_bg_shape); } mapboxMapOptions.myLocationForegroundDrawables(foregroundDrawable, foregroundBearingDrawable); mapboxMapOptions.myLocationBackgroundDrawable(backgroundDrawable); - 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)); + mapboxMapOptions.myLocationBackgroundPadding(new int[]{(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_myLocationBackgroundMarginLeft, 0) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_myLocationBackgroundMarginTop, 0) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_myLocationBackgroundMarginRight, 0) * screenDensity) + , (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_myLocationBackgroundMarginBottom, 0) * screenDensity)}); + mapboxMapOptions.myLocationAccuracyAlpha(typedArray.getInt(R.styleable.mapbox_MapView_mapbox_myLocationAccuracyAlpha, 100)); + mapboxMapOptions.myLocationAccuracyTint(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_myLocationAccuracyTintColor, ColorUtils.getPrimaryColor(context))); + mapboxMapOptions.textureMode(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_renderTextureMode, false)); } finally { typedArray.recycle(); } |