Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2029] Windows Orientation Mode Faceup/down

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-01-01T23:15:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterBaharroth
AssigneeShak Hossain
Created2013-12-05T10:02:34.000+0000
Updated2016-03-08T07:40:58.000+0000

Description

Steps to Reproduce

I try with Alloy : -Do a window -In TSS put orientationModes = [ Titanium.UI.PORTRAIT, Titanium.UI.UPSIDE_PORTRAIT, Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT ]; Add a Gesture eventListener to know the orientation. Check the event of 'orientationchange' and see that faceup and down event are lunch even if we forbid those orientation in TSS. We can create some workaround but it will be good if you can fix that :) Regards

Actual Result

Face up and Down event are launched

Expected Result

Face up and Down event don't be launched because we force the orienation with orientationModes = [ Titanium.UI.PORTRAIT, Titanium.UI.UPSIDE_PORTRAIT, Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT ];

Attachments

FileDateSize
.log2013-12-05T10:03:37.000+00005315425
diagnostic855115633028829762.log2013-12-05T10:03:42.000+000010394

Comments

  1. Eric Wieber 2013-12-06

    Hello Baharroth, I will need some clarification on your issue. The orientationModes property should be set in your JS with your window code, not in your TSS. Also, the orientationchange event fires when the device orientation changes, not necessarily the window. If you are trying to prevent your app from being able to change to certain orientations, please take a look at this page: https://wiki.appcelerator.org/display/guides/Orientation#Orientation-Lockingapporientation These directions change a little depending on your device type. What devices are you trying this on? Could you please provide some sample code or your project so that I can reproduce the issue you are seeing? Additionally, here are some other helpful docs that explain the functions and events you reference: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Window-property-orientationModes http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Gesture-event-orientationchange
  2. Mostafizur Rahman 2013-12-31

    I tested this issue with the test code below. I can't reproduce this issue in latest Ti SDK (3.2.0.GA) and Alloy 1.3.0. Please check my test code and let me know if have any problem. If you are able to reproduce it using a different test case, please post it here. We will revisit it then.

    Test Environment:

    MAC OS X 10.8.5, Titanium SDK 3.2.0 GA Alloy 1.3.0, Ti CLI 3.2.0

    Test Code

    index.js
       $.index.open();
       Ti.Gesture.addEventListener('orientationchange', function(e) {
       
       	alert(getOrientation(e.orientation));
       
       });
       
       function getOrientation(o) {
       	switch (o) {
       		case Titanium.UI.PORTRAIT:
       			return 'portrait';
       		case Titanium.UI.UPSIDE_PORTRAIT:
       			return 'upside portrait';
       		case Titanium.UI.LANDSCAPE_LEFT:
       			return 'landscape left';
       		case Titanium.UI.LANDSCAPE_RIGHT:
       			return 'landscape right';
       		case Titanium.UI.FACE_UP:
       			return 'face up';
       		case Titanium.UI.FACE_DOWN:
       			return 'face down';
       		case Titanium.UI.UNKNOWN:
       			return 'unknown';
       	}
       }
       
       alert(getOrientation($.index.orientation));
       
       
    index.xml
       <Alloy>
       	<Window class="container">
       		<View>
       			<Label id="label">
       				This is label
       			</Label>
       		</View>
       	</Window>
       </Alloy>
       
    index.tss
       "Window": {
       backgroundColor:"white",
       orientationModes :[
       Titanium.UI.PORTRAIT,
       Titanium.UI.UPSIDE_PORTRAIT,
       Titanium.UI.LANDSCAPE_LEFT,
       Titanium.UI.LANDSCAPE_RIGHT
       ]
       } 
       
    Thanks

JSON Source