[TIMOB-13868] Android: ScrollableView pages within ListView not displayed correctly
GitHub Issue | n/a |
---|---|
Type | Sub-task |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-11-07T22:29:56.000+0000 |
Affected Version/s | Release 3.1.0, Release 3.2.0 |
Fix Version/s | 2013 Sprint 23, 2013 Sprint 23 API, Release 3.2.0 |
Components | Android |
Labels | n/a |
Reporter | Philippe Wueger |
Assignee | Hieu Pham |
Created | 2013-05-14T08:13:40.000+0000 |
Updated | 2017-03-22T00:16:26.000+0000 |
Description
*Problem*
The pages of a ScrollableView are not drawn correctly when placed within a ListView.
*Steps to reproduce*
1. Launch the app with the code below.
2. Scroll to the third page on the ScrollableView.
3. Problem: The third page is not displayed (no green background is shown). (The first two pages are displayed correctly).
4. Scroll back to the first page. Problem: This page is now also not displayed anymore.
5. Scroll down the list, so that the ScrollableView leaves the screen.
6. Scroll up again. The first page of the ScrollableView is now displayed correctly again.
Note: Scrolling the ScrollableView within the ListView works much better when the fix of issue TIMOB-13610 is used.
*Test Case*
var win = Ti.UI.createWindow();
var scrollableViewTemplate = {
childTemplates: [
{
type: 'Ti.UI.ScrollableView',
bindId: 'scrollableView',
properties: {
height: '200dp',
views: [
Ti.UI.createView({ backgroundColor: 'red'}),
Ti.UI.createView({ backgroundColor: 'blue'}),
Ti.UI.createView({ backgroundColor: 'green'})
]
}
}
]
};
var items = [
{ template: 'scrollableView'}
];
for ( var i = 0; i < 20; i++) {
items.push({ properties: { title: 'Item', height: '50dp'}});
}
var section = Ti.UI.createListSection({
items: items
});
var listView = Ti.UI.createListView({
templates: {
'scrollableView': scrollableViewTemplate
},
sections: [ section ]
});
win.add(listView);
win.open();
Hi Philippe, Please take a look at TIMOB-13610, I believe it's the same issue. Would be even better if you could try out the pull request if you know how to build Titanium. Thanks.
Hi Daniel Thanks for looking into this. This issue is not the same as the one described in TIMOB-13610. TIMOB-13610 is regarding the scrolling behavior of a ScrollableView within a ListView/TableView/ScrollView (how the scrolling is affected by the user touching the screen). This issue here is about the problem that, after scrolling to a new page, the view within the scrolled in page does not appear at all. Also, the issue here only occurs in a ListView, but does not occur in a TableView. With regards to the pull request from TIMOB-13610: I have tested it with TableViews and ListViews and it works very good. Regards, Philippe
The problem seems to be caused by the ListViewWrapper onLayout Method in TiListView.java. If I change this:
to this:
the issue goes away. However, at the moment I do not know what the side effects are from this change. So this still needs to be checked.
master PR: https://github.com/appcelerator/titanium_mobile/pull/4928
Closing ticket as fixed.