Updated direction arrow to be pixel perfect and pretty

This commit is contained in:
Denis 2014-12-11 16:36:47 +02:00
parent 6923a489ad
commit 22c8ba6f32
2 changed files with 2 additions and 1 deletions

View file

@ -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"

View file

@ -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();