Insert TODO's commtents for the "direction arrows are wrong for rotated display" bug

This commit is contained in:
sonora 2015-01-03 21:38:10 +01:00
parent 659e17cbfa
commit 506e4d18bf
3 changed files with 13 additions and 0 deletions

View file

@ -777,7 +777,12 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
DirectionDrawable draw = new DirectionDrawable(SearchPOIActivity.this, width, height, false); DirectionDrawable draw = new DirectionDrawable(SearchPOIActivity.this, width, height, false);
Float h = heading; Float h = heading;
float a = h != null ? h : 0; 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.setAngle(mes[1] - a + 180);
draw.setOpenedColor(opened); draw.setOpenedColor(opened);
direction.setImageDrawable(draw); direction.setImageDrawable(draw);
} else { } else {

View file

@ -175,7 +175,12 @@ public class DashFavoritesFragment extends DashBaseFragment {
DirectionDrawable draw = new DirectionDrawable(getActivity(), 10, 10, true); DirectionDrawable draw = new DirectionDrawable(getActivity(), 10, 10, true);
Float h = heading; Float h = heading;
float a = h != null ? h : 0; 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.setAngle(mes[1] - a + 180);
direction.setImageDrawable(draw); direction.setImageDrawable(draw);
} }

View file

@ -1257,6 +1257,9 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
float[] mes = new float[2]; float[] mes = new float[2];
net.osmand.Location.distanceBetween(location.getLatitude(), location.getLongitude(), net.osmand.Location.distanceBetween(location.getLatitude(), location.getLongitude(),
mapLocation.getLatitude(), mapLocation.getLongitude(), mes); 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); draw.setAngle(mes[1] - lastCompass + 180);
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
final boolean recent = Math.abs( now - location.getTime() ) < RECENT_THRESHOLD; final boolean recent = Math.abs( now - location.getTime() ) < RECENT_THRESHOLD;