[TIMOB-10109] MobileWeb: Only listen for deviceorientation event if explicitly listening for orientationchange event
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2017-05-01T22:35:44.000+0000 |
Affected Version/s | Release 2.1.1 |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | linvalid |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2012-07-23T23:26:06.000+0000 |
Updated | 2018-04-04T23:20:24.000+0000 |
Description
Ti.Gesture listens to deviceorientation which fires events dozens of times a second with the latest accelerometer information. If it detects a change, then it fires the orientationchange event. However, if we never listen to orientationchange, then we are wasting precious resources calculating orientation change that we don't care about.
This can be fixed by overriding addEventListener and removeEventListener and doing the deviceorientation event connect/disconnect on an as needed basis. Be sure to only listen once for the deviceorientation event!
We need to be careful though because the layout algorithm relies on this event to resize it's contents. If we make this change, we need to find a new way of detecting orientation changes, otherwise the layout will still be in the old orientation. Sadly, the orientation change events are unreliable on many devices.
I stand corrected, that code seems to have been removed at some point in time.
Resolving ticket as "Won't Fix" as MobileWeb is no longer supported.
Closing as will not fix.