[android] #4396 - new images for UserLocationView

This commit is contained in:
Tobrun
2016-04-13 15:33:21 +02:00
parent 00381a2ae0
commit f84268c4e9
5 changed files with 30 additions and 23 deletions

View File

@@ -123,13 +123,10 @@ public final class UserLocationView extends View {
// setBackgroundColor(ContextCompat.getColor(context,android.R.color.darker_gray));
accurancyPaint = new Paint();
accurancyPaint.setColor(Color.RED);
accurancyPaint.setColor(ContextCompat.getColor(context, R.color.mapbox_blue));
accurancyPaint.setAlpha(80);
setShadowDrawable(ContextCompat.getDrawable(context, R.drawable.ic_userlocationview_shadow));
setShadowDrawableTint(Color.BLACK);
setForegroundDrawable(ContextCompat.getDrawable(context, R.drawable.ic_userlocationview_bearing));
setOnClickListener(new OnClickListener() {
@Override
@@ -138,7 +135,6 @@ public final class UserLocationView extends View {
}
});
setForegroundDrawableTint(Color.RED);
mBearingChangeListener = new MyBearingListener(context);
}
@@ -327,8 +323,8 @@ public final class UserLocationView extends View {
// markerScreenPoint = new PointF(((uiSettings.getWidth() - getWidth() + contentPadding[0] - contentPadding[2]) / 2)
// , ((uiSettings.getHeight() - getHeight() - contentPadding[3] + contentPadding[1]) / 2));
setX(markerScreenPoint.x-getWidth()/2);
setY(markerScreenPoint.y-getHeight()/2);
setX(markerScreenPoint.x - getWidth() / 2);
setY(markerScreenPoint.y - getHeight() / 2);
} else if (myLocationTrackingMode == MyLocationTracking.TRACKING_FOLLOW) {
double bearing = 0;
if (showDirection) {
@@ -344,23 +340,23 @@ public final class UserLocationView extends View {
// only update if there is an actual change
if ((!currentMapViewCoordinate.equals(markerScreenCoordinate)) || (!(mCurrentBearing == bearing))) {
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(markerScreenCoordinate)
.bearing(bearing)
.build();
mapboxMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), 300, null);
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(markerScreenCoordinate)
.bearing(bearing)
.build();
mapboxMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), 300, null);
// mMarkerScreenMatrix.reset();
markerScreenPoint = getMarkerScreenPoint();
markerScreenPoint = getMarkerScreenPoint();
// mMarkerScreenMatrix.setTranslate(mMarkerScreenPoint.x, mMarkerScreenPoint.y);
// set values for next check for actual change
currentMapViewCoordinate = markerScreenCoordinate;
mCurrentBearing = bearing;
}
// set values for next check for actual change
currentMapViewCoordinate = markerScreenCoordinate;
mCurrentBearing = bearing;
}
}
// rotate so arrow in points to bearing
// rotate so arrow in points to bearing
if (showDirection) {
if (myBearingTrackingMode == MyBearingTracking.COMPASS && myLocationTrackingMode == MyLocationTracking.TRACKING_NONE) {
setDirection(compassDirection);
@@ -405,10 +401,10 @@ public final class UserLocationView extends View {
// mMarkerScreenMatrix.mapRect(mDirtyRectF, largerBounds);
// mDirtyRectF.roundOut(mDirtyRect);
// invalidate(mDirtyRect); // the new marker location
} else {
setVisibility(View.INVISIBLE);
}
} else {
setVisibility(View.INVISIBLE);
}
}
public PointF getMarkerScreenPoint() {
if (myLocationTrackingMode == MyLocationTracking.TRACKING_NONE) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -9,6 +9,6 @@
<dimen name="ten_dp">10dp</dimen>
<dimen name="sixteen_dp">16dp</dimen>
<dimen name="seventy_six_dp">76dp</dimen>
<dimen name="userlocationview_inner_circle">19dp</dimen>
<dimen name="userlocationview_outer_circle">20dp</dimen>
<dimen name="userlocationview_inner_circle">18dp</dimen>
<dimen name="userlocationview_outer_circle">22dp</dimen>
</resources>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 139.6 219" enable-background="new 0 0 139.6 219" xml:space="preserve">
<g id="XMLID_11_">
<path fill="#39ADCC" d="M66.5,1.3c1.1-1.8,3.7-1.8,4.8,0l9.8,17L94.8,42c-12.9-3.4-41.7-2.9-52,0.5l13.9-24.2L66.5,1.3z"/>
</g>
<g id="XMLID_7_">
<circle id="XMLID_10_" fill="#39ADCC" cx="69.8" cy="149.2" r="69.8"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 603 B