[TIMOB-992] Shake gesture not implemented
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:54.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M06 |
Components | Android |
Labels | accelerometer, android, feature, refactor, release-1.6.0, shake |
Reporter | Bill Dawson |
Assignee | Don Thorp |
Created | 2011-04-15T02:41:00.000+0000 |
Updated | 2011-04-17T01:54:54.000+0000 |
Description
See #116 for 0.8x issues with Android shake - maybe interesting.
Attachments
File | Date | Size |
---|---|---|
app.js | 2011-04-15T02:41:01.000+0000 | 1947 |
gesture.zip | 2011-04-15T02:41:02.000+0000 | 4194195 |
Refactor of TiSensorHelper, TiCompass, GestureModule and AccelerometerModule. Major thing to note is that the accelerometer listeners (GestureModule 'shake' event, Accelerometer 'update' event and Geolocation 'heading' event) will need to manually be removed when the app is paused or exited otherwise the accelerometer will be attached and sending events as long as the app is running in the background.
This change also partially addresses #1386
Test app for this this change is attached. In order to verify shake event, click 'Attach Shake' and then shake the device for a few seconds. The event should be noted in the yellow status bar and in the trace log.
(from [0351c2ba9989eda352e6067d8df57d7747675ae4]) [#992 state:fixed-in-qa] shake event implemented in gesture module
Refactor of GestureModule, AccelerometerModule, TiSensorHelper and TiCompass to support shake event. Also added support for accelerometer to remain active even when the app is running in the background.
https://github.com/appcelerator/titanium_mobile/commit/0351c2ba9989eda352e6067d8df57d7747675ae4"> https://github.com/appcelerator/titanium_mobile/commit/0351c2ba9989...
Including an updated test that will actually turn on/off the accelerometer based on resume/pause.
Reminder, please add the configuration parameters to this ticket.
Configuration params that can be added to the tiapp.xml to tweak the shake behavior:
ti.android.shake.factor (double)
ti.android.shake.quiet.milliseconds (int)
ti.android.shake.active.milliseconds (int)
Verified on G1/1.6 and Nexus One/2.2.1 using build #e1cb22a
we may want to tune this more before it goes out. Active seems too long.