cover also upside-down case
This commit is contained in:
parent
a06f5454ef
commit
9fa44e1419
2 changed files with 10 additions and 2 deletions
|
@ -111,6 +111,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
||||||
private static final int ORIENTATION_0 = 0;
|
private static final int ORIENTATION_0 = 0;
|
||||||
private static final int ORIENTATION_90 = 3;
|
private static final int ORIENTATION_90 = 3;
|
||||||
private static final int ORIENTATION_270 = 1;
|
private static final int ORIENTATION_270 = 1;
|
||||||
|
private static final int ORIENTATION_180 = 2;
|
||||||
|
|
||||||
private PoiFilter filter;
|
private PoiFilter filter;
|
||||||
private AmenityAdapter amenityAdapter;
|
private AmenityAdapter amenityAdapter;
|
||||||
|
@ -789,7 +790,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
||||||
screenOrientation = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
|
screenOrientation = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
|
||||||
switch (screenOrientation)
|
switch (screenOrientation)
|
||||||
{
|
{
|
||||||
case ORIENTATION_0: // Portrait
|
case ORIENTATION_0: // Device default (normally portrait)
|
||||||
screenOrientation = 0;
|
screenOrientation = 0;
|
||||||
break;
|
break;
|
||||||
case ORIENTATION_90: // Landscape right
|
case ORIENTATION_90: // Landscape right
|
||||||
|
@ -798,6 +799,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
||||||
case ORIENTATION_270: // Landscape left
|
case ORIENTATION_270: // Landscape left
|
||||||
screenOrientation = 270;
|
screenOrientation = 270;
|
||||||
break;
|
break;
|
||||||
|
case ORIENTATION_180: // Upside down
|
||||||
|
screenOrientation = 180;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
draw.setAngle(mes[1] - a + 180 + screenOrientation);
|
draw.setAngle(mes[1] - a + 180 + screenOrientation);
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ public class DashFavoritesFragment extends DashBaseFragment {
|
||||||
private static final int ORIENTATION_0 = 0;
|
private static final int ORIENTATION_0 = 0;
|
||||||
private static final int ORIENTATION_90 = 3;
|
private static final int ORIENTATION_90 = 3;
|
||||||
private static final int ORIENTATION_270 = 1;
|
private static final int ORIENTATION_270 = 1;
|
||||||
|
private static final int ORIENTATION_180 = 2;
|
||||||
|
|
||||||
private List<ImageView> arrows = new ArrayList<ImageView>();
|
private List<ImageView> arrows = new ArrayList<ImageView>();
|
||||||
List<FavouritePoint> points = new ArrayList<FavouritePoint>();
|
List<FavouritePoint> points = new ArrayList<FavouritePoint>();
|
||||||
|
@ -189,7 +190,7 @@ public class DashFavoritesFragment extends DashBaseFragment {
|
||||||
screenOrientation = ((WindowManager) getActivity().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
|
screenOrientation = ((WindowManager) getActivity().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
|
||||||
switch (screenOrientation)
|
switch (screenOrientation)
|
||||||
{
|
{
|
||||||
case ORIENTATION_0: // Portrait
|
case ORIENTATION_0: // Device default (normally portrait)
|
||||||
screenOrientation = 0;
|
screenOrientation = 0;
|
||||||
break;
|
break;
|
||||||
case ORIENTATION_90: // Landscape right
|
case ORIENTATION_90: // Landscape right
|
||||||
|
@ -198,6 +199,9 @@ public class DashFavoritesFragment extends DashBaseFragment {
|
||||||
case ORIENTATION_270: // Landscape left
|
case ORIENTATION_270: // Landscape left
|
||||||
screenOrientation = 270;
|
screenOrientation = 270;
|
||||||
break;
|
break;
|
||||||
|
case ORIENTATION_180: // Upside down
|
||||||
|
screenOrientation = 180;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
draw.setAngle(mes[1] - a + 180 + screenOrientation);
|
draw.setAngle(mes[1] - a + 180 + screenOrientation);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue