Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14780] iOS: Ti.UI.orientationModeFilter to app-wide block orientations

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterBlain Hamon
AssigneeUnknown
Created2013-08-07T22:11:01.000+0000
Updated2018-02-28T20:04:20.000+0000

Description

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.

Comments

No comments

JSON Source