Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-24560] Android: Prevent duplicate TableViewRowProxyItem on Android 7.0 #8948

Merged
merged 4 commits into from
May 24, 2017

Conversation

garymathews
Copy link
Contributor

  • On Android 7.0 getView() re-uses previous TableViewRowProxyItem instances
  • Prevent duplicate TableViewRowProxyItem from occuring
TEST CASE
var win = Ti.UI.createWindow({
        backgroundColor: 'white',
        layout: 'vertical'
    }),
    tableData = [{
        title: 'Apples',
        color: 'black'
    }, {
        title: 'Bananas',
        color: 'black'
    }, {
        title: 'Carrots',
        color: 'black'
    }, {
        title: 'Potatoes',
        color: 'black'
    }],
    table = Ti.UI.createTableView({
        minRowHeight: 50,
        data: tableData,
        width: Ti.UI.FILL,
        height: Ti.UI.SIZE
    });
table.addEventListener('click', function(e) {
    alert('index: ' + e.index);
});
win.add(table);
win.open();

JIRA Ticket

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it and it works.

I am concerned that this will cause a performance issue with TableViews having a lot of rows (it has an O(n^2) complexity now), but we can deal with that later if it ever comes up.

@longton95 longton95 self-requested a review May 23, 2017 14:56
Copy link
Contributor

@longton95 longton95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR passed.

Tested using the test case above, there is no longer duplicate index data and the correct index is returned.

ENV

SDK Version : Local 6.2.0
Mac OS Version : 10.12.4
Appc CLI : 6.2.1
Appc NPM : 4.2.9
Node : v6.10.3
Device: Nexus 5x(6.0.1), Pixel XL(7.1.2)
Emulator: (7.0), (6.0), (4.4.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants