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

iOS: e.orientation always returns 5 for landscape to FACE_UP and portrait to FACE_UP.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
    • Environment:
    • Story Points:
      0
    • Sprint:
      2018 Sprint 08 SDK

      Description

      Basically, need to maintain the onset of UI when we in portrait and move up & down. Also another set of UI when are in landscape and move up&down.

      Eg:
      if( e.orientation === Ti.UI.PORTRAIT && e.orientation === Titanium.UI.FACE_UP)

      { updateUI(); }

      Also,

      if( (e.orientation === Ti.UI.LANDSCAPE_LEFT || e.orientation === Ti.UI.LANDSCAPE_RIGHT) && e.orientation === Titanium.UI.FACE_UP)

      { updateUI() }

      But it does not work.

      Test Code:

      Ti.Gesture.addEventListener('orientationchange', function(e) {
       
      	if (e.orientation == Titanium.UI.FACE_DOWN) {
       
      		Ti.API.info("ORientation_FACE_DOWN:" + e.orientation);
       
      	} else if (e.orientation == Titanium.UI.FACE_UP) {
       
      		Ti.API.info("ORientation_FACE_UP:" + e.orientation);
       
      	} else if (e.orientation == Titanium.UI.PORTRAIT) {
      		Ti.API.info("ORientation_PORTRAIT:" + e.orientation);
       
      	} else if (e.orientation == Titanium.UI.UPSIDE_PORTRAIT) {
      		Ti.API.info("ORientation_UPSIDE_PORTRAIT:" + e.orientation);
       
      	} else if (e.orientation == Titanium.UI.LANDSCAPE_LEFT) {
      		Ti.API.info("ORientation_LANDSCAPE_LEFT:" + e.orientation);
       
      	} else if (e.orientation == Titanium.UI.LANDSCAPE_RIGHT) {
      		Ti.API.info("ORientation_LANDSCAPE_RIGHT:" + e.orientation);
       
      	} else {
      		Ti.API.info("ORientation_UNKNOWN:" + e.orientation);
       
      	}
       
      	if (e.orientation == Titanium.UI.PORTRAIT && e.orientation == Titanium.UI.FACE_UP) {
       
      	//issue is here: cannot detect this position
             Ti.API.info("ORientation_PORTRAIT_FACE_UP:" + e.orientation);
      	}
       
      	if ((e.orientation == Ti.UI.LANDSCAPE_LEFT || e.orientation == Ti.UI.LANDSCAPE_RIGHT) && e.orientation == Titanium.UI.FACE_UP) {
               //issue is here: cannot detect this position
      		Ti.API.info("ORientation_LANDSCAPE_:FACE_UP" + e.orientation);
      	}
       
      	
      });
      

      Thanks.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                topener Rene Pot
                Reporter:
                morahman Motiur Rahman
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code