[UWP] Fix ActivityIndicator width in absolutelayout#3224
[UWP] Fix ActivityIndicator width in absolutelayout#3224PureWeen merged 5 commits intoxamarin:masterfrom paymicro:fix-gh1399-absolute-layout
Conversation
| bool heightIsProportional = (absFlags & AbsoluteLayoutFlags.HeightProportional) != 0; | ||
| bool xIsProportional = (absFlags & AbsoluteLayoutFlags.XProportional) != 0; | ||
| bool yIsProportional = (absFlags & AbsoluteLayoutFlags.YProportional) != 0; | ||
| bool widthIsProportional = absFlags.HasFlag(AbsoluteLayoutFlags.WidthProportional); |
There was a problem hiding this comment.
We intentionally avoid the HasFlag extension method because it is much slower.
|
@paymicro can you rebase to fix the conflicts please? |
|
build --uitests |
| if (!widthIsProportional && bounds.Width == AutoSize) | ||
| { | ||
| sizeRequest = view.Measure(region.Width, region.Height, MeasureFlags.IncludeMargins); | ||
| result.Width = sizeRequest.Request.Width > 0 ? sizeRequest.Request.Width : region.Width; |
There was a problem hiding this comment.
I don't think this is quite right and that 0 means AutoSize. This change means if I set the WidthRequest on anything to zero it becomes full width
For example
Content = new AbsoluteLayout()
{
Children = {
new Label(){ Text = "cat", WidthRequest = 0},
new Image(){ Source = "coffee.png", WidthRequest = 0},
new ActivityIndicator() { IsRunning = true }
}
};Causes that Label and Image to be full width
If you change out AbsoluteLayout for a StackLayout you'll see that StackLayout will measure the Label and Image to have zero width because a WidthRequest of zero means please only make the width zero.
The fix for this Issue feels like it should be inside the ActivityIndcatorRenderer on UWP
If there's a way there to see that you are allowed to autosize to just fill the region you are in
|
build |
Description of Change
ActivityIndicator in UWP occupies all available width, because it is designed for this.
Issues Resolved
Platforms Affected
-UWP
Behavioral/Visual Changes
ActivityIndicatorin UWP will be displayed when placed inAbsoluteLayoutPR Checklist