Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19878

Android: Ti.Gesture orientation change is not always fired

    Details

    • Sprint:
      2017 Sprint 21 SDK, 2017 Sprint 22 SDK, 2017 Sprint 23 SDK

      Description

      What happens:

      On first rotation no event is triggered. On every orientation change thereafter, the wrong orientation is returned. I have observed similar behavior on a physical device but I can not reproduce it consistently. In genymotion it happens every time.

      Note: The project must be an alloy project. The problem does not occur in a non alloy project. Orientation works correctly in TI SDK 4.0.0.GA

      How to reproduce:

      1. Create new Empty alloy project
      2. Set index.js to:

      function doClick(e) {
          alert($.label.text);
      }
       
      $.index.open();
       
      Ti.Gesture.addEventListener('orientationchange', gestureChange);
       
      function gestureChange(e) {
          console.log('orientation change...');
          console.log(e);
      }
      

      3. Start app in genymotion
      4. Output from console:

      First rotation results in no output. Next rotation back into Portrait results in the following:

      [INFO]  orientation change...
      [INFO]  {"type":"orientationchange","source":{"landscape":true,"bubbleParent":true,"orientation":2,"apiName":"Ti.Gesture","portrait":false,"_events":{"orientationchange":{}}},"orientation":2,"bubbles":false,"cancelBubble":false}
      

      Then rotating into Lanscape results in the following:

      [INFO]  orientation change...
      [INFO]  {"type":"orientationchange","source":{"landscape":false,"bubbleParent":true,"orientation":1,"apiName":"Ti.Gesture","portrait":true,"_events":{"orientationchange":{}}},"orientation":1,"bubbles":false,"cancelBubble":false}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                sschueller Stefan Schüller
                Reviewer:
                Gary Mathews
                Tester:
                Lokesh Choudhary
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20605
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code