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

Android: Size/Fill layout conflicts are not handled the same as iOS and Windows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 3.3.0
    • Fix Version/s: Release 6.2.0
    • Component/s: Android
    • Labels:
    • Sprint:
      2017 Sprint 17 SDK

      Description

      Summary:
      Android does not resolve a parent Ti.UI.SIZE and child Ti.UI.FILL conflict in the same manner as iOS and Windows Phone. The issue is that the parent wants to auto-size itself based on the child and the child wants to auto-size itself based on the parent. iOS and Windows resolves this by increasing the size of the child to fit the parent's parent. Android resolves this by shrinking the parent to just-fit the child's minimum size. Android should be changed to match iOS and Windows' behavior for portability.

      Cause:
      Titanium uses the Android MATCH_PARENT setting for Ti.UI.FILL. Unfortunately, the native Android behavior does not match iOS and Windows's behavior. Because of this, we cannot use this setting.

      Work-Around:
      Instead of using Ti.UI.FILL, you can use "100%" instead for vertical and composite layouts. However, this work-around will not work well in a horizontal layout if their are multiple views on the same row.

      Tests to reproduce:
      Please see the attached JavaScript files for testing:

      There are also attached screenshots for each test script above. The "Bad" screenshots show the buggy behavior on Android. The "Good" screenshots are the expected results.

        Attachments

        1. HorizontalFill-Bad.png
          HorizontalFill-Bad.png
          71 kB
        2. HorizontalFill-Good.png
          HorizontalFill-Good.png
          81 kB
        3. HorizontalFillTest.js
          7 kB
        4. HorizontalPinning-Bad.png
          HorizontalPinning-Bad.png
          108 kB
        5. HorizontalPinning-Good.png
          HorizontalPinning-Good.png
          108 kB
        6. HorizontalPinningTest.js
          4 kB
        7. ListViewFill-Bad.png
          ListViewFill-Bad.png
          23 kB
        8. ListViewFill-Good.png
          ListViewFill-Good.png
          28 kB
        9. ListViewFillTest.js
          0.6 kB
        10. SizeFillConflict-Bad.png
          SizeFillConflict-Bad.png
          22 kB
        11. SizeFillConflict-Good.png
          SizeFillConflict-Good.png
          25 kB
        12. SizeFillConflictTest.js
          0.6 kB
        13. VerticalFill-Bad.png
          VerticalFill-Bad.png
          24 kB
        14. VerticalFill-Good.png
          VerticalFill-Good.png
          28 kB
        15. VerticalFillTest.js
          1 kB

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Gary Mathews
                Tester:
                Abir Mukherjee
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code