[TIMOB-13109] Slider Events Parity
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-03-19T17:43:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.1.0, 2013 Sprint 06 API, 2013 Sprint 06 |
Components | TiAPI |
Labels | android, ios, listview, qe-testadded, slider |
Reporter | Vishal Duggal |
Assignee | Vishal Duggal |
Created | 2013-03-19T06:42:54.000+0000 |
Updated | 2013-04-22T18:35:53.000+0000 |
Description
Slider events have parity issues.
iOS fires touchstart and touchend on user initialted update but has no x and y values in the event.
Android fires undocumented stop event when UI update finishes.
iOS and Android are going to implement start and stop events (which will not bubble). Obvious use case is the updateItem API in the listView which should be done in the stop event.
Test Case
var win = Titanium.UI.createWindow({
backgroundColor : '#fff'
});
var slider = Ti.UI.createSlider({
min:0,
max:1,value:0.5,
width:'80%',
});
function handler(e){
Ti.API.info(e.type+' '+e.value+' '+e.bubbles);
}
slider.addEventListener('start',handler);
slider.addEventListener('change',handler);
slider.addEventListener('stop',handler);
win.add(slider);
win.open();
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3988
CR & FR
Verified implemented with the following configuration: Mac OS 10.8.3 SDK: 3.1.0.v20130329175112 Titanium Studio, build: 3.1.0.201303261815 CLI 3.0.25-alpha node-appc 1.0.29-alpha iPhone 5 iOS 6.0 Nexus 4 OS 4.2.1 One question is the ordering of events on the iOS side. I was not expecting the following sequence: Change -> start -> many changes -> stop. On Android it's simply start -> changes -> stop. Is this expected? Here is additional info: Android:
iOS: Note the first event
Its just iOS notifying us of a change in value before notifying us that UI interaction has started. Nothing to do with our implementation. Expected behavior.