Titanium JIRA Archive
Appcelerator Community (AC)

[AC-828] Tableview Android warnings

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2016-03-04T19:24:29.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterFlavio Lacerda
AssigneeShak Hossain
Created2016-03-02T18:14:23.000+0000
Updated2016-03-08T07:37:06.000+0000

Description

When you add rows,shows warning in the console. like this: ResourceType: For resource 0x01030206, entry index(518) is beyond type entryCount(1) When you are inserting a row it´s not a problem, but when you are scrolling, tablewview hangs. Happens mini freezes.. This is the same behave on production too. I think that seems that the problem is with the lazy loading on scroll. You can get the titanium doc example to show what i tried to explain. here it is: var tableData = []; var win = Ti.UI.createWindow({ backgroundColor: 'white' }); var table = Ti.UI.createTableView({ objName: 'table' }); for (var i = 0; i <= 20; i++){ var row = Ti.UI.createTableViewRow({ className: 'row', objName: 'row', leftImage : 0, rightImage : 0, touchEnabled: true, height: 100 }); var enabledWrapperView = Ti.UI.createView({ backgroundColor:'#008FD5', objName: 'enabledWrapperView', rowID: i, width: Ti.UI.FILL, height: '100%' }); var disabledWrapperView = Ti.UI.createView({ backgroundColor:'#A2E0FF', objName: 'disabledWrapperView', touchEnabled: false, width: 300, height: '80%' }); enabledWrapperView.add(disabledWrapperView); var label = Ti.UI.createLabel({ backgroundColor:'#313F48', color: 'white', objName: 'label', text: i, touchEnabled: false, left: 0, width: 200 }); disabledWrapperView.add(label); row.add(enabledWrapperView); tableData.push(row); } table.setData(tableData); /*table.addEventListener('swipe', function(e){ if (e.source && e.source.objName !== 'table'){ Ti.API.info('Row swiped: ' + e.source); Ti.API.info('Row swiped: ' + e.source.objName); Ti.API.info('Row ID : ' + e.source.rowID); } });*/ win.add(table); win.open(); Hope it helps..

Comments

  1. Flavio Lacerda 2016-03-02

    After reading i think that the problem is with function called "reIndexItems" on TiTableView.java. So i've made some tests and when you set the className the performance become very very very poor. I think it's related with this implementation. It´s for performance but it´s not good. Hope it helps.
  2. Sharif AbuDarda 2016-03-04

    Hello, I tested the sample code, I didn't observe any app freezes. The app seems to run smoothly. Tested with SDK 5.2.0.GA. Also there is no error in the output log. Thanks.
  3. Flavio Lacerda 2016-03-04

    Hello Sharif, Probably you are testing with genymotion. I don´t know why, but does not happen. I'm testing with my cell with android 5.1.0 and the problem happens. Tested on motorola X Force Android 6.0 and the problem happens too.. If you want, i can send a video. Regards.
  4. Sharif AbuDarda 2016-03-06

    Hello, I have again tested the sample code in actual device. I have tested with Android 4.4.2. I haven't observe any app freezes. The app seems to run smoothly. I would suggest updating your SDK to the latest one 5.2.0.GA. Yes, Please send a video which demonstrate your issue. Thanks.

JSON Source