Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orientation Modes - prevent Landscape? #25

Closed
martintietz opened this issue Nov 18, 2013 · 7 comments · Fixed by #27
Closed

Orientation Modes - prevent Landscape? #25

martintietz opened this issue Nov 18, 2013 · 7 comments · Fixed by #27

Comments

@martintietz
Copy link

Is there a way to prevent the app from going into Titanium.UI.LANDSCAPE_LEFT and Titanium.UI.LANDSCAPE_RIGHT mode? Unfortunately, assigning orientationModes = [Titanium.UI.PORTRAIT, Titanium.UI.UPSIDE_PORTRAIT] to leftWindow, centerWindow, rightWindow does not lead to success.

@atypical
Copy link

The issue you're having doesn't have anything to do with this Module. You set your supported orientation modes in your tiapp.xml file like so - http://d.pr/i/jtvC

Please read the appcelerator documentation - http://docs.appcelerator.com/titanium/3.0/#!/guide/Orientation - they're extensive and very helpful.

@martintietz
Copy link
Author

Thanks for the link, but I tried that already, of course ;) Removing

<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>

from tiapp.xml does not prevent the drawer and its contents from switching to a landscape mode.

My use case is the following: I want to prevent any landscape mode for everything inside the Drawer (center window and sidebars). But I also want to be able to open a new window (e.g. a videoplayer) and allow landscape modes for this specific window. Is this possible using this module?

@atypical
Copy link

Well, removing those from your tiapp file should inhibit your app from rotating to either of those orientations completely. Have you tried cleaning your build after updating your tiapp file?

@martintietz
Copy link
Author

Yes, I ran titanium clean before rebuilding the project - no change. I even tried the app.js from the module's example directory. The app rotates, no matter what the orientation settings are.

@martintietz
Copy link
Author

After some digging into the module's source code I noticed that there is an undocumented parameter orientationModes that can be used inside createDrawer(). There is also a setter method.
Worth a mention inside the docs :)

@atypical
Copy link

Nice find! Put in a pull request with an updated readme and or example app.js and I'm sure @viezel would consider accepting it.

@viezel
Copy link
Owner

viezel commented Nov 25, 2013

super!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants