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

[TIMOB-14011] Added isLandscape, isPortrait, isFaceDown, and isFaceUp #107

Merged
merged 2 commits into from Jun 27, 2013

Conversation

pec1985
Copy link
Contributor

@pec1985 pec1985 commented Jun 17, 2013

Sample code:

var win = Titanium.UI.createWindow({
    orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT, Ti.UI.PORTRAIT]
});

var btn = Ti.UI.createButton({
    title: 'orientation test'
});

btn.addEventListener('click', function(){
    if(Ti.Gesture.isPortrait()) {
        alert('is portrait');
    } else if(Ti.Gesture.isLandscape()){
        alert('is landscape');
    } else if(Ti.Gesture.isFaceUp()){
        alert('is face up');
    } else if(Ti.Gesture.isFaceDown()){
        alert('is face down');
    } else {
        alert('is unknown');
    }
});

win.add(btn);

win.open();

@mtnlife999
Copy link
Contributor

looks good - pull request accepted

mtnlife999 pushed a commit that referenced this pull request Jun 27, 2013
[TIMOB-14011] Added isLandscape, isPortrait, isFaceDown, and isFaceUp
@mtnlife999 mtnlife999 merged commit 49930fe into appcelerator-archive:master Jun 27, 2013
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 this pull request may close these issues.

None yet

2 participants