cover also upside-down case

This commit is contained in:
sonora 2015-01-06 09:04:14 +01:00
parent a06f5454ef
commit 9fa44e1419
2 changed files with 10 additions and 2 deletions

View file

@ -111,6 +111,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
private static final int ORIENTATION_0 = 0;
private static final int ORIENTATION_90 = 3;
private static final int ORIENTATION_270 = 1;
private static final int ORIENTATION_180 = 2;
private PoiFilter filter;
private AmenityAdapter amenityAdapter;
@ -789,7 +790,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
screenOrientation = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
switch (screenOrientation)
{
case ORIENTATION_0: // Portrait
case ORIENTATION_0: // Device default (normally portrait)
screenOrientation = 0;
break;
case ORIENTATION_90: // Landscape right
@ -798,6 +799,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
case ORIENTATION_270: // Landscape left
screenOrientation = 270;
break;
case ORIENTATION_180: // Upside down
screenOrientation = 180;
break;
}
draw.setAngle(mes[1] - a + 180 + screenOrientation);

View file

@ -45,6 +45,7 @@ public class DashFavoritesFragment extends DashBaseFragment {
private static final int ORIENTATION_0 = 0;
private static final int ORIENTATION_90 = 3;
private static final int ORIENTATION_270 = 1;
private static final int ORIENTATION_180 = 2;
private List<ImageView> arrows = new ArrayList<ImageView>();
List<FavouritePoint> points = new ArrayList<FavouritePoint>();
@ -189,7 +190,7 @@ public class DashFavoritesFragment extends DashBaseFragment {
screenOrientation = ((WindowManager) getActivity().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
switch (screenOrientation)
{
case ORIENTATION_0: // Portrait
case ORIENTATION_0: // Device default (normally portrait)
screenOrientation = 0;
break;
case ORIENTATION_90: // Landscape right
@ -198,6 +199,9 @@ public class DashFavoritesFragment extends DashBaseFragment {
case ORIENTATION_270: // Landscape left
screenOrientation = 270;
break;
case ORIENTATION_180: // Upside down
screenOrientation = 180;
break;
}
draw.setAngle(mes[1] - a + 180 + screenOrientation);