openframeworks / openframeworks/openFrameworks
Orientation Issues with Nexus 10
@arturoc is already working on this.
Since May 23, 2013.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
I discovered that the orientation for the Nexus 10 is off by 90 degrees. The natural state (0) of the N10 is landscape verses the Nexus 4 and Nexus 7 where the natural state (0) is Portrait. So when the orientation degrees are returned by public void onOrientationChanged(int orientation) from an OrientationEventListener() is not correct for the cases we have define. For the N10, Landscape == 0, Portrait == 90, Landscape == 180, Portrait == 270, LandScape == 360. While everything else is Portrait == 0, Landscape == 90, Portrait == 180, Landscape == 270, Portrait == 360.
So currently this bit is broken in OFAndroid.java for the Nexus 10:
switch(orientation){
case 0:
ofActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
break;
case 90:
ofActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
break;
case 270:
ofActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
break;
case 180:
ofActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
break;
case -1:
ofActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
break;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.