Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14011] BlackBerry: Implement the 'isLandscape' method in gestures

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-06-11T11:42:37.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 12 BB, 2013 Sprint 12, Release 3.1.2, Release 3.2.0
ComponentsBlackBerry
Labelsblackberry, module_orientation, qe-3.3.0, qe-testadded, sdk-bb
ReporterLokesh Choudhary
AssigneePedro Enrique
Created2013-05-28T21:26:29.000+0000
Updated2014-06-11T18:58:33.000+0000

Description

We had a community developer asking for isLandscape property of gestures on the blackberry google groups.

Comments

  1. Pedro Enrique 2013-06-17

    PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/107
  2. Pedro Enrique 2013-06-17

    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();
       
  3. Olga Romero 2014-05-28

    Mac osx 10.9.3 Mavericks Appcelerator Studio, build: 3.3.0.201405271647 Titanium SDK, build: 3.3.0.v20140524224144 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-beta npm@1.3.2 titanium@3.3.0-beta titanium-code-processor@1.1.1 Device: BB Z10 (10.2.1) alert "is portrait" only, disregarding the orientation
  4. Pedro Enrique 2014-06-03

    The native code is correct:
       	bb::device::DeviceInfo info;
       	bb::device::DeviceOrientation::Type orientation = info.orientation();
       	if(orientation == bb::device::DeviceOrientation::TopUp || orientation == bb::device::DeviceOrientation::BottomUp)
       	{
       		return Boolean::New(true);
       	}
       	return Boolean::New(false);
       
    For some reason it always returns "bb::device::DeviceOrientation::TopUp" Investigating with BB at the moment.
  5. Ingo Muschenetz 2014-06-11

    Update here?
  6. Pedro Enrique 2014-06-11

    PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/264
  7. Olga Romero 2014-06-11

    Add to tiapp.xml
       <blackberry>
           <orientation>auto</orientation>
       </blackberry>
       
    Tested and verified fixed with: Mac osx 10.9.3 Mavericks Appcelerator Studio, build: 3.3.0.201406061445 Titanium SDK, build: 3.3.0.v20140611084912 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-beta npm@1.3.2 titanium@3.3.0-beta2 titanium-code-processor@1.1.1 Device: BB Z10 (10.2.1)

    Actual result

    the alert corresponding to orientation

JSON Source