[TIMOB-25667] Android: Add TableView "scrollable" property support
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-09T22:39:51.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | TableView, android, parity |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2018-01-13T02:37:31.000+0000 |
Updated | 2018-06-21T16:32:43.000+0000 |
Description
*Summary:*
A TableView on iOS supports a "scrollable" property which can enable/disable touch scrolling by the end-user. We should add support on Android as well for parity.
_(Note: Android ListViews already supports a similar feature.)_
*Test:*
var window = Ti.UI.createWindow();
var tableData = [];
for (var index = 1; index <= 100; index++) {
var row = Ti.UI.createTableViewRow({ title: "Row " + index.toString() });
tableData.push(row);
}
var tableView = Ti.UI.createTableView(
{
data: tableData,
scrollable: true,
});
window.add(tableView);
function createButtonText() {
return tableView.scrollable ? "Disable Scrolling" : "Enable Scrolling";
}
var button = Ti.UI.createButton(
{
title: createButtonText(),
right: "5dp",
bottom: "5dp",
});
button.addEventListener("click", function(e) {
tableView.scrollable = !tableView.scrollable;
// tableView.setScrollable(!tableView.getScrollable());
button.title = createButtonText();
});
window.add(button);
window.open();
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9728
PR (7.1.x): https://github.com/appcelerator/titanium_mobile/pull/9836
7.1.X PR https://github.com/appcelerator/titanium_mobile/pull/9836 --- Closed.
FR Passed. Waiting for merger to be enabled.
PR Merged.
Closing ticket. Improvement can be seen in SDK Version: 7.3.0.v20180618182516 Test and other information can found at: https://github.com/appcelerator/titanium_mobile/pull/9728