Fix display of favorites in list

This commit is contained in:
Victor Shcherb 2015-11-05 10:12:54 +01:00
parent 42d0537054
commit b816cb3199
4 changed files with 9 additions and 7 deletions

View file

@ -51,11 +51,13 @@ public class FavoriteImageDrawable extends Drawable {
paintOuter.setStyle(Style.FILL_AND_STROKE);
paintInnerCircle = new Paint();
paintInnerCircle.setStyle(Style.FILL_AND_STROKE);
if(metrics != null) {
paintOuter.setStrokeWidth(metrics.density * 2);
if(metrics != null && metrics.density > 0) {
paintOuter.setStrokeWidth(metrics.density * 1);
} else {
paintOuter.setStrokeWidth(1);
}
// paintOuter.setColor(color == 0 || color == Color.BLACK ? 0x88555555 : color);
paintOuter.setColor(0xffccccc);
paintOuter.setColor(0xffbbbbbb);
paintInnerCircle.setColor(Color.WHITE);
paintInnerCircle.setAntiAlias(true);
}
@ -98,7 +100,7 @@ public class FavoriteImageDrawable extends Drawable {
canvas.drawBitmap(favIcon, bs.exactCenterX() - favIcon.getWidth() / 2f, bs.exactCenterY() - favIcon.getHeight() / 2f, paintIcon);
} else {
int min = Math.min(bs.width(), bs.height());
int r = (int) (min / 4 * 3);
int r = (int) (min * 4 / 10);
int rs = (int) (r - 1);
canvas.drawCircle(min / 2, min / 2, r, paintOuter);
canvas.drawCircle(min / 2, min / 2, rs, paintInnerCircle);

View file

@ -49,7 +49,7 @@ public class FavouritePointMenuController extends MenuController {
@Override
public Drawable getLeftIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), false);
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), true);
}
@Override

View file

@ -50,7 +50,7 @@ public class WptPtMenuController extends MenuController {
@Override
public Drawable getLeftIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), wpt.getColor(), false);
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), wpt.getColor(), true);
}
@Override

View file

@ -210,7 +210,7 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
if (group != null) {
color = group.color;
}
return FavoriteImageDrawable.getOrCreate(getMapActivity(), color, false);
return FavoriteImageDrawable.getOrCreate(getMapActivity(), color, true);
}
@Override