Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25626] Android: ScrollableView Ti.UI.SIZE is ignored for width

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-05-09T21:29:32.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 7.3.0
ComponentsAndroid
LabelsScrollableView, android, parity
ReporterJoshua Quick
AssigneeJoshua Quick
Created2017-12-23T03:41:30.000+0000
Updated2018-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

FileDateSize
Android-bad.png2018-05-03T23:25:44.000+000037813
Android-good1.png2018-05-03T23:25:44.000+000041299
Android-good2.png2018-05-03T23:25:44.000+000044714
Android-good3.png2018-05-03T23:25:44.000+000050422
Android-good4.png2018-05-03T23:25:44.000+000052046
Android-good5.png2018-05-03T23:25:44.000+000047353

Comments

  1. Joshua Quick 2017-12-23

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9696
  2. Lokesh Choudhary 2018-05-05

    FR Passed. Waiting for merger to be enabled.
  3. Lokesh Choudhary 2018-05-09

    PR Merged.
  4. Samir Mohammed 2018-06-12

    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

JSON Source