Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10109] MobileWeb: Only listen for deviceorientation event if explicitly listening for orientationchange event

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2017-05-01T22:35:44.000+0000
Affected Version/sRelease 2.1.1
Fix Version/sn/a
ComponentsMobileWeb
Labelslinvalid
ReporterChris Barber
AssigneeChris Barber
Created2012-07-23T23:26:06.000+0000
Updated2018-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!

Comments

  1. Bryan Hughes 2012-07-24

    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.
  2. Bryan Hughes 2012-07-24

    I stand corrected, that code seems to have been removed at some point in time.
  3. Lee Morris 2017-05-01

    Resolving ticket as "Won't Fix" as MobileWeb is no longer supported.
  4. Eric Merriman 2018-04-04

    Closing as will not fix.

JSON Source