Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25626

Android: ScrollableView Ti.UI.SIZE is ignored for width

    Details

    • Story Points:
      5
    • Sprint:
      2018 Sprint 05 SDK, 2018 Sprint 04 SDK

      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:

      1. Build and run the below code on Android.
      2. Notice that the gray ScrollableView container completely fills the window width-wise.
      3. Scroll to the right until you see the purple view.
      4. 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

        1. Android-bad.png
          Android-bad.png
          37 kB
        2. Android-good1.png
          Android-good1.png
          40 kB
        3. Android-good2.png
          Android-good2.png
          44 kB
        4. Android-good3.png
          Android-good3.png
          49 kB
        5. Android-good4.png
          Android-good4.png
          51 kB
        6. Android-good5.png
          Android-good5.png
          46 kB

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Gary Mathews
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-6060
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code