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

fix(android): amend TableViewRow reuse #12620

Merged
merged 4 commits into from Mar 23, 2021
Merged

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Mar 18, 2021

  • Amend TableViewRow.clone() method to also clone child views
  • Amend TableView.setData() to reset existing TableViewSection parents
TEST CASE
  • Clicking a row should maintain child views
const win = Ti.UI.createWindow({
    backgroundColor: 'white'
});
const tableView = Ti.UI.createTableView();

function createRow(name, icon) {
    const row = Ti.UI.createTableViewRow({
        title: 'This text should not be visible.',
        color: 'black',
        layout: 'horizontal',
        height: 100
    });
    const label = Ti.UI.createLabel({
        text: name,
        color: 'red'
    });
    const image = Ti.UI.createImageView({
        image: icon,
        height: 100,
        width: 100
    });

    row.add([label, image]);

    return row;
}

const data = [
    createRow('Apple', 'https://garymathews.com/test.png'),
    createRow('Pear', 'https://garymathews.com/test.png')
];

tableView.data = data;

tableView.addEventListener('click', e => {
    tableView.data = data;
});

win.add(tableView);
win.open();

JIRA Ticket

@garymathews garymathews added android bug no tests backport 9_3_X backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge labels Mar 18, 2021
@garymathews garymathews added this to the 10.1.0 milestone Mar 18, 2021
@build build requested a review from a team March 18, 2021 18:14
@build
Copy link
Contributor

build commented Mar 18, 2021

Fails
🚫

Test suite crashed on iOS simulator. Please see the crash log for more details.

Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 7742 tests are passing.
(There are 513 skipped tests not included in that total)

Generated by 🚫 dangerJS against 898001c

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.

CR: Pass

@lokeshchdhry
Copy link
Contributor

FR Passed.
TableView child views are preserved now.

@sgtcoolguy sgtcoolguy merged commit af3a091 into tidev:master Mar 23, 2021
@build build removed the backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge label Mar 23, 2021
@build
Copy link
Contributor

build commented Mar 23, 2021

The backport to 9_3_X failed:

The process 'git' failed with exit code 128

Check the run for full details
To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Check out the target branch
git checkout 9_3_X
# Make sure it's up to date
git pull
# Check out your branch
git checkout -b backport-12620-to-9_3_X
# Apply the commits from the PR
curl -s https://github.com/appcelerator/titanium_mobile/commit/3a82b7e45923c20595ca80eec49abf02eea601c6.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/a2408daa026740044f9fbcc599bbf7825dc71126.patch | git am -3 --ignore-whitespace
# Push it to GitHub
git push --set-upstream origin backport-12620-to-9_3_X

Then, create a pull request where the base branch is 9_3_X and the compare/head branch is backport-12620-to-9_3_X.

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.

None yet

5 participants