[TIMOB-13401] iOS 6: insertRowBefore uses animation with animated set to false and animationStyle set to none
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-09-14T09:10:07.000+0000 |
Affected Version/s | Release 3.0.2, Release 3.1.0 |
Fix Version/s | Release 5.1.0 |
Components | iOS |
Labels | animation, tableview |
Reporter | Markus Wutzler |
Assignee | Hans Knöchel |
Created | 2012-12-06T10:24:14.000+0000 |
Updated | 2015-11-05T21:39:28.000+0000 |
Description
*Description*
insertRowBefore uses a fade animation although animated is set to false and animationStyle is set to NONE (see code sample)
*Expected result*
row is simply inserted without an animation
*current result*
row is inserted with fade animation
*additional notes*
might also apply to insertRowAfter and appendRow and deleteRow (not tested)
*sample*
/*
* Single Window Application Template:
* A basic starting point for your application. Mostly a blank canvas.
*
* In app.js, we generally take care of a few things:
* - Bootstrap the application with any data we need
* - Check for dependencies like device type, platform version or network connection
* - Require and open our top-level UI component
*
*/
//bootstrap and check dependencies
if (Ti.version < 1.8) {
alert('Sorry - this application template requires Titanium Mobile SDK 1.8 or later');
}
// This is a single context application with mutliple windows in a stack
(function() {
//determine platform and form factor and render approproate components
var win = Ti.UI.createWindow({
width : Ti.UI.FILL,
height : Ti.UI.FILL,
});
var tv = Ti.UI.createTableView({
width : Ti.UI.FILL,
height : Ti.UI.FILL,
});
var rows = [];
for (var i = 0; i < 50; i++) {
rows.push(Ti.UI.createTableViewRow({
title : 'Row ' + i
}));
}
var row = Ti.UI.createTableViewRow({
title : 'Insert Row Before 0'
});
row.addEventListener('click', function() {
tv.insertRowBefore(0, {
title : 'Row inserted before 0'
});
});
rows.push(row);
var row = Ti.UI.createTableViewRow({
title : 'Insert Row Before 1'
});
row.addEventListener('click', function() {
tv.insertRowBefore(1, {
title : 'Row inserted before 1 w/o anim'
}, {
animationStyle : Ti.UI.iPhone.RowAnimationStyle.NONE
});
});
rows.push(row);
var row = Ti.UI.createTableViewRow({
title : 'Insert Row Before this'
});
row.addEventListener('click', function(e) {
tv.insertRowBefore(e.index, {
title : 'Row inserted before 0'
});
});
rows.push(row);
var row = Ti.UI.createTableViewRow({
title : 'Insert Row Before this'
});
row.addEventListener('click', function(e) {
tv.insertRowBefore(e.index, {
title : 'Row inserted before w/o anim'
}, {
animationStyle : Ti.UI.iPhone.RowAnimationStyle.NONE,
animated : false,
});
});
rows.push(row);
tv.data = rows;
win.add(tv);
win.open();
})();
it seems that also insertRowAfter is affected and that animation properties are ignored at all. i tried also bottom and top for insertRowBefore and insertRowAfter and it always looks the same
Tested and confirmed iOS 6 simulator, 3.0.2 GA, latest 3.1 master
PR pending: https://github.com/appcelerator/titanium_mobile/pull/7170
APPROVED! PR merged.
Verified fixed, using: MacOS 10.11.2 (15C31f) Studio 4.4.0.201511040454 Ti SDK 5.1.0.v20151104190037 Appc NPM 4.2.1 Appc CLI 5.1.0-42 Ti CLI 5.0.5 Alloy 1.7.23 Arrow 1.3.18 Xcode 7.2 (7C46t) Node v0.12.7 Java 1.7.0_80 production Tested with above sample code and minor modifications to cover additional cases. Rows added using the animationStyle of NONE or with animated set to false do not have an animation.