From a60cd2a83565d5ce10cc61d460bc96a54102524d Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 6 Jan 2015 08:37:17 +0100 Subject: [PATCH] simplifiy code --- .../activities/search/SearchPOIActivity.java | 18 +++--------------- .../plus/dashboard/DashFavoritesFragment.java | 18 +++--------------- 2 files changed, 6 insertions(+), 30 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..fd68efb379 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java @@ -108,9 +108,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa private static final int SHOW_ON_MAP = 1; private static final int FILTER = 2; - 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_0 = 0; // Portrait + private static final int ORIENTATION_90 = 90; // Landscape right + private static final int ORIENTATION_270 = 270; // Landscape left private PoiFilter filter; private AmenityAdapter amenityAdapter; @@ -787,18 +787,6 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa //TODO: getOrientation() needs to be used for API<8, deprecated after that int screenOrientation = 0; screenOrientation = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation(); - switch (screenOrientation) - { - case ORIENTATION_0: // Portrait - screenOrientation = 0; - break; - case ORIENTATION_90: // Landscape right - screenOrientation = 90; - break; - case ORIENTATION_270: // Landscape left - screenOrientation = 270; - break; - } draw.setAngle(mes[1] - a + 180 + screenOrientation); draw.setOpenedColor(opened); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java index 05d523bade..b44628e811 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java @@ -42,9 +42,9 @@ public class DashFavoritesFragment extends DashBaseFragment { private LatLon loc = null; private Float heading = null; - 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_0 = 0; // Portrait + private static final int ORIENTATION_90 = 90; // Landscape right + private static final int ORIENTATION_270 = 270; // Landscape left private List arrows = new ArrayList(); List points = new ArrayList(); @@ -187,18 +187,6 @@ public class DashFavoritesFragment extends DashBaseFragment { //TODO: getOrientation() needs to be used for API<8, deprecated after that int screenOrientation = 0; //screenOrientation = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation(); - switch (screenOrientation) - { - case ORIENTATION_0: // Portrait - screenOrientation = 0; - break; - case ORIENTATION_90: // Landscape right - screenOrientation = 90; - break; - case ORIENTATION_270: // Landscape left - screenOrientation = 270; - break; - } draw.setAngle(mes[1] - a + 180 + screenOrientation); direction.setImageDrawable(draw);