From 506e4d18bfb00bc3a314bff9ab92c2830e8c4a73 Mon Sep 17 00:00:00 2001 From: sonora Date: Sat, 3 Jan 2015 21:38:10 +0100 Subject: [PATCH] Insert TODO's commtents for the "direction arrows are wrong for rotated display" bug --- .../net/osmand/plus/activities/search/SearchPOIActivity.java | 5 +++++ .../src/net/osmand/plus/dashboard/DashFavoritesFragment.java | 5 +++++ OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java | 3 +++ 3 files changed, 13 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java index 3e60b44f87..bf585e8827 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java @@ -777,7 +777,12 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa DirectionDrawable draw = new DirectionDrawable(SearchPOIActivity.this, width, height, false); Float h = heading; float a = h != null ? h : 0; + + //TODO: Hardy: The arrow direction below is correct only for the default display's standard orientation + // i.e. still needs to be corrected for .ROTATION_90/180/170 + // Keep in mind: getRotation was introduced from Android 2.2 draw.setAngle(mes[1] - a + 180); + draw.setOpenedColor(opened); direction.setImageDrawable(draw); } else { diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java index d07fa0ac4b..6e104d6e79 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java @@ -175,7 +175,12 @@ public class DashFavoritesFragment extends DashBaseFragment { DirectionDrawable draw = new DirectionDrawable(getActivity(), 10, 10, true); Float h = heading; float a = h != null ? h : 0; + + //TODO: Hardy: The arrow direction below is correct only for the default display's standard orientation + // i.e. still needs to be corrected for .ROTATION_90/180/170 + // Keep in mind: getRotation was introduced from Android 2.2 draw.setAngle(mes[1] - a + 180); + direction.setImageDrawable(draw); } diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java index 10f7665bef..f122b4e893 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java @@ -1257,6 +1257,9 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements float[] mes = new float[2]; net.osmand.Location.distanceBetween(location.getLatitude(), location.getLongitude(), mapLocation.getLatitude(), mapLocation.getLongitude(), mes); + //TODO: Hardy: Check: The arrow direction below may only be correct for the default display's standard orientation + // i.e. still needs to be corrected for .ROTATION_90/180/170 + // Keep in mind: getRotation was introduced from Android 2.2 draw.setAngle(mes[1] - lastCompass + 180); long now = System.currentTimeMillis(); final boolean recent = Math.abs( now - location.getTime() ) < RECENT_THRESHOLD;