Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13109] Slider Events Parity

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-03-19T17:43:18.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, 2013 Sprint 06 API, 2013 Sprint 06
ComponentsTiAPI
Labelsandroid, ios, listview, qe-testadded, slider
ReporterVishal Duggal
AssigneeVishal Duggal
Created2013-03-19T06:42:54.000+0000
Updated2013-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();

Comments

  1. Vishal Duggal 2013-03-19

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/3988
  2. Sabil Rahim 2013-03-19

    CR & FR
  3. Eric Merriman 2013-03-30

    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:
       I/TiAPI   (23601):  start 0.5 false
       I/TiAPI   (23601):  change 0.5400000214576721 true
       I/TiAPI   (23601):  change 0.550000011920929 true
       I/TiAPI   (23601):  change 0.5600000023841858 true
       I/TiAPI   (23601):  change 0.5699999928474426 true
       I/TiAPI   (23601):  change 0.5799999833106995 true
       I/TiAPI   (23601):  change 0.5899999737739563 true
       I/TiAPI   (23601):  change 0.6000000238418579 true
       I/TiAPI   (23601):  change 0.6100000143051147 true
       I/TiAPI   (23601):  change 0.6200000047683716 true
       I/TiAPI   (23601):  change 0.6299999952316284 true
       I/TiAPI   (23601):  change 0.6399999856948853 true
       I/TiAPI   (23601):  change 0.6499999761581421 true
       I/TiAPI   (23601):  change 0.6600000262260437 true
       I/TiAPI   (23601):  stop 0.6600000262260437 false
       
    iOS: Note the first event
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.41416308283805847 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] start 0.41416308283805847 false
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.42489269375801086 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.42918455600738525 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.43562230467796326 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.44206008315086365 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.45064377784729004 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.45708155632019043 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.46566522121429443 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.4742489159107208 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.4806866943836212 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.4892703890800476 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.495708167552948 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5021459460258484 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.508583664894104 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5150214433670044 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5214592218399048 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5257510542869568 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5300429463386536 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5321888327598572 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5343347787857056 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5364806652069092 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.540772557258606 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5429184436798096 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5472102761268616 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5515021681785583 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.557939887046814 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5643776655197144 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5729613900184631 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5815450549125671 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5901287794113159 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.5987124443054199 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6051502227783203 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6158798336982727 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6223176121711731 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6309012770652771 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6373390555381775 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6416308879852295 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6437768340110779 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6459227204322815 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6480686664581299 true
       ��Mar 30 10:28:21 Titan timob13109[771] <Warning>: [INFO] change 0.6502146124839783 true
       ��Mar 30 10:28:22 Titan timob13109[771] <Warning>: [INFO] change 0.6523604989051819 true
       ��Mar 30 10:28:22 Titan timob13109[771] <Warning>: [INFO] stop 0.6523604989051819 false
       
  4. Vishal Duggal 2013-04-01

    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.

JSON Source