[TIMOB-25626] Android: ScrollableView Ti.UI.SIZE is ignored for width
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-09T21:29:32.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | ScrollableView, android, parity |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2017-12-23T03:41:30.000+0000 |
Updated | 2018-06-12T18:49:15.000+0000 |
Description
*Summary:*
Setting a ScrollableView's width to Ti.UI.SIZE doesn't shrink the container to fit the currently displayed view/page. It always does an equivalent to Ti.UI.FILL instead.
(This works on iOS.)
*Steps to Reproduce:*
Build and run the below code on Android.
Notice that the gray ScrollableView container completely fills the window width-wise.
Scroll to the right until you see the purple view.
Notice the gray ScrollableView's width never changes. It always fills the window.
var window = Ti.UI.createWindow();
var scrollableView = Ti.UI.createScrollableView(
{
views:
[
Ti.UI.createView({ backgroundColor: "orange", width: "25dp", height: "25dp" }),
Ti.UI.createView({ backgroundColor: "red", width: "75dp", height: "75dp" }),
Ti.UI.createView({ backgroundColor: "green", width: "150dp", height: "150dp" }),
Ti.UI.createView({ backgroundColor: "blue", width: "225dp", height: "225dp" }),
Ti.UI.createView({ backgroundColor: "purple", width: "300dp", height: "300dp" }),
],
showPagingControl: true,
//cacheSize: 5,
backgroundColor: "gray",
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
});
window.add(scrollableView);
window.open();
*Expected Result:*
Width of the ScrollableView should change to just-fit its child view contents.
Attachments
File | Date | Size |
---|---|---|
Android-bad.png | 2018-05-03T23:25:44.000+0000 | 37813 |
Android-good1.png | 2018-05-03T23:25:44.000+0000 | 41299 |
Android-good2.png | 2018-05-03T23:25:44.000+0000 | 44714 |
Android-good3.png | 2018-05-03T23:25:44.000+0000 | 50422 |
Android-good4.png | 2018-05-03T23:25:44.000+0000 | 52046 |
Android-good5.png | 2018-05-03T23:25:44.000+0000 | 47353 |
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9696
FR Passed. Waiting for merger to be enabled.
PR Merged.
Closing ticket. Fix can be seen in SDK Version: 7.3.0.v20180607210411 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/9696