Skip to content
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

[Android] Fix height: stretch elements in columns #5085

Merged
merged 6 commits into from
Nov 25, 2020
Merged

Conversation

golddove
Copy link
Member

@golddove golddove commented Nov 17, 2020

Related Issue

Fixes #4989

Description

Elements that use LinearLayout.LayoutParams to set weight for vertical stretch fail when those elements are laid out in a FlexboxLayout. There is actually no reason for ColumnRenderer to use flexbox, it just needs the right flex properties set so the ColumnSetRenderer flexbox can correctly layout the child columns. So, reverting to use LinearLayout for ColumnRenderer.

Sample Card

(most samples were modified for these screenshots by shortening the text)

v1.1\Tests\ColumnSet*
image
image
image
image
image
image
image
image
image
image
image

v1.1\Tests\Column.VerticalAlignment
image

v1.2\Elements\Column.MinHeight
image

v1.2\Elements\ColumnSet.MinHeight
image

How Verified

Screenshots above

Microsoft Reviewers: Open in CodeFlow

@golddove golddove changed the title [Android] Fix height: stretch elements in columnds [Android] Fix height: stretch elements in columns Nov 17, 2020
ContainerStyle parentContainerStyle = renderArgs.getContainerStyle();
ContainerStyle styleForThis = ContainerRenderer.GetLocalContainerStyle(columnSet, parentContainerStyle);

for (int i = 0; i < columnVectorSize; i++)
{
Column column = columnVector.get(i);

if(columnSet.GetMinHeight() > column.GetMinHeight()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ [](start = 65, length = 1)

[nit] for style consistency with the rest of this code let's put this brace on the next line

Copy link
Contributor

@RebeccaAnne RebeccaAnne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ghost
Copy link

ghost commented Nov 22, 2020

Hi @golddove. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@ghost ghost removed the no-recent-activity label Nov 25, 2020
@ghost
Copy link

ghost commented Nov 25, 2020

Hi @golddove; Thanks for taking action on your previously stale pull request. Resetting staleness.

@golddove golddove merged commit cb9f222 into main Nov 25, 2020
@golddove golddove deleted the golddove/4989 branch November 25, 2020 17:20
rankush pushed a commit to rankush/AdaptiveCards that referenced this pull request May 8, 2024
* ColumnRenderer back to LinearLayout

* Reuse function

* ColumnSet minHeight

* Address review comment, refactor, remove extraneous empty view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android][Rendering] Elements with "height: stretch" cause other elements to vertically shrink
3 participants