diff options
author | Tobrun <tobrun@mapbox.com> | 2016-04-28 11:03:47 +0200 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2016-04-28 13:48:07 -0500 |
commit | 25af12b647586470c2213cc3b0458aa9e203eda2 (patch) | |
tree | b63339b459bcd8bbc064a5df59e226ef660abc00 /platform/android | |
parent | 8507b8663de780e0ad1b6631550a77965e4c3358 (diff) | |
download | qtlocation-mapboxgl-25af12b647586470c2213cc3b0458aa9e203eda2.tar.gz |
[android] #4878 - fix default color of accuracy circle to match primary color, removed old resources, introduced drawable density folders for new resources, enforced consistent naming.
Diffstat (limited to 'platform/android')
34 files changed, 75 insertions, 62 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java index 8aa8eccf58..8e1bf9773d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java @@ -270,13 +270,9 @@ public class MapView extends FrameLayout { // MyLocationView MyLocationViewSettings myLocationViewSettings = mMapboxMap.getMyLocationViewSettings(); myLocationViewSettings.setForegroundDrawable(options.getMyLocationForegroundDrawable(), options.getMyLocationForegroundBearingDrawable()); + myLocationViewSettings.setForegroundTintColor(options.getMyLocationForegroundTintColor()); myLocationViewSettings.setBackgroundDrawable(options.getMyLocationBackgroundDrawable(), options.getMyLocationBackgroundPadding()); - if (options.getMyLocationForegroundTintColor() != -1) { - myLocationViewSettings.setForegroundTintColor(options.getMyLocationForegroundTintColor()); - } - if (options.getMyLocationBackgroundTintColor() != -1) { - myLocationViewSettings.setBackgroundTintColor(options.getMyLocationBackgroundTintColor()); - } + myLocationViewSettings.setBackgroundTintColor(options.getMyLocationBackgroundTintColor()); myLocationViewSettings.setAccuracyAlpha(options.getMyLocationAccuracyAlpha()); myLocationViewSettings.setAccuracyTintColor(options.getMyLocationAccuracyTintColor()); mMapboxMap.setMyLocationEnabled(options.getLocationEnabled()); 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 c5040f40dc..f9f6953dbe 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 @@ -2,6 +2,7 @@ package com.mapbox.mapboxsdk.maps; import android.content.Context; import android.content.res.TypedArray; +import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; @@ -9,6 +10,7 @@ import android.support.annotation.ColorInt; import android.support.annotation.IntRange; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.Gravity; @@ -65,8 +67,8 @@ public class MapboxMapOptions implements Parcelable { private Drawable myLocationForegroundDrawable; private Drawable myLocationForegroundBearingDrawable; private Drawable myLocationBackgroundDrawable; - private int myLocationForegroundTintColor = -1; - private int myLocationBackgroundTintColor = -1; + private int myLocationForegroundTintColor; + private int myLocationBackgroundTintColor; private int[] myLocationBackgroundPadding; private int myLocationAccuracyTintColor; private int myLocationAccuracyAlpha; @@ -171,16 +173,32 @@ public class MapboxMapOptions implements Parcelable { , (int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_bottom, DIMENSION_SEVEN_DP) * screenDensity)}); mapboxMapOptions.locationEnabled(typedArray.getBoolean(R.styleable.MapView_my_location_enabled, false)); - mapboxMapOptions.myLocationForegroundDrawables(typedArray.getDrawable(R.styleable.MapView_my_location_foreground), typedArray.getDrawable(R.styleable.MapView_my_location_foreground_bearing)); - mapboxMapOptions.myLocationBackgroundDrawable(typedArray.getDrawable(R.styleable.MapView_my_location_background)); - mapboxMapOptions.myLocationForegroundTintColor(typedArray.getColor(R.styleable.MapView_my_location_foreground_tint, -1)); - mapboxMapOptions.myLocationBackgroundTintColor(typedArray.getColor(R.styleable.MapView_my_location_background_tint, -1)); + 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)); + + Drawable foregroundDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_foreground); + if(foregroundDrawable==null){ + foregroundDrawable = ContextCompat.getDrawable(context,R.drawable.ic_mylocationview_normal); + } + + Drawable foregroundBearingDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_foreground_bearing); + if(foregroundBearingDrawable==null){ + foregroundBearingDrawable = ContextCompat.getDrawable(context,R.drawable.ic_mylocationview_bearing); + } + + Drawable backgroundDrawable = typedArray.getDrawable(R.styleable.MapView_my_location_background); + if(backgroundDrawable==null){ + backgroundDrawable = ContextCompat.getDrawable(context, R.drawable.ic_mylocationview_background); + } + + 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.getAccentColor(context))); + mapboxMapOptions.myLocationAccuracyTint(typedArray.getColor(R.styleable.MapView_my_location_accuracy_tint, ColorUtils.getPrimaryColor(context))); } finally { typedArray.recycle(); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java index 85052ef383..78e2b80e42 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java @@ -3,6 +3,7 @@ package com.mapbox.mapboxsdk.maps.widgets; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; +import android.graphics.Color; import android.graphics.Paint; import android.graphics.PointF; import android.graphics.PorterDuff; @@ -19,16 +20,13 @@ import android.support.annotation.ColorInt; import android.support.annotation.FloatRange; import android.support.annotation.IntRange; import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; import android.support.v4.view.animation.FastOutLinearInInterpolator; import android.util.AttributeSet; -import android.util.Log; import android.view.View; import com.mapbox.mapboxsdk.R; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.MapboxConstants; import com.mapbox.mapboxsdk.constants.MyBearingTracking; import com.mapbox.mapboxsdk.constants.MyLocationTracking; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -37,7 +35,6 @@ import com.mapbox.mapboxsdk.location.LocationServices; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.Projection; import com.mapbox.mapboxsdk.maps.UiSettings; -import com.mapbox.mapboxsdk.utils.ColorUtils; import java.lang.ref.WeakReference; @@ -72,6 +69,9 @@ public class MyLocationView extends View { private Drawable foregroundBearingDrawable; private Drawable backgroundDrawable; + private int foregroundTintColor; + private int backgroundTintColor; + private Rect foregroundBounds; private Rect backgroundBounds; @@ -106,38 +106,36 @@ public class MyLocationView extends View { private void init(Context context) { setEnabled(false); - - // behavioural model myLocationBehaviour = new MyLocationBehaviourFactory().getBehaviouralModel(MyLocationTracking.TRACKING_NONE); compassListener = new CompassListener(context); - maxSize = (int) context.getResources().getDimension(R.dimen.userlocationview_size); - - // default implementation - setShadowDrawable(ContextCompat.getDrawable(context, R.drawable.ic_userlocationview_shadow)); - setForegroundDrawables(ContextCompat.getDrawable(context, R.drawable.ic_userlocationview_normal), ContextCompat.getDrawable(context, R.drawable.ic_userlocationview_bearing)); - setAccuracyTint(ColorUtils.getAccentColor(context)); - setAccuracyAlpha(100); + maxSize = (int) context.getResources().getDimension(R.dimen.my_locationview_size); } public final void setForegroundDrawables(Drawable defaultDrawable, Drawable bearingDrawable) { if (defaultDrawable == null || bearingDrawable == null) { - Log.e(MapboxConstants.TAG, "Not setting foreground drawables MyLocationView: default = " + defaultDrawable + " bearing = " + bearingDrawable); return; } if (defaultDrawable.getIntrinsicWidth() != bearingDrawable.getIntrinsicWidth() || defaultDrawable.getIntrinsicHeight() != bearingDrawable.getIntrinsicHeight()) { throw new RuntimeException("The dimensions from location and bearing drawables should be match"); } + + foregroundDrawable = defaultDrawable; foregroundBearingDrawable = bearingDrawable; + setForegroundDrawableTint(foregroundTintColor); + invalidateBounds(); } public final void setForegroundDrawableTint(@ColorInt int color) { - if (foregroundDrawable != null) { - foregroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN); - } - if (foregroundBearingDrawable != null) { - foregroundBearingDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN); + if (color != Color.TRANSPARENT) { + foregroundTintColor = color; + if (foregroundDrawable != null) { + foregroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN); + } + if (foregroundBearingDrawable != null) { + foregroundBearingDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN); + } } } @@ -155,15 +153,19 @@ public class MyLocationView extends View { backgroundOffsetRight = right; backgroundOffsetBottom = bottom; + setShadowDrawableTint(backgroundTintColor); + invalidateBounds(); } public final void setShadowDrawableTint(@ColorInt int color) { - if (backgroundDrawable == null) { - return; + if (color != Color.TRANSPARENT) { + backgroundTintColor = color; + if (backgroundDrawable == null) { + return; + } + backgroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN); } - - backgroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN); } public final void setAccuracyTint(@ColorInt int color) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_mylocationview_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_mylocationview_bearing.png Binary files differnew file mode 100755 index 0000000000..c93fa4781a --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_mylocationview_bearing.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_mylocationview_normal.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_mylocationview_normal.png Binary files differnew file mode 100755 index 0000000000..120b7dd612 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_mylocationview_normal.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location.png Binary files differdeleted file mode 100755 index 1ae8d541af..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_bearing.png Binary files differdeleted file mode 100755 index 8ecaffa2e8..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_bearing.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_stale.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_stale.png Binary files differdeleted file mode 100755 index 0d599c01fa..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_stale.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_mylocationview_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_mylocationview_bearing.png Binary files differnew file mode 100755 index 0000000000..0d7d89a8b4 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_mylocationview_bearing.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_mylocationview_normal.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_mylocationview_normal.png Binary files differnew file mode 100755 index 0000000000..831ef1acf4 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_mylocationview_normal.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location.png Binary files differdeleted file mode 100755 index 542cd25e22..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_bearing.png Binary files differdeleted file mode 100755 index 429f03f648..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_bearing.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_stale.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_stale.png Binary files differdeleted file mode 100755 index 6613c41153..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_stale.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_mylocationview_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_mylocationview_bearing.png Binary files differnew file mode 100755 index 0000000000..1056d617e9 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_mylocationview_bearing.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_mylocationview_normal.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_mylocationview_normal.png Binary files differnew file mode 100755 index 0000000000..37b1f7adbf --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_mylocationview_normal.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location.png Binary files differdeleted file mode 100755 index ca1f1fe630..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_bearing.png Binary files differdeleted file mode 100755 index 1b88f9f489..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_bearing.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_stale.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_stale.png Binary files differdeleted file mode 100755 index 7af3789ff0..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_stale.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_mylocationview_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_mylocationview_bearing.png Binary files differnew file mode 100755 index 0000000000..1ff2590606 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_mylocationview_bearing.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_mylocationview_normal.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_mylocationview_normal.png Binary files differnew file mode 100755 index 0000000000..520b85eff7 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_mylocationview_normal.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location.png Binary files differdeleted file mode 100755 index 6f175df168..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_bearing.png Binary files differdeleted file mode 100755 index f4bb454a06..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_bearing.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_stale.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_stale.png Binary files differdeleted file mode 100755 index f1d2f2eca0..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_stale.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_mylocationview_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_mylocationview_bearing.png Binary files differnew file mode 100755 index 0000000000..671c33a08e --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_mylocationview_bearing.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_mylocationview_normal.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_mylocationview_normal.png Binary files differnew file mode 100755 index 0000000000..f9f4265d2a --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_mylocationview_normal.png diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_userlocationview_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_userlocationview_bearing.png Binary files differdeleted file mode 100644 index 5a589a9cf2..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_userlocationview_bearing.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_userlocationview_normal.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_userlocationview_normal.png Binary files differdeleted file mode 100644 index cb31dca8d2..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_userlocationview_normal.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location.png Binary files differdeleted file mode 100755 index d43541ac3c..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_bearing.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_bearing.png Binary files differdeleted file mode 100755 index a8cccbb3e2..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_bearing.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_stale.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_stale.png Binary files differdeleted file mode 100755 index 33e952391f..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_stale.png +++ /dev/null diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_mylocationview_background.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_mylocationview_background.xml new file mode 100644 index 0000000000..7601d1b4a8 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_mylocationview_background.xml @@ -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="?attr/colorPrimaryDark" /> + + <size + android:width="@dimen/my_locationview_outer_circle" + android:height="@dimen/my_locationview_outer_circle" /> +</shape>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_userlocationview_shadow.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_userlocationview_shadow.xml deleted file mode 100644 index 20000c2fe2..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_userlocationview_shadow.xml +++ /dev/null @@ -1,12 +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/userlocationview_outer_circle" - android:height="@dimen/userlocationview_outer_circle"/> -</shape>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/values/dimens.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/values/dimens.xml index a48a4f14b3..d6cca7090f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/values/dimens.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/values/dimens.xml @@ -9,7 +9,6 @@ <dimen name="ten_dp">10dp</dimen> <dimen name="sixteen_dp">16dp</dimen> <dimen name="seventy_six_dp">76dp</dimen> - <dimen name="userlocationview_size">64dp</dimen> - <dimen name="userlocationview_inner_circle">18dp</dimen> - <dimen name="userlocationview_outer_circle">22dp</dimen> + <dimen name="my_locationview_size">64dp</dimen> + <dimen name="my_locationview_outer_circle">18dp</dimen> </resources> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_toggle.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_toggle.xml index c795098f0a..6037419aa2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_toggle.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_toggle.xml @@ -1,29 +1,29 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - xmlns:mapbox="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:orientation="vertical"> + xmlns:mapbox="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" + android:id="@id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> + android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> <android.support.design.widget.CoordinatorLayout - android:id="@+id/coordinatorLayout" + android:id="@id/coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <com.mapbox.mapboxsdk.maps.MapView - android:id="@+id/mapView" + android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - mapbox:access_token="@string/mapbox_access_token" - /> + mapbox:my_location_background_tint="@android:color/white" + mapbox:access_token="@string/mapbox_access_token" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fabLocationToggle" |