Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25173] Android: Size/Fill layout conflicts are not handled the same as iOS and Windows

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-08-22T19:20:45.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 6.2.0
ComponentsAndroid
Labelsandroid, layout
ReporterJoshua Quick
AssigneeJoshua Quick
Created2017-08-15T23:15:42.000+0000
Updated2017-08-22T23:14:36.000+0000

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: - [^ListViewFillTest.js] - [^SizeFillConflictTest.js] - [^VerticalFillTest.js] - [^HorizontalFillTest.js] - [^HorizontalPinningTest.js] 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

FileDateSize
HorizontalFill-Bad.png2017-08-15T23:14:05.000+000072804
HorizontalFill-Good.png2017-08-15T23:14:05.000+000083435
HorizontalFillTest.js2017-08-15T23:11:14.000+00006942
HorizontalPinning-Bad.png2017-08-18T02:23:52.000+0000110986
HorizontalPinning-Good.png2017-08-18T02:23:52.000+0000111091
HorizontalPinningTest.js2017-08-18T02:23:52.000+00003592
ListViewFill-Bad.png2017-08-15T23:13:40.000+000023609
ListViewFill-Good.png2017-08-15T23:13:40.000+000028240
ListViewFillTest.js2017-08-15T23:10:11.000+0000611
SizeFillConflict-Bad.png2017-08-15T23:13:51.000+000022159
SizeFillConflict-Good.png2017-08-15T23:13:51.000+000025258
SizeFillConflictTest.js2017-08-15T23:10:36.000+0000611
VerticalFill-Bad.png2017-08-15T23:13:58.000+000024987
VerticalFill-Good.png2017-08-15T23:13:58.000+000029073
VerticalFillTest.js2017-08-15T23:11:02.000+00001414

Comments

  1. Joshua Quick 2017-08-16

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9320 PR (6.2.x): https://github.com/appcelerator/titanium_mobile/pull/9321
  2. Abir Mukherjee 2017-08-22

    Passed FR. PR merged. Changes are seen in SDK versions: 6.2.0.v20170822113609 7.0.0.v20170822142802

JSON Source