Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-189] Orientation Change gesture not working with SDK 3.1.2

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:52:17.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.4.0
ComponentsAndroid
Labelsandroid, event, gesture, listener
Reportermjfransen
AssigneeDon Thorp
Created2011-04-15T02:25:05.000+0000
Updated2011-04-17T01:52:17.000+0000

Description

I spent about two hours doing numerous tests and could not get it to work. I tried in the emulator and on my actual phone. Very frustrating.

Titanium.Gesture.addEventListener('orientationchange',function(e)
    {
       if (Titanium.Gesture.isLandscape(e.to))
       {
         document.getElementById("status").innerHTML = 'Stop Shaking me';   
       } 
       else if (Titanium.Gesture.isPortrait(e.to)) 
       {
         document.getElementById("status").innerHTML = 'Stop Shaking me';   
       }
    });

Comments

  1. Peter 2011-04-15

    Same running on HTC Desire. TITANIUM Version 1.3.0 and 1.3.2

    also not running in any version:

    Titanium.Gesture.addEventListener ('orientationchange', function ( e )
    {

       labelOnMainWindow.text = e.orientation;
       

    });

  2. Jeff Haynie 2011-04-15

    (from [ed11289d1258b673db8f4f27fc8e555399bd289a]) [#189 state:resolved] New @ContextSpecific annotation for module classes, to put their 'singletons' per context rather than per app. Apply to GestureModule to handle orientationchange listener not being called. http://github.com/appcelerator/titanium_mobile/commit/ed11289d1258b673db8f4f27fc8e555399bd289a"> http://github.com/appcelerator/titanium_mobile/commit/ed11289d1258b...

JSON Source