Updated direction arrow to be pixel perfect and pretty
This commit is contained in:
parent
6923a489ad
commit
22c8ba6f32
2 changed files with 2 additions and 1 deletions
|
@ -33,6 +33,7 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<ImageView android:visibility="gone"
|
<ImageView android:visibility="gone"
|
||||||
android:id="@+id/direction"
|
android:id="@+id/direction"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="10dp"
|
android:layout_width="10dp"
|
||||||
android:layout_height="10dp"/>
|
android:layout_height="10dp"/>
|
||||||
<TextView android:id="@+id/distance"
|
<TextView android:id="@+id/distance"
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class DirectionDrawable extends Drawable {
|
||||||
if (favorite) {
|
if (favorite) {
|
||||||
canvas.rotate(angle, canvas.getHeight()/2, canvas.getWidth()/2);
|
canvas.rotate(angle, canvas.getHeight()/2, canvas.getWidth()/2);
|
||||||
Bitmap arrow = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_destination_arrow);
|
Bitmap arrow = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_destination_arrow);
|
||||||
canvas.drawBitmap(arrow, 0, 0, new Paint());
|
canvas.drawBitmap(arrow, null, new Rect(0,0,arrow.getHeight(), arrow.getWidth()), null);
|
||||||
} else {
|
} else {
|
||||||
canvas.rotate(angle, width / 2, height / 2);
|
canvas.rotate(angle, width / 2, height / 2);
|
||||||
Path directionPath = createDirectionPath();
|
Path directionPath = createDirectionPath();
|
||||||
|
|
Loading…
Reference in a new issue