New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TIMOB-7836: Allow fill behavior for horiztonal and veritcal layouts #1659
Conversation
Forgot to add a drillbit test to this. Will update this PR with drillbit tests soon. |
@@ -316,7 +316,7 @@ protected void constrainChild(View child, int width, int wMode, int height, int | |||
childDimension = p.optionWidth.getAsPixels(this); | |||
} | |||
} else { | |||
if (p.autoFillsWidth && !isHorizontalArrangement()) { | |||
if (p.autoFillsWidth) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not see code where width is undefined and can not be calculated from pins (follow auto behavior) or auto where the default auto behavior if fill. Are these flags set up somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some code clean up to make the logic more clear. I renamed two methods to calculateHeightFromPins() and calculateWidthFromPins() inside onLayout() which takes care of the calculation. We essentially do the calculation for fill/size in constrainChild() and then we determine if we want to use those calculations in calculateHeightFromPins(). If we can't calculate from the pins, then we use the default size/fill behavior (passed in as measuredHeight).
…e into timob-7836
No additional comments. Please address Vishal's comment |
I added comments to make the code more clear. I also added a drillbit test. When doing functional testing, please run the ui.layout test in drillbit. |
// Set auto width/height to false to trigger undefined behavior | ||
layoutParams.autoWidth = false; | ||
layoutParams.autoHeight = false; | ||
// Don't use fill or size by default (this is to trigger undefined behavior) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "undefined" behavior? You should add a definition or a link if its already documented somewhere.
Code reviewed. Please address comments. |
Code Reviewed. ACCEPTED |
Code updated. Please review again. |
Code reviewed and functionally tested. Request accepted |
TIMOB-7836: Allow fill behavior for horiztonal and veritcal layouts
https://jira.appcelerator.org/browse/TIMOB-7836
The composite layout spec changed the expected behavior in this bug. This PR is to achieve parity with iOS.
To test, please test the two cases in the Jira ticket and make sure the behavior is the same in both iOS and android.
This also fixes https://jira.appcelerator.org/browse/TIMOB-7837. We need to test for party in this jira ticket as well.