From 9fa44e141901d380260277ad3d46ecc40248d848 Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 6 Jan 2015 09:04:14 +0100 Subject: [PATCH] cover also upside-down case --- .../osmand/plus/activities/search/SearchPOIActivity.java | 6 +++++- .../net/osmand/plus/dashboard/DashFavoritesFragment.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java index b0a3f93836..b0c19a1106 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java @@ -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); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java index 298820d590..ba07f3fc04 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java @@ -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 arrows = new ArrayList(); List points = new ArrayList(); @@ -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);