diff --git a/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/UserLocationView.java b/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/UserLocationView.java index 349765bdd..68a3ed7a2 100644 --- a/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/UserLocationView.java +++ b/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/UserLocationView.java @@ -43,8 +43,6 @@ final class UserLocationView extends View { private MapView mMapView; - private static final int BLUE_COLOR = 0x39ACCBFF; - private float mDensity; private boolean mShowMarker; @@ -137,6 +135,8 @@ final class UserLocationView extends View { // Setup the custom paint Resources resources = context.getResources(); + int accuracyColor = resources.getColor(R.color.my_location_ring); + mDensity = resources.getDisplayMetrics().density; mMarkerCoordinate = new LatLng(0.0, 0.0); mMarkerScreenPoint = new PointF(); @@ -145,20 +145,20 @@ final class UserLocationView extends View { mAccuracyPaintFill = new Paint(); mAccuracyPaintFill.setAntiAlias(true); mAccuracyPaintFill.setStyle(Paint.Style.FILL); - mAccuracyPaintFill.setColor(BLUE_COLOR); + mAccuracyPaintFill.setColor(accuracyColor); mAccuracyPaintFill.setAlpha((int) (255 * 0.25f)); mAccuracyPaintStroke = new Paint(); mAccuracyPaintStroke.setAntiAlias(true); mAccuracyPaintStroke.setStyle(Paint.Style.STROKE); mAccuracyPaintStroke.setStrokeWidth(0.5f * mDensity); - mAccuracyPaintStroke.setColor(BLUE_COLOR); + mAccuracyPaintStroke.setColor(accuracyColor); mAccuracyPaintStroke.setAlpha((int) (255 * 0.5f)); mAccuracyPath = new Path(); mAccuracyBounds = new RectF(); - mUserLocationDrawable = ContextCompat.getDrawable(getContext(), R.drawable.user_location); + mUserLocationDrawable = ContextCompat.getDrawable(getContext(), R.drawable.my_location); mUserLocationDrawableBounds = new Rect( -mUserLocationDrawable.getIntrinsicWidth() / 2, -mUserLocationDrawable.getIntrinsicHeight() / 2, @@ -171,7 +171,7 @@ final class UserLocationView extends View { mUserLocationDrawable.getIntrinsicHeight() / 2); mUserLocationDrawable.setBounds(mUserLocationDrawableBounds); - mUserLocationBearingDrawable = ContextCompat.getDrawable(getContext(), R.drawable.user_location_bearing); + mUserLocationBearingDrawable = ContextCompat.getDrawable(getContext(), R.drawable.my_location_bearing); mUserLocationBearingDrawableBounds = new Rect( -mUserLocationBearingDrawable.getIntrinsicWidth() / 2, -mUserLocationBearingDrawable.getIntrinsicHeight() / 2, @@ -184,7 +184,7 @@ final class UserLocationView extends View { mUserLocationBearingDrawable.getIntrinsicHeight() / 2); mUserLocationBearingDrawable.setBounds(mUserLocationBearingDrawableBounds); - mUserLocationStaleDrawable = ContextCompat.getDrawable(getContext(), R.drawable.user_location_stale); + mUserLocationStaleDrawable = ContextCompat.getDrawable(getContext(), R.drawable.my_location_stale); mUserLocationStaleDrawableBounds = new Rect( -mUserLocationStaleDrawable.getIntrinsicWidth() / 2, -mUserLocationStaleDrawable.getIntrinsicHeight() / 2, diff --git a/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml b/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml index 09dee3752..66149ffcb 100644 --- a/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml +++ b/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml @@ -40,4 +40,16 @@ + + + + + + + + + + + + diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_info_blue_normal.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/attribution_button_normal.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_info_blue_normal.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/attribution_button_normal.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_info_blue_pressed.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/attribution_button_pressed.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/ic_info_blue_pressed.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/attribution_button_pressed.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/user_location.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/user_location.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/user_location_bearing.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_bearing.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/user_location_bearing.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_bearing.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/user_location_stale.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_stale.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/user_location_stale.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-hdpi/my_location_stale.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_info_blue_normal.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/attribution_button_normal.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_info_blue_normal.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/attribution_button_normal.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_info_blue_pressed.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/attribution_button_pressed.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/ic_info_blue_pressed.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/attribution_button_pressed.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/user_location.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/user_location.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/user_location_bearing.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_bearing.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/user_location_bearing.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_bearing.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/user_location_stale.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_stale.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/user_location_stale.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/my_location_stale.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_info_blue_normal.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/attribution_button_normal.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_info_blue_normal.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/attribution_button_normal.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_info_blue_pressed.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/attribution_button_pressed.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/ic_info_blue_pressed.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/attribution_button_pressed.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/user_location.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/user_location.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/user_location_bearing.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_bearing.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/user_location_bearing.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_bearing.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/user_location_stale.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_stale.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/user_location_stale.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xhdpi/my_location_stale.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_info_blue_normal.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/attribution_button_normal.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_info_blue_normal.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/attribution_button_normal.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_info_blue_pressed.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/attribution_button_pressed.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/ic_info_blue_pressed.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/attribution_button_pressed.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/user_location.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/user_location.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/user_location_bearing.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_bearing.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/user_location_bearing.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_bearing.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/user_location_stale.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_stale.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/user_location_stale.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/my_location_stale.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_info_blue_normal.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/attribution_button_normal.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_info_blue_normal.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/attribution_button_normal.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_info_blue_pressed.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/attribution_button_pressed.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/ic_info_blue_pressed.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/attribution_button_pressed.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/user_location.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/user_location.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/user_location_bearing.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_bearing.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/user_location_bearing.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_bearing.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/user_location_stale.png b/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_stale.png similarity index 100% rename from android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/user_location_stale.png rename to android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/my_location_stale.png diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable/attribution_button_selector.xml b/android/MapboxGLAndroidSDK/src/main/res/drawable/attribution_button_selector.xml new file mode 100644 index 000000000..b5fedb0fd --- /dev/null +++ b/android/MapboxGLAndroidSDK/src/main/res/drawable/attribution_button_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_info_selector.xml b/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_info_selector.xml deleted file mode 100644 index 9f550f66d..000000000 --- a/android/MapboxGLAndroidSDK/src/main/res/drawable/ic_info_selector.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/android/MapboxGLAndroidSDK/src/main/res/layout/mapview_internal.xml b/android/MapboxGLAndroidSDK/src/main/res/layout/mapview_internal.xml index c4eaecc07..92cd2315f 100644 --- a/android/MapboxGLAndroidSDK/src/main/res/layout/mapview_internal.xml +++ b/android/MapboxGLAndroidSDK/src/main/res/layout/mapview_internal.xml @@ -26,7 +26,7 @@ android:clickable="true" android:contentDescription="@string/attributionsIconContentDescription" android:padding="7dp" - android:src="@drawable/ic_info_selector" /> + android:src="@drawable/attribution_button_selector" /> #FFFFFF #000000 #1E8CAB + @color/mapbox_blue