diff options
| author | rsudev <rasch@munin-soft.de> | 2013-02-24 17:39:57 +0100 |
|---|---|---|
| committer | rsudev <rasch@munin-soft.de> | 2013-02-24 17:39:57 +0100 |
| commit | 327b69bffb50d40a0d63080d6b199fbcde7b0b19 (patch) | |
| tree | be68e2bad8ade00fcdd88b606ccd89ec1b30bd1c /main/src/cgeo/geocaching/Waypoint.java | |
| parent | 309231b5194848a9821a0e152fa2ae29ebac9601 (diff) | |
| download | cgeo-327b69bffb50d40a0d63080d6b199fbcde7b0b19.zip cgeo-327b69bffb50d40a0d63080d6b199fbcde7b0b19.tar.gz cgeo-327b69bffb50d40a0d63080d6b199fbcde7b0b19.tar.bz2 | |
Visited waypoints - small fixes and polishing
Diffstat (limited to 'main/src/cgeo/geocaching/Waypoint.java')
| -rw-r--r-- | main/src/cgeo/geocaching/Waypoint.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/Waypoint.java b/main/src/cgeo/geocaching/Waypoint.java index e3b2be0..4b014a6 100644 --- a/main/src/cgeo/geocaching/Waypoint.java +++ b/main/src/cgeo/geocaching/Waypoint.java @@ -30,6 +30,13 @@ public class Waypoint implements IWaypoint, Comparable<Waypoint> { private int cachedOrder = ORDER_UNDEFINED; private boolean own = false; private boolean visited = false; + // preliminary default for mdpi screens + private static int VISITED_INSET = 7; + + public static void initializeScale() { + // Calculate visited inset based on screen density + VISITED_INSET = (int) (6.6f * cgeoapplication.getInstance().getResources().getDisplayMetrics().density + 0.5f); + } /** * require name and type for every waypoint @@ -60,8 +67,8 @@ public class Waypoint implements IWaypoint, Comparable<Waypoint> { LayerDrawable ld = new LayerDrawable(new Drawable[] { res.getDrawable(waypointType.markerId), res.getDrawable(R.drawable.tick) }); - ld.setLayerInset(0, 0, 0, 10, 10); - ld.setLayerInset(1, 10, 10, 0, 0); + ld.setLayerInset(0, 0, 0, VISITED_INSET, VISITED_INSET); + ld.setLayerInset(1, VISITED_INSET, VISITED_INSET, 0, 0); icon = ld; } else { icon = res.getDrawable(waypointType.markerId); |
