Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5538] MobileWeb: Constants FACE_UP, FACE_DOWN, UPSIDE_PORTRAIT don't returned in orientationchange.orientation of Ti.Gesture module

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2018-04-04T23:57:43.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMobileWeb
Labelsn/a
ReporterMisha Vasko
AssigneeChris Barber
Created2011-06-27T05:35:55.000+0000
Updated2018-04-05T00:00:04.000+0000

Description

Constants FACE_UP, FACE_DOWN, UPSIDE_PORTRAIT don't returned in orientationchange.orientation of Ti.Gesture module.

Comments

  1. Misha Vasko 2011-06-28

    FACE_DOWN still not working.
  2. Misha Vasko 2011-06-28

       var win = Ti.UI.currentWindow;
       win.backgroundColor = '#EEE';
       
       var label = Ti.UI.createLabel({
       	text: '1. Rotate your device 90 degrees.\n 2. Shake your device',
       	fontSize: 20,
       	top: 40,
       	left: 30
       });
       
       var closeButton = Ti.UI.createButton({
       	title:'Close Window',
       	height:50,
       	width:140,
       	fontSize: 16,
       	top:200,
       	left:90
       });
       
       closeButton.addEventListener('click', function(){
       	Ti.Gesture.removeEventListener('orientationchange',orientChange);
       	Ti.Gesture.removeEventListener('shake',shaking);
       	Titanium.UI.currentWindow.close();
       });
       
       win.add(closeButton);
       win.add(label);
       function orientChange(e){
       	var orientName = '';
       	switch(e.orientation){
       		case 1:{
       		orientName = 'FACE_DOWN';
       		break}
       		case 2:{
       		orientName = 'FACE_UP';
       		break}
       		case 3:{
       		orientName = 'PORTRAIT';
       		break}
       		case 4:{
       		orientName = 'UPSIDE_PORTRAIT';
       		break}
       		case 5:{
       		orientName = 'LANDSCAPE_LEFT';
       		break}
       		case 6:{
       //		orientName = 'LANDCAPE_RIGHT';
       		orientName = e.orientation;
       		break}
       		default: {
       		orientName = e.orientation;
       		}
       	}
       	
       	alert('Your orientation is '+ orientName);
       };
       
       function shaking(){
       	alert('You are shaking your device!');
       };
       Ti.Gesture.addEventListener('orientationchange',orientChange);
       Ti.Gesture.addEventListener('shake',shaking);
       
       
  3. Maxim Negadaylov 2011-06-29

    Works on iPhone. On Android does not.
  4. Eric Merriman 2018-04-04

    Closing as will not fix
  5. Eric Merriman 2018-04-05

    Closing as will not fix

JSON Source