Project: titanium
Issue TIMOB-14780: iOS: Ti.UI.orientationModeFilter to app-wide block orientations
Note: While this spec is for iOS only, consideration in the design should include Android. On iOS, not all view controllers are under Titanium control (e.g., Mail composer, Activities). Because of issues (especially in 5.x and before), we did not control their orientation. But with iOS 6, native applications can control them. We should provide a means similar. Ti.UI.orientationModeFilter is an array of orientations allowed with the following pseudocode: On startup, the info.plist is checked. If no such orientation limits are mentioned, the default for the device (all but upside down for iPod/iPhone, all orientations for iPad) is used. This property can be changed. Whenever the OS requests the window's orientation, Titanium reports to the OS the orientationModes as such: # The orientation flags are set to all orientations. # If the Ti.UI.orientationModeFilter is valid, change the orientations to that. # If the window's orientationModes are set, bitwise AND it with the orientation flags. # if the result is 0, replace the orientation flags with the windows orientationModes, and warn about the edge case. # Return orientation flags. The behavior of the Ti.UI.orientationModeFilter changed at any time after startup is undefined. There is no guarantee that changes made to it will propagate to existing windows.
Story points: 8