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-15249] Android: TableView header and footer cannot be removed or resized dynamically #9193
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: PASS
TEST CASE
var win = Ti.UI.createWindow({backgroundColor: 'gray'}),
headerView = Ti.UI.createView({
backgroundColor: 'red',
height: 100,
width: Ti.UI.FILL
}),
footerView = Ti.UI.createView({
backgroundColor: 'green',
height: 100,
width: Ti.UI.FILL
}),
table = Ti.UI.createTableView({
headerView: headerView,
footerView: footerView,
data: [
{title: 'ITEM'}
]
});
setTimeout(function() {
table.headerView = null;
table.footerView = null;
}, 3000);
win.add(table);
win.open();
@garymathews When using the following test case: (https://jira.appcelerator.org/browse/TIMOB-15249)
I am able to close the headerView and footerView when pressing on green but I am unable to resize it when pressing on red. Test Environement |
@garymathews @drauggres So it sounds like this PR supports explicitly removing or replacing the header/footer view, but not resizing it? Looking at the changes and the test case @ssjsamir mentions, do we need to hook any sort of listeners to the header/footer view to adjust to changes to some subset of it's properties (as here we adjust the height)? |
@sgtcoolguy, PR adds only removing support. I didn't find a way to inform TableView about header/footer height change. |
@garymathews , As this PR just adds support to remove the header & footer view & the ticket says resize as well. Is the PR complete & ready for an FR & closing ? |
Generated by 🚫 dangerJS |
@lokeshchdhry This PR should be fine. The ticket use case meant to have resizing (width = 0) as an alternative to removing it, but having the ability to remove it is an ideal solution. |
@hansemannn Actually in latest SDK we can't remove footer and header from tableView ("null |
@drauggres You can add the following unit-test and verify if it works already (may be linting/timeout errors on the initial draft): tests/ti.ui.tableview.addontest.js /*
* Appcelerator Titanium Mobile
* Copyright (c) 2015-Present by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/* eslint-env mocha */
/* global Ti */
/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions');
describe('Titanium.UI.TableView', function () {
it('Add and remove headerView/footerView ', function (finish) {
var win = Ti.UI.createWindow({ backgroundColor: 'gray' }),
headerView = Ti.UI.createView({
backgroundColor: 'red',
height: 100,
width: Ti.UI.FILL
}),
footerView = Ti.UI.createView({
backgroundColor: 'green',
height: 100,
width: Ti.UI.FILL
}),
table = Ti.UI.createTableView({
headerView: headerView,
footerView: footerView,
data: [
{ title: 'ITEM' }
]
});
win.addEventListener('open', function () {
table.headerView = null;
table.footerView = null;
finish();
});
win.add(table);
win.open();
});
}); NOTE: There currently is a addon-test for the table-view already, which I just migrated. Once #10057 is merged, you can commit your file. |
Removing works. I will add your test later ( |
@ssjsamir, please re-run the following header/footer resize test to verify that it was fixed. From looking at the posts, it's the only issue that we haven't confirmed fixed yet. Thanks. |
https://jira.appcelerator.org/browse/TIMOB-15249
[TIMOB-15249] unset headerView and footerView in tableView on android