Project: titanium
Issue TIMOB-18283: iOS: ImageView repeatCount is not honored
Test Code {code:javascript} Titanium.UI.setBackgroundColor('#000'); var win2 = Titanium.UI.createWindow({ title:'Test', backgroundColor:'#fff', fullscreen:true, layout:'vertical' }); var theImages = [ 'images/campFire01.gif', 'images/campFire02.gif', 'images/campFire03.gif', 'images/campFire04.gif', 'images/campFire05.gif', 'images/campFire06.gif', 'images/campFire07.gif', 'images/campFire08.gif', 'images/campFire09.gif', 'images/campFire10.gif', 'images/campFire11.gif', 'images/campFire12.gif', 'images/campFire13.gif', 'images/campFire14.gif', 'images/campFire15.gif', 'images/campFire16.gif', 'images/campFire17.gif', ]; var container = Ti.UI.createView({height:Ti.UI.SIZE,top:20,layout:'horizontal',width:Ti.UI.SIZE}); var b1 = Ti.UI.createButton({title:'START',width:70}); var label = Ti.UI.createLabel({text:'Reverse:',left:10}); var sw = Ti.UI.createSwitch({value:false,left:10}); container.add(b1); container.add(label); container.add(sw); win2.add(container); var image2 = Titanium.UI.createImageView({ repeatCount:3, images: theImages, width:160, height:240, top:5, borderWidth:1, borderColor:'black' }); win2.add(image2); var checkIndex; var count; b1.addEventListener('click',function(e){ if(image2.animating == true) { image2.stop(); } else { image2.reverse = sw.value; if(image2.reverse == true) { checkIndex = 0; } else { checkIndex = theImages.length - 1; } count = 0; image2.start(); } }); var l2 = Ti.UI.createLabel({top:5}); var l3 = Ti.UI.createLabel({top:5}); win2.add(l2); win2.add(l3); image2.addEventListener('change',function(e){ l2.text = 'Showing Index '+e.index; if(e.index == checkIndex) { count++; l3.text = 'Completed Loop '+count; } }); image2.addEventListener('stop',function(e){ l3.text = 'STOPPED'; sw.enabled = true; b1.title = 'START'; }); image2.addEventListener('start',function(e){ l3.text = 'STARTED. Loop Count '+image2.repeatCount; sw.enabled = false; b1.title = 'STOP'; }); win2.open(); {code}
Story points: 8