[TIMOB-5538] MobileWeb: Constants FACE_UP, FACE_DOWN, UPSIDE_PORTRAIT don't returned in orientationchange.orientation of Ti.Gesture module
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Won't Fix |
| Resolution Date | 2018-04-04T23:57:43.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | MobileWeb |
| Labels | n/a |
| Reporter | Misha Vasko |
| Assignee | Chris Barber |
| Created | 2011-06-27T05:35:55.000+0000 |
| Updated | 2018-04-05T00:00:04.000+0000 |
Description
Constants FACE_UP, FACE_DOWN, UPSIDE_PORTRAIT don't returned in orientationchange.orientation of Ti.Gesture module.
FACE_DOWN still not working.
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);Works on iPhone. On Android does not.
Closing as will not fix
Closing as will not fix